ClocknextClocknextHelp
DocumentationAPI ReferenceMCP Tools
Dashboard

Get started

OverviewQuickstart

Good to know

Response formatHandling errorsPaginating resultsSending data reliablyYour own customer idsWebhooks

API reference

Signals

Record credit POSTRecord outcome POSTComplete outcome POSTRecord wallet POSTRecord unit POSTComplete composite POSTList raw signals GETRetry signals POSTList Customer Usage Log GETLook Up Usage Logs by ID GET

Deprecated

Record credit POSTRecord outcome POSTComplete outcome POSTRecord wallet POSTRecord unit POSTComplete composite POSTList raw signals GETRetry signals POST

Customers

List customers GETCreate a customer POSTGet a customer GETUpdate a customer PATCHDelete a customer DELETEGet a customer's balances GETGet a customer's wallet ledger GETSet a customer's low-balance alert for wallet PUTGet a customer's current plan GETChange a recurring grant PUTUpdate a customer's card POSTGet a customer's invoice balance GETAdjust a customer's invoice balance POST

Deprecated

List Customer Usage Log GETLook Up Usage Logs by ID GET

Manage

Manage a customer's credit balance POSTManage a customer's outcome balance POSTManage a customer's unit balance POSTManage a customer's composite balance POSTManage a customer's wallet balance POST

Members

List a customer's members GETAdd a member POSTUpdate a member PATCHRemove a member DELETE

Plans and Entitlements

PlansPackagesCreditsOutcomesUnitsComposites

Taxes

List taxes GETCreate a tax POSTGet a tax GETUpdate a tax PATCH

Purchases

List purchases GETCreate a purchase POSTGet a purchase GETUpdate a purchase's auto-payment setting PATCHCancel a purchase POST

Checkout

Create a checkout POST

Subscriptions

List subscriptions GETGet a subscription GETCancel a subscription POSTAdd packages to a subscription POSTRemove a package from a subscription POST

Plan changes

List plan changes GETPreview a plan change POSTChange a customer's plan POSTGet a plan change GET

Invoices

List invoices GETGet an invoice GETMint a hosted pay link GETRecord a payment POST

Credit notes

List credit notes GETCreate a credit note POSTGet a credit note GETVoid a credit note POST

Refunds

List refunds GETRefund to the card POSTGet a refund GET

Payments

List payments GETGet a payment GET

Webhooks

Customer Portal

Mint a customer-portal access token POST

Plans

Plans customers subscribe to. Nothing is deleted — archive instead.

List plans in an organization

Base URL https://payments.clocknext.com/api/v1

GET
/plans

Lists your plans, oldest first. Pass active=true for purchasable ones only.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Query Parameters

active?boolean

true returns only active (purchasable) plans.

Response Body

Plans.

application/json
  1. response
  1. response
  2. …
statusCode*integer

The HTTP status code of the response, repeated in the body.

statusDetail*

The status of the request. status is SUCCESS, and message says what happened.

result*

The workspace's plans.

Example Request
curl -X GET 'https://payments.clocknext.com/api/v1/plans?active=true'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Request processed successfully."  },  "result": {    "plans": [      {        "id": "cmvgvg2dn000n08l23x83smgo",        "name": "Free",        "description": "Try the assistant — 50 chat messages a month",        "billingCycle": "FREE",        "cost": 0,        "priceAdjustment": 0,        "currencyCode": "USD",        "isActive": true,        "createdAt": "2026-10-20T16:02:19.019Z",        "updatedAt": "2026-10-20T16:02:19.019Z",        "useWalletForArrear": false,        "entitlements": [          {            "id": "cmvgvg2eg000p08l2owyc53u7",            "type": "CREDIT",            "billingMode": "ADVANCE",            "creditId": "cmvgvfd63000508l2oexbgpzs",            "outcomeId": null,            "unitId": null,            "targetName": "Chat Message",            "quantity": 50,            "amount": null,            "rollover": false,            "compositeId": null          },          {            "id": "cmvgvg2eg000q08l2msmc65bu",            "type": "UNIT",            "billingMode": "ADVANCE",            "creditId": null,            "outcomeId": null,            "unitId": "cmvgv92mk000n08l5jjjxnnul",            "targetName": "PDF Export",            "quantity": 5,            "amount": null,            "rollover": false,            "compositeId": null          },          {            "id": "cmvgvg2eg000r08l2g4cv12h6",            "type": "WALLET",            "billingMode": "ADVANCE",            "creditId": null,            "outcomeId": null,            "unitId": null,            "targetName": null,            "quantity": null,            "amount": 0,            "rollover": false,            "compositeId": null          }        ]      },      {        "id": "cmvgvg2yq000s08l21gkr472h",        "name": "Pro",        "description": "For growing teams that run agents every day",        "billingCycle": "MONTHLY",        "cost": 499,        "priceAdjustment": -109.95875,        "currencyCode": "USD",        "isActive": true,        "createdAt": "2026-10-20T16:02:19.778Z",        "updatedAt": "2026-10-20T16:05:14.888Z",        "useWalletForArrear": true,        "entitlements": [          {            "id": "cmvgvg2z6000w08l20sxmzifo",            "type": "CREDIT",            "billingMode": "ADVANCE",            "creditId": "cmvgvfd63000508l2oexbgpzs",            "outcomeId": null,            "unitId": null,            "targetName": "Chat Message",            "quantity": 5000,            "amount": null,            "rollover": true,            "compositeId": null          },          {            "id": "cmvgvg2z6000y08l2dymfunf0",            "type": "CREDIT",            "billingMode": "ARREAR",            "creditId": "cmvgvfdp2000708l2vd8r110d",            "outcomeId": null,            "unitId": null,            "targetName": "Code Review",            "quantity": null,            "amount": null,            "rollover": false,            "compositeId": null          },          {            "id": "cmvgvg2z6000z08l26gtlwc5t",            "type": "OUTCOME",            "billingMode": "ADVANCE",            "creditId": null,            "outcomeId": "cmvgvffng000808l237059in9",            "unitId": null,            "targetName": "Resolved Support Ticket",            "quantity": 500,            "amount": null,            "rollover": true,            "compositeId": null          },          {            "id": "cmvgvg2z6001008l2yu0jr0o9",            "type": "OUTCOME",            "billingMode": "ARREAR",            "creditId": null,            "outcomeId": "cmvgvffxr000c08l28wch48fa",            "unitId": null,            "targetName": "Contract Review",            "quantity": null,            "amount": null,            "rollover": false,            "compositeId": null          },          {            "id": "cmvgvg2z6001108l2xu4vdgij",            "type": "UNIT",            "billingMode": "ADVANCE",            "creditId": null,            "outcomeId": null,            "unitId": "cmvgv92mk000n08l5jjjxnnul",            "targetName": "PDF Export",            "quantity": 200,            "amount": null,            "rollover": false,            "compositeId": null          },          {            "id": "cmvgvg2z7001208l2nrl08e7n",            "type": "UNIT",            "billingMode": "ARREAR",            "creditId": null,            "outcomeId": null,            "unitId": "cmvgv92vf000o08l5qnqm39eo",            "targetName": "Voice Minute",            "quantity": null,            "amount": null,            "rollover": false,            "compositeId": null          },          {            "id": "cmvgvg2z7001508l2pjp8nhcw",            "type": "COMPOSITE",            "billingMode": "ADVANCE",            "creditId": null,            "outcomeId": null,            "unitId": null,            "targetName": "Voice AI Call",            "quantity": 100,            "amount": null,            "rollover": true,            "compositeId": "cmvgvfgqe000f08l219wzyt7v"          },          {            "id": "cmvgvg2z7001608l2aq4ojb42",            "type": "COMPOSITE",            "billingMode": "ARREAR",            "creditId": null,            "outcomeId": null,            "unitId": null,            "targetName": "Research Report",            "quantity": null,            "amount": null,            "rollover": false,            "compositeId": "cmvgvfh1e000i08l2oi7oozop"          },          {            "id": "cmvgvg2z7001708l2j1xe1uhy",            "type": "WALLET",            "billingMode": "ADVANCE",            "creditId": null,            "outcomeId": null,            "unitId": null,            "targetName": null,            "quantity": null,            "amount": 50,            "rollover": true,            "compositeId": null          }        ]      },      {        "id": "cmvgvg38w001808l2j7k6ykx3",        "name": "Growth (6-month)",        "description": "Updated 2026-10-20 — plan description",        "billingCycle": "SEMI_ANNUAL",        "cost": 2400,        "priceAdjustment": 936.0225,        "currencyCode": "USD",        "isActive": true,        "createdAt": "2026-10-20T16:02:20.144Z",        "updatedAt": "2026-10-20T16:05:15.814Z",        "useWalletForArrear": false,        "entitlements": [          {            "id": "cmvgvg396001b08l2lqp5tw57",            "type": "CREDIT",            "billingMode": "ADVANCE",            "creditId": "cmvgvfd63000508l2oexbgpzs",            "outcomeId": null,            "unitId": null,            "targetName": "Chat Message",            "quantity": 30000,            "amount": null,            "rollover": false,            "compositeId": null          },          {            "id": "cmvgvg396001c08l2mcrgb62f",            "type": "OUTCOME",            "billingMode": "ADVANCE",            "creditId": null,            "outcomeId": "cmvgvffng000808l237059in9",            "unitId": null,            "targetName": "Resolved Support Ticket",            "quantity": 3000,            "amount": null,            "rollover": false,            "compositeId": null          },          {            "id": "cmvgvg396001d08l20t3ypckp",            "type": "COMPOSITE",            "billingMode": "ADVANCE",            "creditId": null,            "outcomeId": null,            "unitId": null,            "targetName": "Voice AI Call",            "quantity": 600,            "amount": null,            "rollover": false,            "compositeId": "cmvgvfgqe000f08l219wzyt7v"          }        ]      },      {        "id": "cmvgvg3iy001e08l2v6t2frb0",        "name": "Scale (pay as you go)",        "description": "Everything billed in arrears, drawn from a prepaid wallet",        "billingCycle": "QUARTERLY",        "cost": 1000,        "priceAdjustment": 0,        "currencyCode": "USD",        "isActive": true,        "createdAt": "2026-10-20T16:02:20.507Z",        "updatedAt": "2026-10-20T16:02:20.507Z",        "useWalletForArrear": true,        "entitlements": [          {            "id": "cmvgvg3jl001f08l2ninx3kps",            "type": "CREDIT",            "billingMode": "ARREAR",            "creditId": "cmvgvfd63000508l2oexbgpzs",            "outcomeId": null,            "unitId": null,            "targetName": "Chat Message",            "quantity": null,            "amount": null,            "rollover": false,            "compositeId": null          },          {            "id": "cmvgvg3jl001h08l2u5gu8knk",            "type": "OUTCOME",            "billingMode": "ARREAR",            "creditId": null,            "outcomeId": "cmvgvffng000808l237059in9",            "unitId": null,            "targetName": "Resolved Support Ticket",            "quantity": null,            "amount": null,            "rollover": false,            "compositeId": null          },          {            "id": "cmvgvg3jl001i08l27g14unlu",            "type": "UNIT",            "billingMode": "ARREAR",            "creditId": null,            "outcomeId": null,            "unitId": "cmvgv9342000p08l59sk1lk51",            "targetName": "Web Scrape",            "quantity": null,            "amount": null,            "rollover": false,            "compositeId": null          },          {            "id": "cmvgvg3jl001k08l2g7t0nklp",            "type": "COMPOSITE",            "billingMode": "ARREAR",            "creditId": null,            "outcomeId": null,            "unitId": null,            "targetName": "Research Report",            "quantity": null,            "amount": null,            "rollover": false,            "compositeId": "cmvgvfh1e000i08l2oi7oozop"          },          {            "id": "cmvgvg3jl001l08l2szhtxtxy",            "type": "WALLET",            "billingMode": "ADVANCE",            "creditId": null,            "outcomeId": null,            "unitId": null,            "targetName": null,            "quantity": null,            "amount": 1000,            "rollover": true,            "compositeId": null          }        ]      },      {        "id": "cmvgvgg51001s08l2gb0zp7wp",        "name": "Enterprise",        "description": "Annual contract with committed volume",        "billingCycle": "YEARLY",        "cost": 60000,        "priceAdjustment": 25730.7875,        "currencyCode": "USD",        "isActive": true,        "createdAt": "2026-10-20T16:02:36.853Z",        "updatedAt": "2026-10-20T16:02:36.853Z",        "useWalletForArrear": false,        "entitlements": [          {            "id": "cmvgvgg59001x08l2ibm1j6dx",            "type": "FLAT",            "billingMode": "ADVANCE",            "creditId": null,            "outcomeId": null,            "unitId": null,            "targetName": null,            "quantity": null,            "amount": 24000,            "rollover": false,            "compositeId": null          },          {            "id": "cmvgvgg59001y08l2eq3r76in",            "type": "CREDIT",            "billingMode": "ADVANCE",            "creditId": "cmvgvfd63000508l2oexbgpzs",            "outcomeId": null,            "unitId": null,            "targetName": "Chat Message",            "quantity": 100000,            "amount": null,            "rollover": true,            "compositeId": null          },          {            "id": "cmvgvgg59002008l2mkkin8sy",            "type": "OUTCOME",            "billingMode": "ADVANCE",            "creditId": null,            "outcomeId": "cmvgvffng000808l237059in9",            "unitId": null,            "targetName": "Resolved Support Ticket",            "quantity": 20000,            "amount": null,            "rollover": false,            "compositeId": null          },          {            "id": "cmvgvgg5a002208l2ojdmk8aj",            "type": "UNIT",            "billingMode": "ADVANCE",            "creditId": null,            "outcomeId": null,            "unitId": "cmvgv93fx000007iiew8xnjd8",            "targetName": "Seat",            "quantity": 120,            "amount": null,            "rollover": false,            "compositeId": null          },          {            "id": "cmvgvgg5a002308l2wpkfg3aj",            "type": "COMPOSITE",            "billingMode": "ADVANCE",            "creditId": null,            "outcomeId": null,            "unitId": null,            "targetName": "Research Report",            "quantity": 50,            "amount": null,            "rollover": false,            "compositeId": "cmvgvfh1e000i08l2oi7oozop"          },          {            "id": "cmvgvgg5a002408l25kmk4s4w",            "type": "WALLET",            "billingMode": "ARREAR",            "creditId": null,            "outcomeId": null,            "unitId": null,            "targetName": null,            "quantity": null,            "amount": null,            "rollover": false,            "compositeId": null          }        ]      }    ]  }}

Create a plan

Base URL https://payments.clocknext.com/api/v1

POST
/plans

Creates a plan in your workspace's primary currency.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Request Body

application/json
  1. body
  1. body
  2. …

A new plan with at least one wallet, credit, outcome, unit or composite line. A FREE plan takes only ADVANCE lines, no FLAT line, no rollover and no cost.

name*string

The plan's name. Must be unique in the workspace, ignoring case (409 if taken).

Length1 <= length <= 120
description?|

Optional note about the plan.

Lengthlength <= 500
billingCycle*BillingCycle

How often the plan renews and bills. A FREE plan takes only ADVANCE lines.

Value in"MONTHLY""QUARTERLY""SEMI_ANNUAL""YEARLY""FREE"
useWalletForArrear?boolean

Pay ARREAR usage from the wallet.

Defaultfalse
cost?number

The total price per cycle. Leave it out to use the sum of the pay-in-advance lines.

Range0 <= value
entitlements*array<>

The plan's lines. At most one WALLET line and one FLAT line, and each item only once.

Items1 <= items

Response Body

Plan created.

application/json
  1. response
  1. response
  2. …
statusCode*integer

The HTTP status code of the response, repeated in the body.

statusDetail*

The status of the request. status is SUCCESS, and message says what happened.

result*

The new plan.

curl -X POST 'https://payments.clocknext.com/api/v1/plans' \  -H 'Content-Type: application/json' \  -d '{  "name": "Pro",  "description": "For growing teams that run agents every day",  "billingCycle": "MONTHLY",  "cost": 499,  "useWalletForArrear": true,  "entitlements": [    {      "type": "CREDIT",      "billingMode": "ADVANCE",      "creditId": "cmvgvfd63000508l2oexbgpzs",      "quantity": 5000,      "rollover": true    },    {      "type": "CREDIT",      "billingMode": "ADVANCE",      "creditId": "cmvgvfdfz000608l2wsff83hq",      "quantity": 200    },    {      "type": "CREDIT",      "billingMode": "ARREAR",      "creditId": "cmvgvfdp2000708l2vd8r110d"    },    {      "type": "OUTCOME",      "billingMode": "ADVANCE",      "outcomeId": "cmvgvffng000808l237059in9",      "quantity": 500,      "rollover": true    },    {      "type": "OUTCOME",      "billingMode": "ARREAR",      "outcomeId": "cmvgvffxr000c08l28wch48fa"    },    {      "type": "UNIT",      "billingMode": "ADVANCE",      "unitId": "cmvgv92mk000n08l5jjjxnnul",      "quantity": 200    },    {      "type": "UNIT",      "billingMode": "ARREAR",      "unitId": "cmvgv92vf000o08l5qnqm39eo"    },    {      "type": "UNIT",      "billingMode": "ARREAR",      "unitId": "cmvgv9342000p08l59sk1lk51"    },    {      "type": "UNIT",      "billingMode": "ADVANCE",      "unitId": "cmvgv93fx000007iiew8xnjd8",      "quantity": 10    },    {      "type": "COMPOSITE",      "billingMode": "ADVANCE",      "compositeId": "cmvgvfgqe000f08l219wzyt7v",      "quantity": 100,      "rollover": true    },    {      "type": "COMPOSITE",      "billingMode": "ARREAR",      "compositeId": "cmvgvfh1e000i08l2oi7oozop"    },    {      "type": "WALLET",      "billingMode": "ADVANCE",      "amount": 50,      "rollover": true    }  ]}'
Example Response
{  "statusCode": 201,  "statusDetail": {    "status": "SUCCESS",    "message": "Plan created."  },  "result": {    "created": true,    "plan": {      "id": "cmvgvg2yq000s08l21gkr472h",      "name": "Pro",      "description": "For growing teams that run agents every day",      "billingCycle": "MONTHLY",      "cost": 499,      "priceAdjustment": -109.95875,      "currencyCode": "USD",      "isActive": true,      "createdAt": "2026-10-20T16:02:19.778Z",      "updatedAt": "2026-10-20T16:02:19.778Z",      "useWalletForArrear": true,      "entitlements": [        {          "id": "cmvgvg2z6001108l2xu4vdgij",          "type": "UNIT",          "billingMode": "ADVANCE",          "creditId": null,          "outcomeId": null,          "unitId": "cmvgv92mk000n08l5jjjxnnul",          "targetName": "PDF Export",          "quantity": 200,          "amount": null,          "rollover": false,          "compositeId": null        },        {          "id": "cmvgvg2z7001208l2nrl08e7n",          "type": "UNIT",          "billingMode": "ARREAR",          "creditId": null,          "outcomeId": null,          "unitId": "cmvgv92vf000o08l5qnqm39eo",          "targetName": "Voice Minute",          "quantity": null,          "amount": null,          "rollover": false,          "compositeId": null        },        {          "id": "cmvgvg2z6000w08l20sxmzifo",          "type": "CREDIT",          "billingMode": "ADVANCE",          "creditId": "cmvgvfd63000508l2oexbgpzs",          "outcomeId": null,          "unitId": null,          "targetName": "Chat Message",          "quantity": 5000,          "amount": null,          "rollover": true,          "compositeId": null        },        {          "id": "cmvgvg2z6000y08l2dymfunf0",          "type": "CREDIT",          "billingMode": "ARREAR",          "creditId": "cmvgvfdp2000708l2vd8r110d",          "outcomeId": null,          "unitId": null,          "targetName": "Code Review",          "quantity": null,          "amount": null,          "rollover": false,          "compositeId": null        },        {          "id": "cmvgvg2z6000z08l26gtlwc5t",          "type": "OUTCOME",          "billingMode": "ADVANCE",          "creditId": null,          "outcomeId": "cmvgvffng000808l237059in9",          "unitId": null,          "targetName": "Resolved Support Ticket",          "quantity": 500,          "amount": null,          "rollover": true,          "compositeId": null        },        {          "id": "cmvgvg2z6001008l2yu0jr0o9",          "type": "OUTCOME",          "billingMode": "ARREAR",          "creditId": null,          "outcomeId": "cmvgvffxr000c08l28wch48fa",          "unitId": null,          "targetName": "Contract Review",          "quantity": null,          "amount": null,          "rollover": false,          "compositeId": null        },        {          "id": "cmvgvg2z7001508l2pjp8nhcw",          "type": "COMPOSITE",          "billingMode": "ADVANCE",          "creditId": null,          "outcomeId": null,          "unitId": null,          "targetName": "Voice AI Call",          "quantity": 100,          "amount": null,          "rollover": true,          "compositeId": "cmvgvfgqe000f08l219wzyt7v"        },        {          "id": "cmvgvg2z7001608l2aq4ojb42",          "type": "COMPOSITE",          "billingMode": "ARREAR",          "creditId": null,          "outcomeId": null,          "unitId": null,          "targetName": "Research Report",          "quantity": null,          "amount": null,          "rollover": false,          "compositeId": "cmvgvfh1e000i08l2oi7oozop"        },        {          "id": "cmvgvg2z7001708l2j1xe1uhy",          "type": "WALLET",          "billingMode": "ADVANCE",          "creditId": null,          "outcomeId": null,          "unitId": null,          "targetName": null,          "quantity": null,          "amount": 50,          "rollover": true,          "compositeId": null        }      ]    }  }}

Update a plan

Base URL https://payments.clocknext.com/api/v1

PATCH
/plans/{id}

Updates only the fields you send, for new purchases. entitlements, when sent, is the complete new list. A line keeps its id, matched by id, else by type and item. A new line gets a new id; a line left out is removed. A wrong id is a 400.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

id*string

Plan id.

Request Body

application/json
  1. body
  1. body
  2. …

Only sent fields change, for new purchases. A line keeps its id (by id, else type and item). The price stays unless you send cost or really change the lines. useWalletForArrear needs an ADVANCE WALLET line and an ARREAR line.

name?string

A new name. Must be unique in the workspace, ignoring case (409 if taken).

Length1 <= length <= 120
description?|

A new note. Send null to clear it.

Lengthlength <= 500
billingCycle?BillingCycle

A new billing cycle. A FREE plan takes only ADVANCE lines, no FLAT line and no rollover.

Value in"MONTHLY""QUARTERLY""SEMI_ANNUAL""YEARLY""FREE"
useWalletForArrear?boolean

When true, ARREAR usage is paid from the wallet as it happens.

cost?number

The total price per cycle. Leave it out to keep the saved price (see UpdatePlanInput under Types).

Range0 <= value
entitlements?array<>

The complete new list of lines. Saved lines that you leave out are removed.

Items1 <= items

Response Body

Plan updated.

application/json
  1. response
  1. response
  2. …
statusCode*integer

The HTTP status code of the response, repeated in the body.

statusDetail*

The status of the request. status is SUCCESS, and message says what happened.

result*

The updated plan.

curl -X PATCH 'https://payments.clocknext.com/api/v1/plans/pl_2h6m3' \  -H 'Content-Type: application/json' \  -d '{  "entitlements": [    {      "id": "cmvgvg2z6000w08l20sxmzifo",      "type": "CREDIT",      "billingMode": "ADVANCE",      "creditId": "cmvgvfd63000508l2oexbgpzs",      "outcomeId": null,      "unitId": null,      "targetName": "Chat Message",      "quantity": 5000,      "amount": null,      "rollover": true,      "compositeId": null    },    {      "id": "cmvgvg2z6000x08l2v4thlkto",      "type": "CREDIT",      "billingMode": "ADVANCE",      "creditId": "cmvgvfdfz000608l2wsff83hq",      "outcomeId": null,      "unitId": null,      "targetName": "Deep Research",      "quantity": 200,      "amount": null,      "rollover": false,      "compositeId": null    },    {      "id": "cmvgvg2z6000y08l2dymfunf0",      "type": "CREDIT",      "billingMode": "ARREAR",      "creditId": "cmvgvfdp2000708l2vd8r110d",      "outcomeId": null,      "unitId": null,      "targetName": "Code Review",      "quantity": null,      "amount": null,      "rollover": false,      "compositeId": null    },    {      "id": "cmvgvg2z6000z08l26gtlwc5t",      "type": "OUTCOME",      "billingMode": "ADVANCE",      "creditId": null,      "outcomeId": "cmvgvffng000808l237059in9",      "unitId": null,      "targetName": "Resolved Support Ticket",      "quantity": 500,      "amount": null,      "rollover": true,      "compositeId": null    },    {      "id": "cmvgvg2z6001008l2yu0jr0o9",      "type": "OUTCOME",      "billingMode": "ARREAR",      "creditId": null,      "outcomeId": "cmvgvffxr000c08l28wch48fa",      "unitId": null,      "targetName": "Contract Review",      "quantity": null,      "amount": null,      "rollover": false,      "compositeId": null    },    {      "id": "cmvgvg2z6001108l2xu4vdgij",      "type": "UNIT",      "billingMode": "ADVANCE",      "creditId": null,      "outcomeId": null,      "unitId": "cmvgv92mk000n08l5jjjxnnul",      "targetName": "PDF Export",      "quantity": 200,      "amount": null,      "rollover": false,      "compositeId": null    },    {      "id": "cmvgvg2z7001208l2nrl08e7n",      "type": "UNIT",      "billingMode": "ARREAR",      "creditId": null,      "outcomeId": null,      "unitId": "cmvgv92vf000o08l5qnqm39eo",      "targetName": "Voice Minute",      "quantity": null,      "amount": null,      "rollover": false,      "compositeId": null    },    {      "id": "cmvgvg2z7001308l2zynl84nc",      "type": "UNIT",      "billingMode": "ARREAR",      "creditId": null,      "outcomeId": null,      "unitId": "cmvgv9342000p08l59sk1lk51",      "targetName": "Web Scrape",      "quantity": null,      "amount": null,      "rollover": false,      "compositeId": null    },    {      "id": "cmvgvg2z7001408l2b5q1tgzs",      "type": "UNIT",      "billingMode": "ADVANCE",      "creditId": null,      "outcomeId": null,      "unitId": "cmvgv93fx000007iiew8xnjd8",      "targetName": "Seat",      "quantity": 10,      "amount": null,      "rollover": false,      "compositeId": null    },    {      "id": "cmvgvg2z7001508l2pjp8nhcw",      "type": "COMPOSITE",      "billingMode": "ADVANCE",      "creditId": null,      "outcomeId": null,      "unitId": null,      "targetName": "Voice AI Call",      "quantity": 100,      "amount": null,      "rollover": true,      "compositeId": "cmvgvfgqe000f08l219wzyt7v"    },    {      "id": "cmvgvg2z7001608l2aq4ojb42",      "type": "COMPOSITE",      "billingMode": "ARREAR",      "creditId": null,      "outcomeId": null,      "unitId": null,      "targetName": "Research Report",      "quantity": null,      "amount": null,      "rollover": false,      "compositeId": "cmvgvfh1e000i08l2oi7oozop"    },    {      "id": "cmvgvg2z7001708l2j1xe1uhy",      "type": "WALLET",      "billingMode": "ADVANCE",      "creditId": null,      "outcomeId": null,      "unitId": null,      "targetName": null,      "quantity": null,      "amount": 50,      "rollover": true,      "compositeId": null    }  ]}'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Plan updated."  },  "result": {    "updated": true,    "plan": {      "id": "cmvgvg2yq000s08l21gkr472h",      "name": "Pro",      "description": "For growing teams that run agents every day",      "billingCycle": "MONTHLY",      "cost": 499,      "priceAdjustment": -109.95875,      "currencyCode": "USD",      "isActive": true,      "createdAt": "2026-10-20T16:02:19.778Z",      "updatedAt": "2026-10-20T16:05:14.888Z",      "useWalletForArrear": true,      "entitlements": [        {          "id": "cmvgvg2z6000w08l20sxmzifo",          "type": "CREDIT",          "billingMode": "ADVANCE",          "creditId": "cmvgvfd63000508l2oexbgpzs",          "outcomeId": null,          "unitId": null,          "targetName": "Chat Message",          "quantity": 5000,          "amount": null,          "rollover": true,          "compositeId": null        },        {          "id": "cmvgvg2z6000y08l2dymfunf0",          "type": "CREDIT",          "billingMode": "ARREAR",          "creditId": "cmvgvfdp2000708l2vd8r110d",          "outcomeId": null,          "unitId": null,          "targetName": "Code Review",          "quantity": null,          "amount": null,          "rollover": false,          "compositeId": null        },        {          "id": "cmvgvg2z6000z08l26gtlwc5t",          "type": "OUTCOME",          "billingMode": "ADVANCE",          "creditId": null,          "outcomeId": "cmvgvffng000808l237059in9",          "unitId": null,          "targetName": "Resolved Support Ticket",          "quantity": 500,          "amount": null,          "rollover": true,          "compositeId": null        },        {          "id": "cmvgvg2z6001008l2yu0jr0o9",          "type": "OUTCOME",          "billingMode": "ARREAR",          "creditId": null,          "outcomeId": "cmvgvffxr000c08l28wch48fa",          "unitId": null,          "targetName": "Contract Review",          "quantity": null,          "amount": null,          "rollover": false,          "compositeId": null        },        {          "id": "cmvgvg2z6001108l2xu4vdgij",          "type": "UNIT",          "billingMode": "ADVANCE",          "creditId": null,          "outcomeId": null,          "unitId": "cmvgv92mk000n08l5jjjxnnul",          "targetName": "PDF Export",          "quantity": 200,          "amount": null,          "rollover": false,          "compositeId": null        },        {          "id": "cmvgvg2z7001208l2nrl08e7n",          "type": "UNIT",          "billingMode": "ARREAR",          "creditId": null,          "outcomeId": null,          "unitId": "cmvgv92vf000o08l5qnqm39eo",          "targetName": "Voice Minute",          "quantity": null,          "amount": null,          "rollover": false,          "compositeId": null        },        {          "id": "cmvgvg2z7001508l2pjp8nhcw",          "type": "COMPOSITE",          "billingMode": "ADVANCE",          "creditId": null,          "outcomeId": null,          "unitId": null,          "targetName": "Voice AI Call",          "quantity": 100,          "amount": null,          "rollover": true,          "compositeId": "cmvgvfgqe000f08l219wzyt7v"        },        {          "id": "cmvgvg2z7001608l2aq4ojb42",          "type": "COMPOSITE",          "billingMode": "ARREAR",          "creditId": null,          "outcomeId": null,          "unitId": null,          "targetName": "Research Report",          "quantity": null,          "amount": null,          "rollover": false,          "compositeId": "cmvgvfh1e000i08l2oi7oozop"        },        {          "id": "cmvgvg2z7001708l2j1xe1uhy",          "type": "WALLET",          "billingMode": "ADVANCE",          "creditId": null,          "outcomeId": null,          "unitId": null,          "targetName": null,          "quantity": null,          "amount": 50,          "rollover": true,          "compositeId": null        }      ]    }  }}

Get a plan

Base URL https://payments.clocknext.com/api/v1

GET
/plans/{id}

Gets one plan.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

id*string

Plan id.

Response Body

The plan.

application/json
  1. response
  1. response
  2. …
statusCode*integer

The HTTP status code of the response, repeated in the body.

statusDetail*

The status of the request. status is SUCCESS, and message says what happened.

result*

The plan with this id, in plan.

Example Request
curl -X GET 'https://payments.clocknext.com/api/v1/plans/pl_2h6m3'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Request processed successfully."  },  "result": {    "plan": {      "id": "cmvgvg2yq000s08l21gkr472h",      "name": "Pro",      "description": "For growing teams that run agents every day",      "billingCycle": "MONTHLY",      "cost": 499,      "priceAdjustment": -109.95875,      "currencyCode": "USD",      "isActive": true,      "createdAt": "2026-10-20T16:02:19.778Z",      "updatedAt": "2026-10-20T16:02:19.778Z",      "useWalletForArrear": true,      "entitlements": [        {          "id": "cmvgvg2z6000w08l20sxmzifo",          "type": "CREDIT",          "billingMode": "ADVANCE",          "creditId": "cmvgvfd63000508l2oexbgpzs",          "outcomeId": null,          "unitId": null,          "targetName": "Chat Message",          "quantity": 5000,          "amount": null,          "rollover": true,          "compositeId": null        },        {          "id": "cmvgvg2z6000y08l2dymfunf0",          "type": "CREDIT",          "billingMode": "ARREAR",          "creditId": "cmvgvfdp2000708l2vd8r110d",          "outcomeId": null,          "unitId": null,          "targetName": "Code Review",          "quantity": null,          "amount": null,          "rollover": false,          "compositeId": null        },        {          "id": "cmvgvg2z6000z08l26gtlwc5t",          "type": "OUTCOME",          "billingMode": "ADVANCE",          "creditId": null,          "outcomeId": "cmvgvffng000808l237059in9",          "unitId": null,          "targetName": "Resolved Support Ticket",          "quantity": 500,          "amount": null,          "rollover": true,          "compositeId": null        },        {          "id": "cmvgvg2z6001008l2yu0jr0o9",          "type": "OUTCOME",          "billingMode": "ARREAR",          "creditId": null,          "outcomeId": "cmvgvffxr000c08l28wch48fa",          "unitId": null,          "targetName": "Contract Review",          "quantity": null,          "amount": null,          "rollover": false,          "compositeId": null        },        {          "id": "cmvgvg2z6001108l2xu4vdgij",          "type": "UNIT",          "billingMode": "ADVANCE",          "creditId": null,          "outcomeId": null,          "unitId": "cmvgv92mk000n08l5jjjxnnul",          "targetName": "PDF Export",          "quantity": 200,          "amount": null,          "rollover": false,          "compositeId": null        },        {          "id": "cmvgvg2z7001208l2nrl08e7n",          "type": "UNIT",          "billingMode": "ARREAR",          "creditId": null,          "outcomeId": null,          "unitId": "cmvgv92vf000o08l5qnqm39eo",          "targetName": "Voice Minute",          "quantity": null,          "amount": null,          "rollover": false,          "compositeId": null        },        {          "id": "cmvgvg2z7001508l2pjp8nhcw",          "type": "COMPOSITE",          "billingMode": "ADVANCE",          "creditId": null,          "outcomeId": null,          "unitId": null,          "targetName": "Voice AI Call",          "quantity": 100,          "amount": null,          "rollover": true,          "compositeId": "cmvgvfgqe000f08l219wzyt7v"        },        {          "id": "cmvgvg2z7001608l2aq4ojb42",          "type": "COMPOSITE",          "billingMode": "ARREAR",          "creditId": null,          "outcomeId": null,          "unitId": null,          "targetName": "Research Report",          "quantity": null,          "amount": null,          "rollover": false,          "compositeId": "cmvgvfh1e000i08l2oi7oozop"        },        {          "id": "cmvgvg2z7001708l2j1xe1uhy",          "type": "WALLET",          "billingMode": "ADVANCE",          "creditId": null,          "outcomeId": null,          "unitId": null,          "targetName": null,          "quantity": null,          "amount": 50,          "rollover": true,          "compositeId": null        }      ]    }  }}

Archive a plan

Base URL https://payments.clocknext.com/api/v1

POST
/plans/{id}/archive

Archives a plan. Nothing is deleted.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

id*string

Plan id.

Response Body

Plan archived.

application/json
  1. response
  1. response
  2. …
statusCode*integer

The HTTP status code of the response, repeated in the body.

statusDetail*

The status of the request. status is SUCCESS, and message says what happened.

result*

The archived plan.

Example Request
curl -X POST 'https://payments.clocknext.com/api/v1/plans/pl_2h6m3/archive'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Plan archived."  },  "result": {    "archived": true,    "plan": {      "id": "cmvgvg38w001808l2j7k6ykx3",      "name": "Growth (6-month)",      "description": "Updated 2026-10-20 — plan description",      "billingCycle": "SEMI_ANNUAL",      "cost": 1313.9775,      "priceAdjustment": 0,      "currencyCode": "USD",      "isActive": false,      "createdAt": "2026-10-20T16:02:20.144Z",      "updatedAt": "2026-10-20T16:05:06.272Z",      "useWalletForArrear": false,      "entitlements": [        {          "id": "cmvgvg396001b08l2lqp5tw57",          "type": "CREDIT",          "billingMode": "ADVANCE",          "creditId": "cmvgvfd63000508l2oexbgpzs",          "outcomeId": null,          "unitId": null,          "targetName": "Chat Message",          "quantity": 30000,          "amount": null,          "rollover": false,          "compositeId": null        },        {          "id": "cmvgvg396001c08l2mcrgb62f",          "type": "OUTCOME",          "billingMode": "ADVANCE",          "creditId": null,          "outcomeId": "cmvgvffng000808l237059in9",          "unitId": null,          "targetName": "Resolved Support Ticket",          "quantity": 3000,          "amount": null,          "rollover": false,          "compositeId": null        },        {          "id": "cmvgvg396001d08l20t3ypckp",          "type": "COMPOSITE",          "billingMode": "ADVANCE",          "creditId": null,          "outcomeId": null,          "unitId": null,          "targetName": "Voice AI Call",          "quantity": 600,          "amount": null,          "rollover": false,          "compositeId": "cmvgvfgqe000f08l219wzyt7v"        }      ]    }  }}

Unarchive a plan

Base URL https://payments.clocknext.com/api/v1

POST
/plans/{id}/unarchive

Restores an archived plan.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

id*string

Plan id.

Response Body

Plan unarchived.

application/json
  1. response
  1. response
  2. …
statusCode*integer

The HTTP status code of the response, repeated in the body.

statusDetail*

The status of the request. status is SUCCESS, and message says what happened.

result*

The restored plan.

Example Request
curl -X POST 'https://payments.clocknext.com/api/v1/plans/pl_2h6m3/unarchive'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Plan restored."  },  "result": {    "unarchived": true,    "plan": {      "id": "cmvgvg38w001808l2j7k6ykx3",      "name": "Growth (6-month)",      "description": "Updated 2026-10-20 — plan description",      "billingCycle": "SEMI_ANNUAL",      "cost": 1313.9775,      "priceAdjustment": 0,      "currencyCode": "USD",      "isActive": true,      "createdAt": "2026-10-20T16:02:20.144Z",      "updatedAt": "2026-10-20T16:05:06.945Z",      "useWalletForArrear": false,      "entitlements": [        {          "id": "cmvgvg396001b08l2lqp5tw57",          "type": "CREDIT",          "billingMode": "ADVANCE",          "creditId": "cmvgvfd63000508l2oexbgpzs",          "outcomeId": null,          "unitId": null,          "targetName": "Chat Message",          "quantity": 30000,          "amount": null,          "rollover": false,          "compositeId": null        },        {          "id": "cmvgvg396001c08l2mcrgb62f",          "type": "OUTCOME",          "billingMode": "ADVANCE",          "creditId": null,          "outcomeId": "cmvgvffng000808l237059in9",          "unitId": null,          "targetName": "Resolved Support Ticket",          "quantity": 3000,          "amount": null,          "rollover": false,          "compositeId": null        },        {          "id": "cmvgvg396001d08l20t3ypckp",          "type": "COMPOSITE",          "billingMode": "ADVANCE",          "creditId": null,          "outcomeId": null,          "unitId": null,          "targetName": "Voice AI Call",          "quantity": 600,          "amount": null,          "rollover": false,          "compositeId": "cmvgvfgqe000f08l219wzyt7v"        }      ]    }  }}

Types

Every object type on this page, with its fields.

Plan

FieldTypeRequiredDescription
idstringyesThe plan's id.
namestringyesThe plan's name. Unique in the workspace, ignoring case.
descriptionstring | nullnoOptional note about the plan. null when not set.
billingCycle"MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "YEARLY" | "FREE"yesHow often the plan renews and bills. A FREE plan has no price and grants only ADVANCE lines.
costnumberyesThe price per cycle: the pay-in-advance lines plus priceAdjustment. 0 on a FREE plan.
priceAdjustmentnumbernocost minus the sum of the pay-in-advance lines; negative is a discount. Read-only: send cost.
useWalletForArrearbooleannoWhen true, pay-as-you-go usage is paid from the wallet as it happens, not invoiced at cycle end.
currencyCodestringyesThe workspace's primary currency when the plan was created.
isActivebooleanyesArchived plans are false and can't be purchased.
createdAtstringyesWhen the plan was created.
updatedAtstringyesWhen the plan was last changed.
entitlementsPlanEntitlement[]yesThe plan's lines — what a customer on it is granted or metered for.

PlanEntitlement

One line of a plan: what a customer on the plan is granted (ADVANCE) or metered for (ARREAR).

FieldTypeRequiredDescription
idstringyesStays the same when the plan is updated, until this line is removed.
type"WALLET" | "CREDIT" | "OUTCOME" | "UNIT" | "FLAT" | "COMPOSITE"yesThe component's kind. COMPOSITE sells a composite: set compositeId.
billingMode"ADVANCE" | "ARREAR"yesADVANCE: paid at each cycle start; grants quantity or amount. ARREAR: use is billed at cycle end.
creditIdstring | nullnoThe id of the credit this line sells, on a CREDIT line. null on every other line.
outcomeIdstring | nullnoThe id of the outcome this line sells, on an OUTCOME line. null on every other line.
unitIdstring | nullnoThe id of the unit this line sells, on a UNIT line. null on every other line.
compositeIdstring | nullnoThe id of the composite this component sells, on a composite component.
targetNamestring | nullnoName of the credit, outcome, unit or composite this component sells.
quantitynumber | nullnoWhat an ADVANCE credit, outcome, unit or composite line grants each cycle. null on other lines.
amountnumber | nullnoUSD: the top-up per cycle on an ADVANCE WALLET line, or the fee on a FLAT line. null on others.
rolloverbooleanyesWhat is left carries into the next cycle. Only on ADVANCE credit, outcome, composite and wallet lines.

CreatePlanInput

A new plan with at least one wallet, credit, outcome, unit or composite line. A FREE plan takes only ADVANCE lines, no FLAT line, no rollover and no cost.

FieldTypeRequiredDescription
namestringyesThe plan's name. Must be unique in the workspace, ignoring case (409 if taken).
descriptionstring | nullnoOptional note about the plan.
billingCycle"MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "YEARLY" | "FREE"yesHow often the plan renews and bills. A FREE plan takes only ADVANCE lines.
useWalletForArrearbooleannoPay ARREAR usage from the wallet.
costnumbernoThe total price per cycle. Leave it out to use the sum of the pay-in-advance lines.
entitlementsPlanEntitlementInput[]yesThe plan's lines. At most one WALLET line and one FLAT line, and each item only once.

PlanEntitlementInput

One plan line; set the item id for its type. A value that doesn't fit its type and billingMode is a 400, never dropped. ADVANCE credit, outcome, unit and composite lines need quantity; ADVANCE WALLET and FLAT lines need amount.

FieldTypeRequiredDescription
idstringnoUpdate only. The id of a saved line on this plan, to update that line. Ignored on create.
type"WALLET" | "CREDIT" | "OUTCOME" | "UNIT" | "FLAT" | "COMPOSITE"yesThe component's kind. COMPOSITE sells a composite: set compositeId.
billingMode"ADVANCE" | "ARREAR"yesADVANCE: paid at the start of each cycle. ARREAR: use is billed at the end of the cycle.
creditIdstring | nullnoThe id of the credit this line sells. Required on a CREDIT line only.
outcomeIdstring | nullnoThe id of the outcome this line sells. Required on an OUTCOME line only.
unitIdstring | nullnoThe id of the unit this line sells. Required on a UNIT line only.
compositeIdstring | nullnoThe id of the composite this line sells. Required on a composite line only.
quantityinteger | nullnoGranted each cycle. Required on an ADVANCE credit, outcome, unit or composite line (0 is allowed).
amountnumber | nullnoUSD amount. Required on an ADVANCE WALLET line (0 is allowed) and on a FLAT line (above 0).
rolloverbooleannoCarry leftovers into the next cycle. Only on an ADVANCE credit, outcome, composite or wallet line.

UpdatePlanInput

Only sent fields change, for new purchases. A line keeps its id (by id, else type and item). The price stays unless you send cost or really change the lines. useWalletForArrear needs an ADVANCE WALLET line and an ARREAR line.

FieldTypeRequiredDescription
namestringnoA new name. Must be unique in the workspace, ignoring case (409 if taken).
descriptionstring | nullnoA new note. Send null to clear it.
billingCycle"MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "YEARLY" | "FREE"noA new billing cycle. A FREE plan takes only ADVANCE lines, no FLAT line and no rollover.
useWalletForArrearbooleannoWhen true, ARREAR usage is paid from the wallet as it happens.
costnumbernoThe total price per cycle. Leave it out to keep the saved price (see UpdatePlanInput under Types).
entitlementsPlanEntitlementInput[]noThe complete new list of lines. Saved lines that you leave out are removed.

Remove a member DELETE

Removes a member from the customer. A member already removed answers `200` "Member removed." again and nothing changes. A member id that never existed is a `404` "Member not found."

Packages

Extra entitlements for one price, added to a customer's subscription. A package is always paid in advance. Added as `RECURRING` (the default), it renews with the subscription on its plan's billing cycle until it is removed; added as `ONE_TIME`, it is billed and granted once. It has no billing cycle, billing mode or rollover of its own. It holds credits, outcomes, units, composites and, once at most, wallet money for the customer's Main wallet. Each entitlement must be on the customer's plan as advance (wallet money: an advance wallet). `flatFee` is deprecated: put the fee in the package price. Nothing is deleted — archive instead. Add and remove packages with the [Subscriptions](/docs/api-reference/subscriptions/addSubscriptionPackages) routes. See [Packages](/docs/documentation/packages).