POST/Subscription/

Create a subscription

Creates a subscription for a contact using the specified payment provider and payment terms. Supply userId, psp, amount, currency, purpose, paymentInterval, period, and cancellationInterval to define the subscription. A successful response returns the created subscription record.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

10 body fields

Subscription details, including the contact, payment provider, amount, currency, and billing terms.

amountstringrequired
The amount of the payment to fire in cents.
cancellationIntervalstringrequired
The interval of cancellation as string. (see PHP documentation of date interval for format)
currencystringrequired
The ISO code of the currency of the payment.
paymentIntervalstringrequired
The payment interval as string. (see PHP documentation of date interval for format)
periodstringrequired
The subscription's period as string. (see PHP documentation of date interval for format)
pspstringrequired
The ID of the psp to use.
purposestringrequired
The payment purpose. What is the payer paying for?
referenceIdstringoptional
The internal reference id. (Will be sent back with Webhook, can be used as identification)
userIdstringrequired
The contact id you got from webhook.
vatRatestringoptional
VAT Rate Percentage

3 status codes
200Returns an object containing the created subscription record in a `data` array and a `status` field.
dataarray<object>optional
statusstringoptional
400Returned when a required field is missing or a request value is invalid.
errorobjectoptional
messagestringoptional
reasonstringoptional
statusstringoptional
404Returned when the referenced contact or payment provider cannot be found.
errorobjectoptional
messagestringoptional
reasonstringoptional
statusstringoptional

Error handling

The userId, psp, amount, currency, purpose, paymentInterval, period, and cancellationInterval body fields are required; omitting any returns a 400. A 404 is returned when the referenced contact or payment provider cannot be found.