The Shopify Subscription Contracts API exposes a SubscriptionContract object with status (ACTIVE, PAUSED, CANCELLED, EXPIRED, FAILED), a next-billing-date field, a billing-policy interval, a delivery-policy interval, and the line items with the per-cycle SKU and quantity. The status field is the lever every subscription operational feature pivots on.
- . New contract created or paused contract resumed. Triggers first-box kit workflow on a brand-new contract or standard renewal on a resumed one.
- . Contract paused. Releases any allocated inventory promptly. Contract sits out of the allocation pool until resumed.
- . Contract metadata changed. Skip-month, SKU swap, quantity change, delivery address change, next-billing-date shift. The 72-hour pre-billing rebuild re-reads every active contract's state from this event.
- . Billing attempt failed. Triggers the 3-business-day inventory hold for the dunning retry window.
- . Contract cancelled by subscriber or churn-event. Routes to churn-recovery workflow if the brand has the recovery box enabled.
The 72-hour pre-billing allocation rebuild is the operational heart of the system. Three days before each unique billing date in the upcoming horizon, we run a Bulk Operations query against the Subscription Contracts API filtered to that billing date, parse the result file (every active contract's SKU and quantity for that cycle), and rebuild the inventory commit pool for the date. Contracts in PAUSED, CANCELLED, or FAILED status do not appear in the result. Skip-month contracts (status ACTIVE with a skip-cycle metadata field set) get filtered out in our processing step. The remaining contracts make up the actual allocation pool for the cycle.
For Bulk Operations specifically: the Subscription Contracts query at a typical mid-volume brand returns 5,000 to 50,000 contract records per billing date. Running that as 5,000 to 50,000 single GraphQL queries hits the rate limit before halfway through. Bulk Operations runs the query asynchronously, drops a JSONL result on Shopify's CDN, and finishes in 8 to 30 minutes depending on the contract count. That is the only viable pattern for the rebuild at subscription brand scale.