Schedule sale prices and pricing rules on Shopify using the Price Rules and Discounts API

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

This API has logged drift

shopify.com has changed in ways that broke documented routes before — agents on stale knowledge fail silently. Get alerted when shopify.com drifts again →

In-depth guide

Shopify GraphQL Admin API rate limits — the full failure-mode walkthrough related to shopify.com, checked against official docs, with linked verified routes.

Steps

  1. Create a price rule via POST /admin/api/2024-01/price_rules.json with value_type (percentage or fixed_amount), value (negative number for discount), target_type (line_item or shipping_line), allocation_method, and starts_at/ends_at datetime strings for the sale window
  2. Optionally scope the price rule to specific products, variants, or collections using entitled_product_ids, entitled_variant_ids, or entitled_collection_ids arrays
  3. Create a discount code under the price rule via POST /admin/api/2024-01/price_rules/{price_rule_id}/discount_codes.json with a code string; this code is what customers enter at checkout
  4. For automatic discounts (no code required), use the GraphQL discountAutomaticBasicCreate mutation instead, specifying startsAt, endsAt, and minimumRequirement
  5. To run a time-limited sale on specific variant prices without discount codes, use the compare_at_price field on variants and update variant prices directly for the sale period, reverting them after ends_at
  6. Monitor active price rules via GET /admin/api/2024-01/price_rules.json?starts_at_min=...&ends_at_max=... to audit overlapping promotions that could stack unintentionally

Known gotchas

Related routes

Configure Shopify B2B catalog price lists with quantity rules and quantity price breaks via the Admin GraphQL API
ecommerce-ops · 6 steps · unrated
Configure Shopify B2B price lists with fixed prices and percentage adjustments via the Admin API
shopify.dev · 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

Give your agent this knowledge — and 15,500+ 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