Docs

Create Subscription

POST /subscriptions

POST/subscriptions

Buys a new subscription for an organization that has a billing account but no active core plan (a repurchase, never a trial), from product and seat lines, charged now. Send confirmationTokenId to pay with a new card or bank account: it is the id Stripe.js createConfirmationToken returns from the Payment Element, and it becomes the organization's default payment method. Leave it out to charge the default payment method already on file. Requires OrganizationAdmin, an Idempotency-Key header and consent (disclosureVersion and the verbatim disclosedTerms the buyer saw). If the payment is not completed, what this request created is cancelled; a declined card returns 402 with a declineCode, and a new payment method that needs 3D Secure or bank verification is refused with 400. Product ids come from Billing_GetProducts. To add to an existing subscription use Licenses_AddLicense. A success returns the outcome Applied.

Headers

FieldTypeRequiredDescription
Idempotency-KeystringOptional

Request Body

FieldTypeRequiredDescription
linesCreateSubscriptionRequestPurchaseLine[]Optional
confirmationTokenIdstringOptional
consentCreateSubscriptionRequestConsentInfoOptional

CreateSubscriptionRequestPurchaseLine

FieldTypeDescription
productIduuid
seatsinteger

CreateSubscriptionRequestConsentInfo

FieldTypeDescription
disclosureVersionstring| null
disclosedTermsstring| null

Response

FieldTypeDescription
outcomestring| null
hostedInvoiceUrlstring| null
accessUntildate-time| null