Subscription Draft
Requires access scope.
The object represents a draft version of a
subscription contract
before it's committed. It serves as a staging area for making changes to an existing subscription or creating
a new one. The draft allows you to preview and modify various aspects of a subscription before applying the changes.
Use the object to:
- Add, remove, or modify subscription lines and their quantities
- Manage discounts (add, remove, or update manual and code-based discounts)
- Configure delivery options and shipping methods
- Set up billing and delivery policies
- Manage customer payment methods
- Add custom attributes and notes to generated orders
- Configure billing cycles and next billing dates
- Preview the projected state of the subscription
Each object maintains a projected state that shows how the subscription will look after the changes
are committed. This allows you to preview the impact of your modifications before applying them. The draft can be
associated with an existing subscription contract (for modifications) or used to create a new subscription.
The draft remains in a draft state until it's committed, at which point the changes are applied to the subscription contract and the draft is no longer accessible.
Learn more about how subscription contracts work and how to build, update, and combine subscription contracts.
Anchor to FieldsFields
- Anchor to billingCyclebilling•Subscription
Cycle Billing Cycle The billing cycle that the subscription contract will be associated with.
- Anchor to billingPolicybilling•Subscription
Policy Billing Policy! non-null The billing policy for the subscription contract.
- Anchor to concatenatedBillingCyclesconcatenated•Subscription
Billing Cycles Billing Cycle Connection! non-null The billing cycles of the contracts that will be concatenated to 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.
- Anchor to sortKeysort•Subscription
Key Billing Cycles Sort Keys Default:CYCLE_INDEX 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.
Arguments
- Anchor to currencyCodecurrency•Currency
Code Code! non-null The currency 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!non-null
The customer to whom the subscription contract belongs.
- Anchor to customerPaymentMethodcustomer•Customer
Payment Method Payment Method The customer payment method 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 deliveryOptionsdelivery•Subscription
Options Delivery Option Result The available delivery options for a given delivery address. Returns
nullfor pending requests.- Anchor to deliveryPolicydelivery•Subscription
Policy Delivery Policy! non-null The delivery policy for the subscription contract.
- Anchor to deliveryPricedelivery•Money
Price V2 The delivery price for each billing the subscription contract.
- Anchor to discountsdiscounts•Subscription
Discount Connection! non-null The list of subscription discounts which will be 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 discountsAddeddiscounts•Subscription
Added Discount Connection! non-null The list of subscription discounts to be added to 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 discountsRemoveddiscounts•Subscription
Removed Discount Connection! non-null The list of subscription discounts to be removed from 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 discountsUpdateddiscounts•Subscription
Updated Discount Connection! non-null The list of subscription discounts to be updated on 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 lineslines•Subscription
Line Connection! non-null The list of subscription lines which will be 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 linesAddedlines•Subscription
Added Line Connection! non-null The list of subscription lines to be added to 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 linesRemovedlines•Subscription
Removed Line Connection! non-null The list of subscription lines to be removed from 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 nextBillingDatenext•Date
Billing Date Time The next billing date for the subscription contract.
- Anchor to notenote•String
The note field that will be applied to the generated orders.
- Anchor to originalContractoriginal•Subscription
Contract Contract The original subscription contract.
- Anchor to statusstatus•Subscription
Contract Subscription Status The current status of the subscription contract.
- Anchor to shippingOptionsshipping•Subscription
Options Shipping Option Result Deprecated
Anchor to QueriesQueries
- •query
Returns a Subscription Draft resource by ID.
- •ID!required
The ID of the Subscription Draft to return.
Arguments
- •ID!
Anchor to MutationsMutations
- Anchor to subscriptionBillingCycleContractDraftConcatenatesubscription•mutation
Billing Cycle Contract Draft Concatenate Concatenates a contract to a Subscription Draft.
- Anchor to draftIddraft•ID!
Id required The gid of the Subscription Contract draft to update.
- Anchor to concatenatedBillingCycleContractsconcatenated•[Subscription
Billing Cycle Contracts Billing Cycle Input!]! required An array of Subscription Contracts with their selected billing cycles to concatenate to the subscription draft.
Arguments
- •mutation
Edit the contents of a subscription contract for the specified billing cycle.
- Anchor to billingCycleInputbilling•Subscription
Cycle Input Billing Cycle Input! required Input object for selecting and using billing cycles.
Arguments
- •mutation
Creates a subscription contract draft, which is an intention to create a new subscription. The draft lets you incrementally build and modify subscription details before committing them to create the actual
.The mutation requires
Customerinformation, billing details, and contract configuration including theand. You can specify the, thefor shipping, and subscription intervals.After you create the draft, you can either modify it with the
mutation or finalize and create the active subscription contract with.Learn more about building subscription contracts.
- Anchor to inputinput•Subscription
Contract Create Input! required The properties of the new Subscription Contract.
Arguments
- •mutation
Creates a draft of an existing
. The draft captures the current state of the contract and allows incremental modifications through draft mutations such as,, and.Changes remain in draft state and don't affect the live contract until committed. After you've made all necessary changes to the draft, commit it using
to apply the updates to the original contract.Learn more about updating subscription contracts.
- Anchor to contractIdcontract•ID!
Id required The gid of the Subscription Contract to update.
Arguments
- •mutation
Adds a subscription discount to a subscription draft.
- Anchor to draftIddraft•ID!
Id required The ID of the Subscription Contract draft to add a subscription discount to.
- Anchor to inputinput•Subscription
Manual Discount Input! required The properties of the new Subscription Discount.
Arguments
- •mutation
Applies a code discount on the subscription draft.
- Anchor to draftIddraft•ID!
Id required The gid of the subscription contract draft to apply a subscription code discount on.
- Anchor to redeemCoderedeem•String!
Code required Code discount redeem code.
Arguments
- •mutation
Removes a subscription discount from a subscription draft.
- Anchor to draftIddraft•ID!
Id required The gid of the subscription contract draft to remove a subscription discount from.
- Anchor to discountIddiscount•ID!
Id required The gid of the subscription draft discount to remove.
Arguments
- •mutation
Updates a subscription discount on a subscription draft.
- Anchor to draftIddraft•ID!
Id required The ID of the Subscription Contract draft to update a subscription discount on.
- Anchor to discountIddiscount•ID!
Id required The gid of the Subscription Discount to update.
- Anchor to inputinput•Subscription
Manual Discount Input! required The properties to update on the Subscription Discount.
Arguments
- •mutation
Adds a subscription free shipping discount to a subscription draft.
- Anchor to draftIddraft•ID!
Id required The ID of the subscription contract draft to add a subscription free shipping discount to.
- Anchor to inputinput•Subscription
Free Shipping Discount Input! required The properties of the new subscription free shipping discount.
Arguments
- •mutation
Updates a subscription free shipping discount on a subscription draft.
- Anchor to draftIddraft•ID!
Id required The ID of the Subscription Contract draft to update a subscription discount on.
- Anchor to discountIddiscount•ID!
Id required The gid of the Subscription Discount to update.
- Anchor to inputinput•Subscription
Free Shipping Discount Input! required The properties to update on the Subscription Free Shipping Discount.
Arguments
- •mutation
Adds a subscription line to a subscription draft.
- Anchor to draftIddraft•ID!
Id required The gid of the Subscription Contract draft to add a subscription line to.
- Anchor to inputinput•Subscription
Line Input! required The properties of the new Subscription Line.
Arguments
- •mutation
Removes a subscription line from a subscription draft.
- Anchor to draftIddraft•ID!
Id required The gid of the Subscription Contract draft to remove a subscription line from.
- Anchor to lineIdline•ID!
Id required The gid of the Subscription Line to remove.
Arguments
- •mutation
Updates a subscription line on a subscription draft.
- Anchor to draftIddraft•ID!
Id required The gid of the Subscription Contract draft to update a subscription line from.
- Anchor to lineIdline•ID!
Id required The gid of the Subscription Line to update.
- Anchor to inputinput•Subscription
Line Update Input! required The properties of the new Subscription Line.
Arguments
- •mutation
Updates a Subscription Draft.
- Anchor to draftIddraft•ID!
Id required The gid of the Subscription Draft to update.
- Anchor to inputinput•Subscription
Draft Input! required The properties of the new Subscription Contract.
Arguments