Plans
Plans customers subscribe to. Nothing is deleted — archive instead.
Lists your plans, oldest first. Pass active=true for purchasable ones only.
Authorization
apiKey Organisation-scoped key from Settings → API Keys.
In: header
Query Parameters
true returns only active (purchasable) plans.
Response Body
application/json
application/json
application/json
curl -X GET "https://example.com/plans?active=true"{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "OK" }, "result": { "plans": [ { "id": "string", "name": "string", "description": "string", "billingCycle": "MONTHLY", "cost": 0, "priceAdjustment": 0, "walletFundedArrear": true, "currencyCode": "string", "isActive": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "entitlements": [ { "id": "string", "type": "WALLET", "billingMode": "ADVANCE", "creditId": "string", "outcomeId": "string", "unitId": "string", "compositeId": "string", "targetName": "string", "quantity": 0, "amount": 0, "rollover": false } ] } ] }}{ "statusCode": 401, "statusDetail": { "status": "ERROR", "message": "Invalid API key." }, "result": {}}{ "statusCode": 500, "statusDetail": { "status": "ERROR", "message": "Could not complete the request." }, "result": {}}Creates a plan in your workspace's primary currency.
Authorization
apiKey Organisation-scoped key from Settings → API Keys.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/plans" \ -H "Content-Type: application/json" \ -d '{ "name": "Pro", "description": "For growing teams", "billingCycle": "MONTHLY", "entitlements": [ { "type": "CREDIT", "billingMode": "ADVANCE", "creditId": "cr_8f2k1", "quantity": 1000, "rollover": true }, { "type": "OUTCOME", "billingMode": "ARREAR", "outcomeId": "oc_3n7p2" }, { "type": "PRICING_METRIC", "billingMode": "ADVANCE", "compositeId": "cmp_7d1x9", "quantity": 50 }, { "type": "WALLET", "billingMode": "ADVANCE", "amount": 25 } ] }'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "OK" }, "result": { "created": true, "plan": { "id": "string", "name": "string", "description": "string", "billingCycle": "MONTHLY", "cost": 0, "priceAdjustment": 0, "walletFundedArrear": true, "currencyCode": "string", "isActive": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "entitlements": [ { "id": "string", "type": "WALLET", "billingMode": "ADVANCE", "creditId": "string", "outcomeId": "string", "unitId": "string", "compositeId": "string", "targetName": "string", "quantity": 0, "amount": 0, "rollover": false } ] } }}{ "statusCode": 400, "statusDetail": { "status": "ERROR", "message": "Request body must be valid JSON." }, "result": {}}{ "statusCode": 401, "statusDetail": { "status": "ERROR", "message": "Invalid API key." }, "result": {}}{ "statusCode": 409, "statusDetail": { "status": "ERROR", "message": "Customer \"cus_abc123\" is archived." }, "result": {}}{ "statusCode": 500, "statusDetail": { "status": "ERROR", "message": "Could not complete the request." }, "result": {}}Updates only the fields you send. Changes apply to new purchases.
Authorization
apiKey Organisation-scoped key from Settings → API Keys.
In: header
Path Parameters
Plan id.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Any create fields.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PATCH "https://example.com/plans/pl_2h6m3" \ -H "Content-Type: application/json" \ -d '{ "name": "Pro Monthly" }'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "OK" }, "result": { "updated": true, "plan": { "id": "string", "name": "string", "description": "string", "billingCycle": "MONTHLY", "cost": 0, "priceAdjustment": 0, "walletFundedArrear": true, "currencyCode": "string", "isActive": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "entitlements": [ { "id": "string", "type": "WALLET", "billingMode": "ADVANCE", "creditId": "string", "outcomeId": "string", "unitId": "string", "compositeId": "string", "targetName": "string", "quantity": 0, "amount": 0, "rollover": false } ] } }}{ "statusCode": 400, "statusDetail": { "status": "ERROR", "message": "Request body must be valid JSON." }, "result": {}}{ "statusCode": 401, "statusDetail": { "status": "ERROR", "message": "Invalid API key." }, "result": {}}{ "statusCode": 404, "statusDetail": { "status": "ERROR", "message": "No customer with id \"cus_abc123\"." }, "result": {}}{ "statusCode": 409, "statusDetail": { "status": "ERROR", "message": "Customer \"cus_abc123\" is archived." }, "result": {}}{ "statusCode": 500, "statusDetail": { "status": "ERROR", "message": "Could not complete the request." }, "result": {}}Gets one plan.
Authorization
apiKey Organisation-scoped key from Settings → API Keys.
In: header
Path Parameters
Plan id.
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/plans/pl_2h6m3"{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "OK" }, "result": { "plan": { "id": "string", "name": "string", "description": "string", "billingCycle": "MONTHLY", "cost": 0, "priceAdjustment": 0, "walletFundedArrear": true, "currencyCode": "string", "isActive": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "entitlements": [ { "id": "string", "type": "WALLET", "billingMode": "ADVANCE", "creditId": "string", "outcomeId": "string", "unitId": "string", "compositeId": "string", "targetName": "string", "quantity": 0, "amount": 0, "rollover": false } ] } }}{ "statusCode": 401, "statusDetail": { "status": "ERROR", "message": "Invalid API key." }, "result": {}}{ "statusCode": 404, "statusDetail": { "status": "ERROR", "message": "No customer with id \"cus_abc123\"." }, "result": {}}{ "statusCode": 500, "statusDetail": { "status": "ERROR", "message": "Could not complete the request." }, "result": {}}Archives a plan. Nothing is deleted.
Authorization
apiKey Organisation-scoped key from Settings → API Keys.
In: header
Path Parameters
Plan id.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/plans/pl_2h6m3/archive"{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "OK" }, "result": { "archived": true, "plan": { "id": "string", "name": "string", "description": "string", "billingCycle": "MONTHLY", "cost": 0, "priceAdjustment": 0, "walletFundedArrear": true, "currencyCode": "string", "isActive": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "entitlements": [ { "id": "string", "type": "WALLET", "billingMode": "ADVANCE", "creditId": "string", "outcomeId": "string", "unitId": "string", "compositeId": "string", "targetName": "string", "quantity": 0, "amount": 0, "rollover": false } ] } }}{ "statusCode": 401, "statusDetail": { "status": "ERROR", "message": "Invalid API key." }, "result": {}}{ "statusCode": 404, "statusDetail": { "status": "ERROR", "message": "No customer with id \"cus_abc123\"." }, "result": {}}{ "statusCode": 500, "statusDetail": { "status": "ERROR", "message": "Could not complete the request." }, "result": {}}Restores an archived plan.
Authorization
apiKey Organisation-scoped key from Settings → API Keys.
In: header
Path Parameters
Plan id.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/plans/pl_2h6m3/unarchive"{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "OK" }, "result": { "unarchived": true, "plan": { "id": "string", "name": "string", "description": "string", "billingCycle": "MONTHLY", "cost": 0, "priceAdjustment": 0, "walletFundedArrear": true, "currencyCode": "string", "isActive": true, "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "entitlements": [ { "id": "string", "type": "WALLET", "billingMode": "ADVANCE", "creditId": "string", "outcomeId": "string", "unitId": "string", "compositeId": "string", "targetName": "string", "quantity": 0, "amount": 0, "rollover": false } ] } }}{ "statusCode": 401, "statusDetail": { "status": "ERROR", "message": "Invalid API key." }, "result": {}}{ "statusCode": 404, "statusDetail": { "status": "ERROR", "message": "No customer with id \"cus_abc123\"." }, "result": {}}{ "statusCode": 500, "statusDetail": { "status": "ERROR", "message": "Could not complete the request." }, "result": {}}