Create a subscription payment
Creates a subscription payment for a recurring product (frequencyInDays is set).
Returns a checkout URL to redirect your customer to.
For custom price products (isCustomPrice: true), provide priceCents and currency.
One-time products? Use
POST /api/payment/createinstead.
Authorizations
API key authentication
Body
ID of a subscription product
"pro_sub456"
Optional. Links the subscription to an existing customer by their stable id (as returned by
GET /api/customer and on payment responses/webhooks). Keeps the same customer linked even if
their email has changed. Takes precedence over customerEmail. Returns 404 if unknown.
255"usr_abc123"
Optional. If provided (and no customerId is given), a user account is created (or reused by
email) immediately and linked to the payment. If both are omitted, the payment is created without
a customer; the email is collected on the hosted checkout page.
"customer@example.com"
Optional. Customer first name. Backfills the display name when the customer has none. Ignored when neither customerId nor customerEmail is provided.
100"John"
Optional. Customer last name. Backfills the display name when the customer has none. Ignored when neither customerId nor customerEmail is provided.
100"Doe"
Price in cents as a string.
Required when the product has isCustomPrice: true. Must NOT be provided for fixed-price products.
This price is locked for all future renewals.
"999"
Currency for the price. Required when priceCents is provided, ignored otherwise.
USD, EUR Optional. A discount code (created via POST /api/discount/create) to pre-apply to this
subscription checkout. Applied to the amount the customer pays. Ignored if the code is invalid,
expired, exhausted, or not attached to this product.
50"WELCOME10"
Your internal reference for this subscription (e.g. an end-user account or wallet id). It is
the subscription-ownership key: reusing the same externalRef for the same customer +
product renews the existing subscription, while a different externalRef creates a
separate subscription that is billed and renewed independently. Omit it to place the
subscription in the shared "no external reference" bucket for that customer + product.
Returned on the subscription object and on every subscription webhook.
255"sub_ref_001"
Extra fields shown on the checkout page to collect information from the customer
(e.g. Discord username, referral source, terms acceptance).
Fields are collected on the initial checkout only — renewal payments do not
re-prompt the customer. The initial payment webhook carries the responses in
context.customFieldsResponse; renewal webhooks have it set to null.
Maximum 10 fields per subscription.
10
