Build a Shopify Function for shipping discounts that reduces or zeroes shipping line costs

domain: ecommerce-ops · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Scaffold a shipping discount Function extension using the Shopify CLI, selecting the shipping discount Function type.
  2. Declare in `run.graphql` the shipping lines, their handles and prices, and any cart attributes or product tags needed to qualify the discount.
  3. In the Function logic, iterate over the available shipping lines returned in the input and construct discount targets using the shipping line handle as the target, specifying a percentage or fixed-amount reduction.
  4. Return a `FunctionRunResult` with the shipping discounts array; return an empty array when conditions are not met.
  5. Register via the Admin GraphQL API as an automatic shipping discount (verify mutation name against current Shopify docs), passing the Function ID and combine-with settings.
  6. Validate on a dev store by proceeding to checkout with qualifying and non-qualifying carts and observing shipping cost changes in the checkout UI.

Known gotchas

Related routes

Build a Shopify Function for order-level discounts that applies a percentage off the entire order
ecommerce-ops · 6 steps · unrated
Create and deploy a Shopify Function for custom discount logic (order-level percentage off above a spend threshold) using the Discount API surface
shopify.dev · 5 steps · unrated
Build a Shopify Function for delivery customization to reorder, rename, or hide shipping methods at checkout
ecommerce-ops · 6 steps · unrated

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?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans