Base URL https://payments.clocknext.com/api/v1
The customer's plan as its purchase froze it: the terms, the cycle billed now, and each entitlement with its grant per cycle and price. Usage is in Get a customer's balances. plan is null when the customer has no purchase.
apiKeyAuthorizationBearer <cnk_…>Organisation-scoped key from Settings → API Keys.
id*stringCustomer id.
The customer's current plan.
application/json- response
statusCode*integerThe 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 customer's currency and current plan. plan is null when the customer has no plan.
curl -X GET 'https://payments.clocknext.com/api/v1/customers/cus_abc123/plan'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Request processed successfully." }, "result": { "customerId": "cmvgva5po000c07iir1vtn8vl", "currency": { "code": "USD", "rateUsd": 1 }, "plan": { "purchaseId": "cmvgvkmxz002h08l2h2i1dnsr", "reference": "SUB-001", "planId": "cmvgvg2yq000s08l21gkr472h", "planName": "Pro", "status": "COMPLETED", "active": true, "billingCycle": "MONTHLY", "currencyCode": "USD", "cost": 499, "useWalletForArrear": true, "autoPayment": false, "startsAt": "2026-10-20T00:00:00.000Z", "cancelRequestedAt": null, "endsAt": null, "cycle": { "index": 0, "start": "2026-10-20T00:00:00.000Z", "end": "2026-11-20T00:00:00.000Z" }, "entitlements": { "credit": [ { "id": "cmvgvfd63000508l2oexbgpzs", "name": "Chat Message", "agentKey": "chat_message", "billingMode": "ADVANCE", "recurringQuantity": 6000, "allocatedQuantity": 5000, "rollover": true, "pricePerCredit": 0.001197 }, { "id": "cmvgvfdfz000608l2wsff83hq", "name": "Deep Research", "agentKey": "deep_research", "billingMode": "ADVANCE", "recurringQuantity": 200, "allocatedQuantity": 200, "rollover": false, "pricePerCredit": 0.8498125 }, { "id": "cmvgvfdp2000708l2vd8r110d", "name": "Code Review", "agentKey": "code_review", "billingMode": "ARREAR", "recurringQuantity": null, "allocatedQuantity": null, "rollover": false, "pricePerCredit": 0.145546875 } ], "outcome": [ { "id": "cmvgvffng000808l237059in9", "name": "Resolved Support Ticket", "agentKey": "support_ticket", "billingMode": "ADVANCE", "recurringQuantity": 600, "allocatedQuantity": 500, "rollover": true, "pricePerOutcome": 0.1260225 }, { "id": "cmvgvffxr000c08l28wch48fa", "name": "Contract Review", "agentKey": "contract_review", "billingMode": "ARREAR", "recurringQuantity": null, "allocatedQuantity": null, "rollover": false, "pricePerOutcome": 0.9316 } ], "unit": [ { "id": "cmvgv92mk000n08l5jjjxnnul", "name": "PDF Export", "agentKey": "pdf_export", "billingMode": "ADVANCE", "recurringQuantity": 250, "allocatedQuantity": 200, "pricingType": "FLAT", "flatPrice": 0.25, "tiers": [] }, { "id": "cmvgv92vf000o08l5qnqm39eo", "name": "Voice Minute", "agentKey": "voice_minute", "billingMode": "ARREAR", "recurringQuantity": null, "allocatedQuantity": null, "pricingType": "FLAT", "flatPrice": 0.06, "tiers": [] }, { "id": "cmvgv9342000p08l59sk1lk51", "name": "Web Scrape", "agentKey": "web_scrape", "billingMode": "ARREAR", "recurringQuantity": null, "allocatedQuantity": null, "pricingType": "SLAB", "flatPrice": 0, "tiers": [ { "upTo": 1000, "price": 0.012 }, { "upTo": 5000, "price": 0.009 }, { "upTo": null, "price": 0.006 } ] }, { "id": "cmvgv93fx000007iiew8xnjd8", "name": "Seat", "agentKey": "seat", "billingMode": "ADVANCE", "recurringQuantity": 10, "allocatedQuantity": 10, "pricingType": "VOLUME", "flatPrice": 0, "tiers": [ { "upTo": 10, "price": 12 }, { "upTo": 50, "price": 10 }, { "upTo": null, "price": 8 } ] } ], "composite": [ { "id": "cmvgvfgqe000f08l219wzyt7v", "name": "Voice AI Call", "refId": "voice_call", "billingMode": "ADVANCE", "recurringQuantity": 120, "allocatedQuantity": 100, "rollover": true, "pricePerComposite": 1.75 }, { "id": "cmvgvfh1e000i08l2oi7oozop", "name": "Research Report", "refId": "research_report", "billingMode": "ARREAR", "recurringQuantity": null, "allocatedQuantity": null, "rollover": false, "pricePerComposite": 12 } ], "wallet": { "billingMode": "ADVANCE", "recurringAmount": 75, "allocatedAmount": 50, "rollover": true }, "flat": null } } }}Base URL https://payments.clocknext.com/api/v1
The same call, addressed by the customer's externalId. Same response.
apiKeyAuthorizationBearer <cnk_…>Organisation-scoped key from Settings → API Keys.
externalId*stringYour own id for the customer: 1–64 letters, numbers or "-". Case-sensitive.
^[A-Za-z0-9-]{1,64}$1 <= length <= 64The customer's current plan.
application/json- response
statusCode*integerThe 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 customer's currency and current plan. plan is null when the customer has no plan.
curl -X GET 'https://payments.clocknext.com/api/v1/customers/ext/string/plan'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Request processed successfully." }, "result": { "customerId": "cmvgva5po000c07iir1vtn8vl", "currency": { "code": "USD", "rateUsd": 1 }, "plan": { "purchaseId": "cmvgvkmxz002h08l2h2i1dnsr", "reference": "SUB-001", "planId": "cmvgvg2yq000s08l21gkr472h", "planName": "Pro", "status": "COMPLETED", "active": true, "billingCycle": "MONTHLY", "currencyCode": "USD", "cost": 499, "useWalletForArrear": true, "autoPayment": false, "startsAt": "2026-10-20T00:00:00.000Z", "cancelRequestedAt": null, "endsAt": null, "cycle": { "index": 0, "start": "2026-10-20T00:00:00.000Z", "end": "2026-11-20T00:00:00.000Z" }, "entitlements": { "credit": [ { "id": "cmvgvfd63000508l2oexbgpzs", "name": "Chat Message", "agentKey": "chat_message", "billingMode": "ADVANCE", "recurringQuantity": 5000, "allocatedQuantity": 5000, "rollover": true, "pricePerCredit": 0.001197 }, { "id": "cmvgvfdfz000608l2wsff83hq", "name": "Deep Research", "agentKey": "deep_research", "billingMode": "ADVANCE", "recurringQuantity": 200, "allocatedQuantity": 200, "rollover": false, "pricePerCredit": 0.8498125 }, { "id": "cmvgvfdp2000708l2vd8r110d", "name": "Code Review", "agentKey": "code_review", "billingMode": "ARREAR", "recurringQuantity": null, "allocatedQuantity": null, "rollover": false, "pricePerCredit": 0.145546875 } ], "outcome": [ { "id": "cmvgvffng000808l237059in9", "name": "Resolved Support Ticket", "agentKey": "support_ticket", "billingMode": "ADVANCE", "recurringQuantity": 500, "allocatedQuantity": 500, "rollover": true, "pricePerOutcome": 0.1260225 }, { "id": "cmvgvffxr000c08l28wch48fa", "name": "Contract Review", "agentKey": "contract_review", "billingMode": "ARREAR", "recurringQuantity": null, "allocatedQuantity": null, "rollover": false, "pricePerOutcome": 0.9316 } ], "unit": [ { "id": "cmvgv92mk000n08l5jjjxnnul", "name": "PDF Export", "agentKey": "pdf_export", "billingMode": "ADVANCE", "recurringQuantity": 200, "allocatedQuantity": 200, "pricingType": "FLAT", "flatPrice": 0.25, "tiers": [] }, { "id": "cmvgv92vf000o08l5qnqm39eo", "name": "Voice Minute", "agentKey": "voice_minute", "billingMode": "ARREAR", "recurringQuantity": null, "allocatedQuantity": null, "pricingType": "FLAT", "flatPrice": 0.06, "tiers": [] }, { "id": "cmvgv9342000p08l59sk1lk51", "name": "Web Scrape", "agentKey": "web_scrape", "billingMode": "ARREAR", "recurringQuantity": null, "allocatedQuantity": null, "pricingType": "SLAB", "flatPrice": 0, "tiers": [ { "upTo": 1000, "price": 0.012 }, { "upTo": 5000, "price": 0.009 }, { "upTo": null, "price": 0.006 } ] }, { "id": "cmvgv93fx000007iiew8xnjd8", "name": "Seat", "agentKey": "seat", "billingMode": "ADVANCE", "recurringQuantity": 10, "allocatedQuantity": 10, "pricingType": "VOLUME", "flatPrice": 0, "tiers": [ { "upTo": 10, "price": 12 }, { "upTo": 50, "price": 10 }, { "upTo": null, "price": 8 } ] } ], "composite": [ { "id": "cmvgvfgqe000f08l219wzyt7v", "name": "Voice AI Call", "refId": "voice_call", "billingMode": "ADVANCE", "recurringQuantity": 100, "allocatedQuantity": 100, "rollover": true, "pricePerComposite": 1.75 }, { "id": "cmvgvfh1e000i08l2oi7oozop", "name": "Research Report", "refId": "research_report", "billingMode": "ARREAR", "recurringQuantity": null, "allocatedQuantity": null, "rollover": false, "pricePerComposite": 12 } ], "wallet": { "billingMode": "ADVANCE", "recurringAmount": 50, "allocatedAmount": 50, "rollover": true }, "flat": null } } }}Types
Every object type on this page, with its fields.
CustomerPlanSummary
| Field | Type | Required | Description |
|---|---|---|---|
customerId | string | yes | The customer's ClockNext id. |
currency | Currency | yes | The currency of the amounts: always USD, at a rate of 1. |
plan | CustomerPlan | null | yes | The customer's plan, a started one before one that waits to start. null when there is none. |
Currency
| Field | Type | Required | Description |
|---|---|---|---|
code | string | yes | Always USD: every amount in the response is in USD. |
rateUsd | number | yes | Always 1. |
CustomerPlan
The plan a customer is on, as its purchase froze it. No usage.
| Field | Type | Required | Description |
|---|---|---|---|
purchaseId | string | yes | The id of the purchase that put the customer on this plan. |
reference | string | null | yes | The purchase's reference: its subscription number (SUB-…), else its purchase number (PUR-…). |
planId | string | null | yes | The plan's id. null when the plan no longer exists. |
planName | string | yes | The plan's name when it was bought. |
status | "COMPLETED" | "PENDING" | yes | By payment: COMPLETED once the first invoice is paid (or none is due), else PENDING. See active. |
active | boolean | yes | true once the plan has started. false while it waits to start. |
billingCycle | "MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "YEARLY" | "FREE" | yes | How often the plan bills. FREE has no end to its cycle. |
currencyCode | string | yes | The ISO 4217 code of the purchase's currency. |
cost | number | yes | What one cycle of the plan costs, any rounding included. |
useWalletForArrear | boolean | yes | true when usage billed in arrears is paid from the wallet as it happens, instead of on an invoice. |
autoPayment | boolean | yes | true when invoices are charged to the customer's saved card. |
startsAt | string | yes | When the plan starts (or started): its subscription date when the purchase has one, else its billing date. |
cancelRequestedAt | string | null | yes | When the plan was marked for cancellation. null when it is not. |
endsAt | string | null | yes | When the plan ends: set once it is marked for cancellation or replaced by a plan change. null otherwise. |
cycle | object | yes | The billing cycle billed now. |
entitlements | CustomerPlanEntitlements | yes | Every entitlement on the plan, grouped by kind. |
CustomerPlan.cycle
The billing cycle billed now.
| Field | Type | Required | Description |
|---|---|---|---|
index | integer | yes | The cycle's number, counted from 0. |
start | string | yes | When the cycle started. |
end | string | null | yes | When the cycle ends. null on a FREE plan. |
CustomerPlanEntitlements
Every entitlement on the plan, grouped by kind. recurringQuantity is what each cycle grants now (a unit: the whole purchase); allocatedQuantity is what the purchase granted at first. Both are null on an ARREAR line.
| Field | Type | Required | Description |
|---|---|---|---|
credit | object[] | yes | The credits the plan sells. |
outcome | object[] | yes | The outcomes the plan sells. |
unit | object[] | yes | The units the plan sells. |
composite | object[] | yes | The composites the plan sells. |
wallet | object | null | yes | The wallet line. null when the plan has none. |
flat | object | null | yes | The flat fee. null when the plan has none. |
CustomerPlanEntitlements.credit
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | The credit's id. |
name | string | null | yes | The credit's name now, or the name frozen at purchase if it was removed. The same on every line. |
agentKey | string | null | yes | The key signals name it by. |
billingMode | "ADVANCE" | "ARREAR" | yes | ADVANCE grants credits up front each cycle. ARREAR bills credits after use. |
recurringQuantity | number | null | yes | The credits each cycle grants now. null on an ARREAR line. |
allocatedQuantity | number | null | yes | The credits each cycle granted at purchase, before any resize. null on an ARREAR line. |
rollover | boolean | yes | true when an unused balance carries into the next cycle. |
pricePerCredit | number | null | yes | The price per credit, frozen at purchase. |
CustomerPlanEntitlements.outcome
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | The outcome's id. |
name | string | null | yes | The outcome's name now, or the name frozen at purchase when the outcome no longer exists. |
agentKey | string | null | yes | The outcome's own key (not a step's). |
billingMode | "ADVANCE" | "ARREAR" | yes | ADVANCE grants outcomes up front each cycle. ARREAR bills outcomes after use. |
recurringQuantity | number | null | yes | The outcomes each cycle grants now. null on an ARREAR line. |
allocatedQuantity | number | null | yes | The outcomes each cycle granted at purchase, before any resize. null on an ARREAR line. |
rollover | boolean | yes | true when an unused balance carries into the next cycle. |
pricePerOutcome | number | null | yes | The price per outcome, frozen at purchase. |
CustomerPlanEntitlements.unit
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | The unit's id. |
name | string | null | yes | The unit's name now, or the name frozen at purchase when the unit no longer exists. |
agentKey | string | null | yes | The key signals name it by. |
billingMode | "ADVANCE" | "ARREAR" | yes | ADVANCE grants units up front. ARREAR bills units after use. |
recurringQuantity | number | null | yes | The units the whole purchase grants now. null on an ARREAR line. |
allocatedQuantity | number | null | yes | The units the purchase granted at the start, before any resize. null on an ARREAR line. |
pricingType | "FLAT" | "SLAB" | "VOLUME" | null | yes | How the unit is priced, frozen at purchase. FLAT uses flatPrice. SLAB and VOLUME use tiers. |
flatPrice | number | null | yes | The price per unit when pricingType is FLAT. |
tiers | object[] | yes | The tier ladder, frozen at purchase, in order. Empty when the unit has none. |
CustomerPlanEntitlements.unit.tiers
| Field | Type | Required | Description |
|---|---|---|---|
upTo | number | null | yes | The last unit of the tier. null on the last tier. |
price | number | yes | The price per unit in this tier, frozen at purchase. |
CustomerPlanEntitlements.composite
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | The composite's id. |
name | string | null | yes | The composite's name now, or the name frozen at purchase when the composite no longer exists. |
refId | string | null | yes | The tag your signals send in their composite block. |
billingMode | "ADVANCE" | "ARREAR" | yes | ADVANCE grants a pool of composites up front each cycle. ARREAR bills composites after use. |
recurringQuantity | number | null | yes | The composites each cycle grants now. null on an ARREAR line. |
allocatedQuantity | number | null | yes | The composites each cycle granted at purchase, before any resize. null on an ARREAR line. |
rollover | boolean | yes | true when an unused balance carries into the next cycle. |
pricePerComposite | number | null | yes | The price per composite, frozen at purchase. |
CustomerPlanEntitlements.wallet
| Field | Type | Required | Description |
|---|---|---|---|
billingMode | "ADVANCE" | "ARREAR" | yes | ADVANCE puts money in the wallet each cycle. ARREAR gives no money up front. |
recurringAmount | number | null | yes | USD the wallet gets every cycle now. null on an ARREAR wallet. |
allocatedAmount | number | null | yes | USD the plan gave every cycle at purchase, before any resize. null on an ARREAR wallet. |
rollover | boolean | yes | true when unused wallet money carries into the next cycle. |
CustomerPlanEntitlements.flat
| Field | Type | Required | Description |
|---|---|---|---|
amount | number | null | yes | The flat fee, frozen at purchase. |