const url = 'https://example.com/api/Subscriptions';const options = { method: 'POST', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"merchantId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","memberId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","planId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","paymentMethodId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","startDate":"2026-04-15T12:00:00Z","partnerRef":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/Subscriptions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: example' \ --data '{ "merchantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "memberId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "planId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "paymentMethodId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "startDate": "2026-04-15T12:00:00Z", "partnerRef": "example" }'Enrols a member in a plan and creates the recurring subscription at the payment gateway. If the plan has trial days, the subscription starts in Trial status. Otherwise it starts Active.
Not needed after hosted checkout. Checkout already creates the member, payment method and subscription;
store data.subscriptionId from the checkout.completed webhook instead. Calling this for a member who
already has a live subscription to the plan with the same partnerRef returns 409.
partnerRef is optional: your own id for who the subscription is for (e.g. a child). One member may hold
one live subscription per plan and partner ref, so two siblings can share a plan under different refs.
POST /api/subscriptions
{
"merchantId": "...",
"memberId": "...",
"planId": "...",
"paymentMethodId": "...",
"partnerRef": "child-123"
}Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “Header Parameters ”Required. A unique value (a UUID is ideal) per logical operation; reuse it when retrying that operation. A retry with the same key and body replays the original response instead of running twice. A 4xx frees the key, so the operation can be corrected and retried on it. A 5xx does not: the attempt may already have moved money, so retries with that key replay a problem+json saying the outcome is unknown, and a genuinely fresh attempt needs a new key. Missing → 400.
Request Body
Section titled “Request Body ”Subscription creation payload.
object
Example generated
{ "merchantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "memberId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "planId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "paymentMethodId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "startDate": "2026-04-15T12:00:00Z", "partnerRef": "example"}object
Example generated
{ "merchantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "memberId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "planId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "paymentMethodId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "startDate": "2026-04-15T12:00:00Z", "partnerRef": "example"}object
Example generated
{ "merchantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "memberId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "planId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "paymentMethodId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "startDate": "2026-04-15T12:00:00Z", "partnerRef": "example"}Responses
Section titled “ Responses ”Subscription created successfully.
object
object
Example
{ "planFrequency": "OneOff", "status": "Trial", "recentCycles": [ { "status": "Pending" } ]}Validation failed - check the errors object - or the Idempotency-Key header is missing.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}The plan’s setup fee was declined. Nothing was created and no money moved; retry with another payment method.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}The member already has a live (non-cancelled) subscription to this plan with the same partnerRef; existingSubscriptionId identifies it. Hosted checkout creates the subscription itself, so don’t call this on checkout.completed.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}