POST

Create Draft Subscription Contract


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Creates a draft subscription contract from an existing subscription contract.

The draft subscription contract starts as a copy of the subscription contract's line items, discounts, additional fees, and buyer, billing, shipping, and recipient details. Discounts and additional fees that end before the next billing cycle aren't copied. The response includes the totals recalculated for the next billing cycle.

A subscription contract can have 1 draft subscription contract with the DRAFT status at a time, whoever created it. Before you create a draft subscription contract, call Get Subscription Contract Draftability to check that the subscription contract can be edited.

If another identity has a draft subscription contract with the DRAFT status for this subscription contract, the call fails with SUBSCRIPTION_CONTRACT_NOT_DRAFTABLE, and the error details list DRAFT_ALREADY_EXISTS_FOR_ANOTHER_OWNER.

When you already created a draft subscription contract for this subscription contract with the same target, this method returns the existing draft subscription contract instead of creating another one, and preexistingDraftSubscriptionContract is true.

A draft subscription contract expires when it has no changes for 24 hours, or when the billing cycle in its target.contractTarget.nextCycleNumber has already started. When anyone then creates a draft subscription contract for the same subscription contract, the expired draft subscription contract is deleted and replaced.

A site member can create a draft subscription contract only for a subscription contract they bought. Otherwise, the call fails with SUBSCRIPTION_CONTRACT_NOT_DRAFTABLE, and the error details list NOT_SUBSCRIPTION_CONTRACT_BUYER.

Permission Scopes
Write draft subscription contracts
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/ecom/v1/draft-subscription-contracts

Errors
404Not Found

There is 1 error with this status code.

409Already Exists

There is 1 error with this status code.

428Failed Precondition

There are 3 errors with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Event TriggersThis method triggers the following events:
Did this help?