Handle Shopify subscription contract billing attempts and dunning via the Subscriptions API

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

  1. Listen for the subscription_billing_attempts/failure webhook; the payload includes subscription_contract_id, error_code, and billing_attempt_id
  2. Query the failed billing attempt with GET /admin/api/2025-07/subscription_billing_attempts/BILLING_ATTEMPT_ID.json to retrieve error_code and error_message
  3. Trigger a new billing attempt after a delay using POST /admin/api/2025-07/subscription_billing_attempts.json with subscription_contract_id in the body
  4. If the card is declined, send a payment update URL to the customer by generating a payment update URL via subscriptionContractUpdate with a new paymentMethodId, or redirect to the customer portal
  5. After receiving subscription_billing_attempts/success webhook, confirm the resulting order_id is present in the payload and fulfill accordingly
  6. Set a maximum retry count in your own logic — Shopify does not automatically retry failed billing attempts; your app owns the dunning cadence

Known gotchas

Related routes

Handle a Shopify SubscriptionContract billing attempt failure and trigger a dunning retry via the Subscriptions API
shopify.dev · 5 steps · unrated
Trigger a Shopify subscription billing attempt and implement dunning retries via subscriptionBillingAttemptCreate
ecommerce-ops · 6 steps · unrated
Register and handle Shopify webhooks for subscription billing attempt success and failure events
ecommerce-ops · 6 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