Skip to main content
Anchor to SubscriptionContract

SubscriptionContract

object

Requires the read_own_subscription_contracts or write_own_subscription_contracts 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 SubscriptionBillingPolicy and SubscriptionDeliveryPolicy that control the frequency of charges and fulfillments. SubscriptionLine items define the products, quantities, and pricing for each recurring Order. The contract tracks SubscriptionBillingAttempt 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.

•App

The subscription app that the subscription contract is registered to.

•URL

The URL of the subscription contract page on the subscription app.

•SubscriptionBillingAttemptConnection!
non-null

The list of billing attempts associated with the subscription contract.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.


•SubscriptionBillingPolicy!
non-null

The billing policy associated with the subscription contract.

•DateTime!
non-null

The date and time when the subscription contract was created.

•CurrencyCode!
non-null

The currency that's used for the subscription contract.

•[Attribute!]!
non-null

A list of the custom attributes to be added to the generated orders.

•Customer

The customer to whom the subscription contract belongs.

Anchor to customerPaymentMethodcustomerPaymentMethod
•CustomerPaymentMethod

The customer payment method that's used for the subscription contract.

Arguments

•Boolean
Default:false

Whether to show the customer's revoked payment method.


•SubscriptionDeliveryMethod

The delivery method for each billing of the subscription contract.

•SubscriptionDeliveryPolicy!
non-null

The delivery policy associated with the subscription contract.

•MoneyV2!
non-null

The delivery price for each billing of the subscription contract.

•SubscriptionManualDiscountConnection!
non-null

The list of subscription discounts associated with the subscription contract.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.


•ID!
non-null

A globally-unique ID.

Anchor to lastBillingAttemptErrorTypelastBillingAttemptErrorType
•SubscriptionContractLastBillingErrorType

The last billing error type of the contract.

•SubscriptionContractLastPaymentStatus

The current status of the last payment.

•SubscriptionLineConnection!
non-null

The list of subscription lines associated with the subscription contract.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.


•Count

The number of lines associated with the subscription contract.

•DateTime

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.

•String

The note field that will be applied to the generated orders.

•OrderConnection!
non-null

A list of the subscription contract's orders.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.


•Order

The order from which this contract originated.

•UnsignedInt64!
non-null

The revision id of the contract.

•SubscriptionContractSubscriptionStatus!
non-null

The current status of the subscription contract.

•DateTime!
non-null

The date and time when the subscription contract was updated.

•Int!
non-nullDeprecated

Was this section helpful?

•query

Retrieves a SubscriptionContract by ID.

The contract tracks the subscription's lifecycle through various statuses, and links to related billing attempts, generated Order objects, and the customer's CustomerPaymentMethod.

Arguments

•ID!
required

The ID of the Subscription Contract to return.


•query

Returns a SubscriptionContractConnection containing subscription contracts. Subscription contracts are agreements between customers and merchants for recurring purchases with defined billing and delivery schedules.

Filter results with the query argument. You can paginate results using standard cursor-based pagination.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.

•SubscriptionContractsSortKeys
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.

•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.

Anchor to created_at
•time
•id

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
Anchor to last_billing_attempt_error_type
•string
•string
Anchor to updated_at
•time


Was this section helpful?

•mutation

Activates a Subscription Contract. Contract status must be either active, paused, or failed.

Arguments

Anchor to subscriptionContractIdsubscriptionContractId
•ID!
required

The ID of the Subscription Contract.


•mutation

Creates a Subscription Contract.

Arguments

•SubscriptionContractAtomicCreateInput!
required

The properties of the new Subscription Contract.


•mutation

Cancels a Subscription Contract.

Arguments

Anchor to subscriptionContractIdsubscriptionContractId
•ID!
required

The ID of the Subscription Contract.


•mutation

Expires a Subscription Contract.

Arguments

Anchor to subscriptionContractIdsubscriptionContractId
•ID!
required

The ID of the Subscription Contract.


•mutation

Fails a Subscription Contract.

Arguments

Anchor to subscriptionContractIdsubscriptionContractId
•ID!
required

The ID of the Subscription Contract.


•mutation

Pauses a Subscription Contract.

Arguments

Anchor to subscriptionContractIdsubscriptionContractId
•ID!
required

The ID of the Subscription Contract.


•mutation

Allows for the easy change of a Product in a Contract or a Product price change.

Arguments

Anchor to subscriptionContractIdsubscriptionContractId
•ID!
required

The ID of the subscription contract.

•ID!
required

The gid of the Subscription Line to update.

•SubscriptionContractProductChangeInput!
required

The properties of the Product changes.


•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.

Arguments

•ID!
required

The gid of the Subscription Contract to set the next billing date for.

•DateTime!
required

The next billing date.


•mutation

Commits the updates of a Subscription Contract draft.

Arguments

•ID!
required

The gid of the Subscription Contract draft to commit.



Was this section helpful?


Was this section helpful?