Subscription Contract
Requires the or scope.
A subscription contract that defines recurring purchases for a customer. Each contract specifies what products to deliver, when to bill and ship them, and at what price.
The contract includes and that control the frequency of charges and fulfillments. items define the products, quantities, and pricing for each recurring Order. The contract tracks records, payment status, and generated orders throughout its lifecycle. App instances manage contracts through various status transitions including active, paused, failed, cancelled, or expired states.
Learn more about building subscription contracts and updating subscription contracts.
Anchor to FieldsFields
- •App
The subscription app that the subscription contract is registered to.
- Anchor to appAdminUrlapp•URL
Admin Url The URL of the subscription contract page on the subscription app.
- Anchor to billingAttemptsbilling•Subscription
Attempts Billing Attempt Connection! non-null The list of billing attempts associated with the subscription contract.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
Arguments
- Anchor to billingPolicybilling•Subscription
Policy Billing Policy! non-null The billing policy associated with the subscription contract.
- Anchor to createdAtcreated•Date
At Time! non-null The date and time when the subscription contract was created.
- Anchor to currencyCodecurrency•Currency
Code Code! non-null The currency that's used for the subscription contract.
- Anchor to customAttributescustom•[Attribute!]!
Attributes non-null A list of the custom attributes to be added to the generated orders.
- Anchor to customercustomer•Customer
The customer to whom the subscription contract belongs.
- Anchor to customerPaymentMethodcustomer•Customer
Payment Method Payment Method The customer payment method that's used for the subscription contract.
- Anchor to showRevokedshow•Boolean
Revoked Default:false Whether to show the customer's revoked payment method.
Arguments
- Anchor to deliveryMethoddelivery•Subscription
Method Delivery Method The delivery method for each billing of the subscription contract.
- Anchor to deliveryPolicydelivery•Subscription
Policy Delivery Policy! non-null The delivery policy associated with the subscription contract.
- Anchor to deliveryPricedelivery•Money
Price V2! non-null The delivery price for each billing of the subscription contract.
- Anchor to discountsdiscounts•Subscription
Manual Discount Connection! non-null The list of subscription discounts associated with the subscription contract.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
Arguments
- •ID!non-null
A globally-unique ID.
- Anchor to lastBillingAttemptErrorTypelast•Subscription
Billing Attempt Error Type Contract Last Billing Error Type The last billing error type of the contract.
- Anchor to lastPaymentStatuslast•Subscription
Payment Status Contract Last Payment Status The current status of the last payment.
- Anchor to lineslines•Subscription
Line Connection! non-null The list of subscription lines associated with the subscription contract.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
Arguments
- Anchor to linesCountlines•Count
Count The number of lines associated with the subscription contract.
- Anchor to nextBillingDatenext•Date
Billing Date Time The next billing date for the subscription contract. This field is managed by the apps. Alternatively you can utilize our Billing Cycles APIs, which provide auto-computed billing dates and additional functionalities.
- Anchor to notenote•String
The note field that will be applied to the generated orders.
- Anchor to ordersorders•Order
Connection! non-null A list of the subscription contract's orders.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
Arguments
- Anchor to originOrderorigin•Order
Order The order from which this contract originated.
- Anchor to revisionIdrevision•Unsigned
Id Int64! non-null The revision id of the contract.
- Anchor to statusstatus•Subscription
Contract Subscription Status! non-null The current status of the subscription contract.
- Anchor to updatedAtupdated•Date
At Time! non-null The date and time when the subscription contract was updated.
- Anchor to lineCountline•Int!
Count non-nullDeprecated
Anchor to QueriesQueries
- •query
The contract tracks the subscription's lifecycle through various statuses, and links to related billing attempts, generated
Orderobjects, and the customer's.- •ID!required
The ID of the Subscription Contract to return.
Arguments
- •ID!
- •query
Returns a
containing subscription contracts. Subscription contracts are agreements between customers and merchants for recurring purchases with defined billing and delivery schedules.Filter results with the
queryargument. You can paginate results using standard cursor-based pagination.- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Subscription
Key Contracts Sort Keys Default:CREATED_AT Sort the underlying list using a key. If your query is slow or returns an error, then try specifying a sort key that matches the field used in the search.
- Anchor to queryquery•String
A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.
Arguments
Anchor to MutationsMutations
- •mutation
Activates a Subscription Contract. Contract status must be either active, paused, or failed.
- Anchor to subscriptionContractIdsubscription•ID!
Contract Id required The ID of the Subscription Contract.
Arguments
- •mutation
Creates a Subscription Contract.
- Anchor to inputinput•Subscription
Contract Atomic Create Input! required The properties of the new Subscription Contract.
Arguments
- •mutation
Cancels a Subscription Contract.
- Anchor to subscriptionContractIdsubscription•ID!
Contract Id required The ID of the Subscription Contract.
Arguments
- •mutation
Expires a Subscription Contract.
- Anchor to subscriptionContractIdsubscription•ID!
Contract Id required The ID of the Subscription Contract.
Arguments
- •mutation
Fails a Subscription Contract.
- Anchor to subscriptionContractIdsubscription•ID!
Contract Id required The ID of the Subscription Contract.
Arguments
- •mutation
Pauses a Subscription Contract.
- Anchor to subscriptionContractIdsubscription•ID!
Contract Id required The ID of the Subscription Contract.
Arguments
- •mutation
Allows for the easy change of a Product in a Contract or a Product price change.
- Anchor to subscriptionContractIdsubscription•ID!
Contract Id required The ID of the subscription contract.
- Anchor to lineIdline•ID!
Id required The gid of the Subscription Line to update.
- Anchor to inputinput•Subscription
Contract Product Change Input! required The properties of the Product changes.
Arguments
- •mutation
Sets the next billing date of a Subscription Contract. This field is managed by the apps. Alternatively you can utilize our Billing Cycles APIs, which provide auto-computed billing dates and additional functionalities.
- Anchor to contractIdcontract•ID!
Id required The gid of the Subscription Contract to set the next billing date for.
- Anchor to datedate•Date
Time! required The next billing date.
Arguments
- •mutation
Commits the updates of a Subscription Contract draft.
- Anchor to draftIddraft•ID!
Id required The gid of the Subscription Contract draft to commit.
Arguments