A Shopify cart transform in a real cart

A cart transform is a function an app registers on a store. Shopify runs it each time a cart is priced, and it can change what a line is: its price, its title, or the lines it is made of. These carts show a price it set, read through the Storefront API.

Verified 3 November 2026 on Shopify’s 2026-10 API, in carts built on a real store. Each statement marked with a tick is checked against the cart Shopify returned.

The transform's price becomes the line's own price

The function behind these carts belongs to an app's cart transform. It reads a cart attribute to decide what to do; given one, it returns an update operation that sets a fixed price per unit on a cart line.

The cart reports that price as the line's price. Nothing marks it as changed: the variant still costs $40.00 in the catalog, and the cart line reads $34.00. Shopify runs an update operation only on Shopify Plus stores and development stores; this store is both.

The operation the function returns for this cart
{
  "operations": [
    {
      "lineUpdate": {
        "cartLineId": "gid://shopify/CartLine/…",
        "price": {
          "adjustment": { "fixedPricePerUnit": { "amount": "34.00" } }
        }
      }
    }
  ]
}
A cart transform prices one lineVerified 3 November 2026 · API 2026-10

Into the cart

  • 1 × Single Bag at $40.00, bought once
  • The cart attribute the app's cart transform reads

What Shopify returned

The cart Shopify returned: A cart transform prices one line
LineQuantityPriceDiscounts on the lineLine total
Single Bag1$34.00none$34.00
Discounts on the cartnone
Cart total$34.00

What that shows

  • The line's price read $34.00, not the variant's $40.00, and the cart's subtotal and total were $34.00.
  • No discount allocation appeared anywhere in the cart, and no warning: the $6.00 is not reported as a discount.

A transform's price is not a discount

The same product on the same store can be priced by a discount function instead. That saving comes back as an allocation on the line, under the discount's title, and the line's price before discounts stays at the variant's.

The transform's saving is in no list. A buy box that builds its strikethrough from the cart's discount allocations has nothing to show for the line above, and one that reads the line's price shows $34.00 as if it were the catalog price.

A discount function prices one lineVerified 3 November 2026 · API 2026-10

Into the cart

  • 1 × Single Bag at $40.00, bought once
  • The cart attribute the app discount's function reads

What Shopify returned

The cart Shopify returned: A discount function prices one line
LineQuantityPriceDiscounts on the lineLine total
Single Bag1$40.00−$10.00 automatic, “Offer Suite”$30.00
Discounts on the cartnone
Cart total$30.00

What that shows

  • The $40.00 line cost $30.00.
  • The line carried one automatic discount allocation of $10.00, named by the discount's title.
  • The cart's own list of discount allocations was empty: a product discount is reported on its line only.

Without the attribute, the transform leaves no trace

The transform is still registered on the store and its function still runs on this cart. It finds no attribute and returns an empty list of operations.

The cart reads as it would on a store with no cart transform at all.

A cart transform that returns no operationsVerified 3 November 2026 · API 2026-10

Into the cart

  • 1 × Single Bag at $40.00, bought once
  • No cart attribute, so the app's functions return no operations

What Shopify returned

The cart Shopify returned: A cart transform that returns no operations
LineQuantityPriceDiscounts on the lineLine total
Single Bag1$40.00none$40.00
Discounts on the cartnone
Cart total$40.00

What that shows

  • The line's price was the variant's $40.00, and so was the cart total.
  • Nothing in the cart says a cart transform ran: no allocation and no warning.

An update acts on a whole line

An update operation names a cart line, not a quantity of it. This function prices one unit, so for a line of two it returns no operation, and both units stay at the variant's price in one line.

A discount behaves differently. A discount candidate can target one unit of a line, and Shopify then splits the line in two, as the second cart shows.

A line of two, and a transform that prices one unitVerified 3 November 2026 · API 2026-10

Into the cart

  • 2 × Single Bag at $40.00, bought once
  • The cart attribute the app's cart transform reads

What Shopify returned

The cart Shopify returned: A line of two, and a transform that prices one unit
LineQuantityPriceDiscounts on the lineLine total
Single Bag2$40.00none$80.00
Discounts on the cartnone
Cart total$80.00

What that shows

  • The cart came back as one line of quantity 2: it was not split.
  • Both units were at the variant's $40.00, a cart total of $80.00, with no allocation and no warning.
A function discounts one unit of a line of twoVerified 3 November 2026 · API 2026-10

Into the cart

  • 2 × Single Bag at $40.00, bought once
  • The cart attribute the app discount's function reads

What Shopify returned

The cart Shopify returned: A function discounts one unit of a line of two
LineQuantityPriceDiscounts on the lineLine total
Single Bag1$40.00none$40.00
Single Bag1$40.00−$10.00 automatic, “Offer Suite”$30.00
Discounts on the cartnone
Cart total$70.00

What that shows

  • One line of quantity 2 went in; the cart came back with two lines of quantity 1.
  • One of them cost $30.00 with the $10.00 allocation, the other $40.00 with none.
  • The cart total was $70.00.

Discount codes are taken from the transform's price

To a discount, the transform's price is the price. An order code's percentage was taken from $34.00, so a margin forecast for a buyer with a code starts from the transform's price.

A product code on the same line applied as well. Two product discounts on one line do not stack; a transform's price and a product discount do, because only one of them is a discount.

An order code on a line priced by a cart transformVerified 3 November 2026 · API 2026-10

Into the cart

  • 1 × Single Bag at $40.00, bought once
  • The cart attribute the app's cart transform reads
  • Code VERIFY-ORDER10: 10% off the order, one-time purchases only, combines with product and shipping discounts

What Shopify returned

The cart Shopify returned: An order code on a line priced by a cart transform
LineQuantityPriceDiscounts on the lineLine total
Single Bag1$34.00none$34.00
Discounts on the cart−$3.40 code VERIFY-ORDER10
Cart total$30.60
  • VERIFY-ORDER10 applicable: true

What that shows

  • The code applied, and took 10% of the transform's $34.00, not of the variant's $40.00: $3.40.
  • The cart total was $30.60. The line still read $34.00 and carried no allocation; the code's was in the cart's list.
A product code on a line priced by a cart transformVerified 3 November 2026 · API 2026-10

Into the cart

  • 1 × Single Bag at $40.00, bought once
  • The cart attribute the app's cart transform reads
  • Code VERIFY-BAG5: $5.00 off the bag, one-time purchases only, combines with product, order and shipping discounts

What Shopify returned

The cart Shopify returned: A product code on a line priced by a cart transform
LineQuantityPriceDiscounts on the lineLine total
Single Bag1$34.00−$5.00 code VERIFY-BAG5$29.00
Discounts on the cartnone
Cart total$29.00
  • VERIFY-BAG5 applicable: true

What that shows

  • The code applied on the line: $5.00 off the transform's $34.00, a line total and a cart total of $29.00.
  • The line's price before discounts read $34.00, and the code's allocation was the only one in the cart.

The delivery rates are the store's own

A price set by a transform changes merchandise. With a delivery address, this cart was quoted the rates the store quotes for the same product at its catalog price, and nothing discounted them.

A line priced by a cart transform, with a delivery addressVerified 3 November 2026 · API 2026-10

Into the cart

  • 1 × Single Bag at $40.00, bought once
  • The cart attribute the app's cart transform reads
  • A US delivery address, with the cheapest rate selected

What Shopify returned

The cart Shopify returned: A line priced by a cart transform, with a delivery address
LineQuantityPriceDiscounts on the lineLine total
Single Bag1$34.00none$34.00
Discounts on the cartnone
Delivery: Standard selectedQuoted: Standard $8.00, Express $15.00none$8.00
Cart total$42.00

What that shows

  • The store quoted Standard at $8.00 and Express at $15.00, and no discount was allocated to the rate or anywhere else in the cart.
  • With Standard selected the cart total was $42.00: the $34.00 line and the $8.00 rate.
The same cart with no discountVerified 3 November 2026 · API 2026-10

Into the cart

  • 1 × Single Bag at $40.00, bought once
  • No cart attribute, so the app's functions return no operations
  • A US delivery address, with the cheapest rate selected

What Shopify returned

The cart Shopify returned: The same cart with no discount
LineQuantityPriceDiscounts on the lineLine total
Single Bag1$40.00none$40.00
Discounts on the cartnone
Delivery: Standard selectedQuoted: Standard $8.00, Express $15.00none$8.00
Cart total$48.00

What that shows

  • The store quoted Standard at $8.00 and Express at $15.00; with Standard selected the cart total was $48.00.

How this was verified

Every cart on this page was built through the Storefront API on a Shopify Plus development store we keep for this, on API version 2026-10, and read back as Shopify priced it. The store sells one product in these carts: Single Bag, at $40.00, also sold on a selling plan named “Every 30 days” that has no pricing policy. It quotes two delivery rates to a US address.

It has one automatic app discount, titled “Offer Suite”, with a product class and a shipping class, set to combine with product, order and shipping discounts. Its function reads a cart attribute: with it, the function takes 25% off one unit of Single Bag bought once, or $8.00 off the unit on its selling plan, and makes the cheapest delivery rate free. Without it, the function returns no operations.

The same app has a cart transform registered on the store. Its function reads a cart attribute of the same kind: with it, the function sets the price of one unit of Single Bag bought once to $34.00. Without it, or for a line of more than one unit, the function returns no operations.

The other discounts in these carts, as they are set on the store
DiscountClassGivesCombination setting
Code VERIFY-ORDER10Order10% off the order, one-time purchases onlycombines with product and shipping discounts
Code VERIFY-BAG5Product$5.00 off the bag, one-time purchases onlycombines with product, order and shipping discounts

A suite builds these carts again and reads the discount settings from the store before it does. A statement that no longer matches the cart takes this page down until it is corrected, and no cart stands for more than 90 days without being built again. This is what one store returned on one API version: your store’s plan, markets and other apps can change the result, so build the cart.

Seen something different on your store? Write to privacy@offersuite.io with the cart and we’ll run it.