Link the content of multiple contracts
When a customer has multiple subscription contracts with the same merchant, you might want to link the content of their contracts together when their billing cycles align. When you link the content of multiple contracts together, Shopify creates only one order to handle each contract's respective billing cycles, and combines the pricing and line information. This can be useful to save on shipping, billing, and other administrative costs.
For example, a customer might have one subscription that bills and delivers weekly, and one subscription that bills and delivers monthly. When the billing and delivery for both subscriptions occur within the same week, the merchant might want to combine the subscription orders for that week so they can be fulfilled in one shipment.
This tutorial shows you how to link the contents of multiple contracts together on their respective billing cycles.
What you'll learnAnchor link to section titled "What you'll learn"
In this tutorial, you'll learn how to do the following tasks:
- Retrieve a draft of the most up-to-date contract information for a subscription billing cycle
- Link multiple contracts to the same subscription draft
- Commit the linked contract information
RequirementsAnchor link to section titled "Requirements"
- Your app can make authenticated requests to the GraphQL Admin API.
- Your app has the
write_own_subscription_contractsaccess scopes. For more information on requesting access scopes when your app is installed, refer to Getting started with OAuth.
You've created at least two active subscription contracts for the same customer with recurring billing and delivery policies.
You've familiarized yourself with managing billing cycle contracts.
Step 1: Create a subscription draftAnchor link to section titled "Step 1: Create a subscription draft"
You can use the
subscriptionBillingCycleContractEdit mutation to create a subscription draft with the most up-to-date contract information on a specified billing cycle. Choose any one of the subscription contracts to be linked, and pass the contract ID and either the index or a date belonging to the billing cycle to specify the billing cycle.
Make note of the subscription contract draft ID. You'll use it to link additional contracts in the next step.
Step 2: Link the contractsAnchor link to section titled "Step 2: Link the contracts"
After retrieving the draft ID, you can link other contracts to the draft by passing their billing cycles and the draft ID to the
Step 3: Update the subscription draft (optional)Anchor link to section titled "Step 3: Update the subscription draft (optional)"
After linking the contracts together, you can update the subscription draft if needed. For example, you might want to add a discount to reward the customer for having multiple subscriptions.
For more information about updating the subscription draft, refer to Manage billing cycle contracts.
Step 4: Commit the subscription draftAnchor link to section titled "Step 4: Commit the subscription draft"
When you commit the subscription draft, the changes that you've made become active on the billing cycles for which the draft was created and for which the contracts were linked. You can call the
subscriptionDraft query to review the information on the subscription draft before committing it.
After you're satisfied with your updates, you can call the
subscriptionBillingCycleContractDraftCommit mutation to commit the link between the respective billing cycles for each contract:
- Learn how to manage orders and fulfillments for prepaid subscriptions.