Build a Shopify cartTransform Function using the update operation to override the price of a cart line item for custom pricing logic
domain: shopify.dev · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
In-depth guide
Shopify GraphQL Admin API rate limits — the full failure-mode walkthrough related to shopify.dev, checked against official docs, with linked verified routes.
Steps
Scaffold a cartTransform Function and ensure the extension TOML declares the `cart.transform` target; the update operation requires a Shopify Plus merchant or development store
In `run.graphql`, query the cart lines including merchandise IDs, current prices, quantities, and any metafields that drive your pricing rules
In your Function run handler, return an `UpdateOperation` for each line you want to reprice, specifying the `price` field with the new `Money` value (amount and currencyCode)
You can also override `title` and `image` on the updated line to reflect a custom product presentation alongside the price change
Return a no-op (empty operations array) for lines that do not meet the pricing condition to leave them unchanged
Deploy and test: confirm the overridden price appears in cart and that checkout total reflects the Function-adjusted amount
Known gotchas
The update operation is gated behind Shopify Plus (or a dev store on Plus plan) — attempting to use it on a Basic/Grow plan store will result in the operation being silently skipped
Prices set by a cartTransform update operation are not reflected in draft orders or order editing; they apply only during the live checkout flow
Currency must match the cart's presentment currency; providing a mismatched currencyCode will cause a validation error at Function execution time
Give your agent this knowledge — and 15,600+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?