Subscriptions · Subscribe a customer
API reference / Subscriptions
Subscribe a customer
POST/api/v1/billing_subscriptions/linkno app scope
Creates the first order of a subscription. Send the customer to its payment URL; when they pay, the subscription starts and their card is kept for renewals.
Body
plan_idstringrequired
The plan's uid. The plan must be active.
reference_idstringrequired
Your own ID.
titlestringrequired
Shown on the payment page.
customerobjectrequired
Who is paying. Matched to an existing customer by email.
emailstringrequired
Receipts go here.
first_namestring
First name.
last_namestring
Last name.
phonestring
With country code.
meta_dataobject
Your own data, e.g. return_url.
Headers
Authorizationheaderrequired
Bearer with your secret key, or the merchant's OAuth token.
Returns
The order, with payment_urls, and 201.
Errors
401 | The key or token is missing, wrong or revoked, is for the other environment, or doesn't have the scope this endpoint needs. |
200 | state: "error" with Active Plan Not Found: the plan doesn't exist or isn't active. |
422 | A field is wrong. |