Base URL https://payments.clocknext.com/api/v1
Wallet, credit, outcome, unit and composite balances, each split into the plan's part and its packages. wallet.reservedBalance is there only when the Reserved Wallet is on. used and remaining cover the cycle billed now (a unit: the whole purchase). With no plan, or one not started, hasPlan is false.
apiKeyAuthorizationBearer <cnk_…>Organisation-scoped key from Settings → API Keys.
id*stringCustomer id.
Balances.
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 current balances: the Wallet and each entitlement.
curl -X GET 'https://payments.clocknext.com/api/v1/customers/cus_abc123/balances'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Request processed successfully." }, "result": { "customerId": "cmvgva5po000c07iir1vtn8vl", "currency": { "code": "USD", "rateUsd": 1 }, "hasPlan": true, "wallet": { "balance": 129.381975, "reservedBalance": 60, "planGranted": 100, "planRemaining": 129.381975, "packages": [] }, "credits": [ { "creditId": "cmvgvfdfz000608l2wsff83hq", "agentKey": "deep_research", "creditName": "Deep Research", "granted": 200, "used": 0.968044, "remaining": 79.031956, "originalGranted": null, "planGranted": 200, "planRemaining": 79.031956, "packages": [] }, { "creditId": "cmvgvfd63000508l2oexbgpzs", "agentKey": "chat_message", "creditName": "Chat Message", "granted": 6000, "used": 6.291667, "remaining": 6493.708333, "originalGranted": 5000, "planGranted": 6000, "planRemaining": 6493.708333, "packages": [] } ], "outcomes": [ { "outcomeId": "cmvgvffng000808l237059in9", "outcomeName": "Resolved Support Ticket", "granted": 600, "remaining": 647, "steps": [ { "id": "cmvgvffnr000908l2m3xv3z3b", "name": "Triage", "agentKey": "support_ticket.triage" }, { "id": "cmvgvffnr000a08l26a3xw691", "name": "Draft reply", "agentKey": "support_ticket.draft" }, { "id": "cmvgvffnr000b08l2kzcwdx9f", "name": "QA check", "agentKey": "support_ticket.qa" } ], "originalGranted": 500, "planGranted": 600, "planRemaining": 647, "packages": [] } ], "units": [ { "unitId": "cmvgv92mk000n08l5jjjxnnul", "agentKey": "pdf_export", "unitName": "PDF Export", "granted": 250, "remaining": 268, "originalGranted": 200, "planGranted": 250, "planRemaining": 268, "packages": [] }, { "unitId": "cmvgv93fx000007iiew8xnjd8", "agentKey": "seat", "unitName": "Seat", "granted": 10, "remaining": 7, "originalGranted": null, "planGranted": 10, "planRemaining": 7, "packages": [] } ], "composites": [ { "compositeId": "cmvgvfgqe000f08l219wzyt7v", "refId": "voice_call", "name": "Voice AI Call", "granted": 120, "used": 1, "remaining": 129, "originalGranted": 100, "planGranted": 120, "planRemaining": 129, "packages": [] } ] }}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 <= 64Balances.
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 current balances: the Wallet and each entitlement.
curl -X GET 'https://payments.clocknext.com/api/v1/customers/ext/string/balances'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Request processed successfully." }, "result": { "customerId": "cmvgva5po000c07iir1vtn8vl", "currency": { "code": "USD", "rateUsd": 1 }, "hasPlan": true, "wallet": { "balance": 50, "planGranted": 50, "planRemaining": 50, "packages": [] }, "credits": [ { "creditId": "cmvgvfd63000508l2oexbgpzs", "agentKey": "chat_message", "creditName": "Chat Message", "granted": 5000, "used": 0, "remaining": 5000, "originalGranted": null, "planGranted": 5000, "planRemaining": 5000, "packages": [] }, { "creditId": "cmvgvfdfz000608l2wsff83hq", "agentKey": "deep_research", "creditName": "Deep Research", "granted": 200, "used": 0, "remaining": 200, "originalGranted": null, "planGranted": 200, "planRemaining": 200, "packages": [] } ], "outcomes": [ { "outcomeId": "cmvgvffng000808l237059in9", "outcomeName": "Resolved Support Ticket", "granted": 500, "remaining": 500, "steps": [ { "id": "cmvgvffnr000908l2m3xv3z3b", "name": "Triage", "agentKey": "support_ticket.triage" }, { "id": "cmvgvffnr000a08l26a3xw691", "name": "Draft reply", "agentKey": "support_ticket.draft" }, { "id": "cmvgvffnr000b08l2kzcwdx9f", "name": "QA check", "agentKey": "support_ticket.qa" } ], "originalGranted": null, "planGranted": 500, "planRemaining": 500, "packages": [] } ], "units": [ { "unitId": "cmvgv92mk000n08l5jjjxnnul", "agentKey": "pdf_export", "unitName": "PDF Export", "granted": 200, "remaining": 200, "originalGranted": null, "planGranted": 200, "planRemaining": 200, "packages": [] }, { "unitId": "cmvgv93fx000007iiew8xnjd8", "agentKey": "seat", "unitName": "Seat", "granted": 10, "remaining": 10, "originalGranted": null, "planGranted": 10, "planRemaining": 10, "packages": [] } ], "composites": [ { "compositeId": "cmvgvfgqe000f08l219wzyt7v", "refId": "voice_call", "name": "Voice AI Call", "granted": 100, "used": 0, "remaining": 100, "originalGranted": null, "planGranted": 100, "planRemaining": 100, "packages": [] } ] }}Types
Every object type on this page, with its fields.
CustomerBalances
| 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. |
hasPlan | boolean | yes | true when a plan has started or waits to start. When false, the balance lists are empty. |
wallet | object | yes | Both wallet balances, in USD. Always returned. |
credits | object[] | yes | The prepaid (ADVANCE) credits on the customer's plan. A credit billed in ARREAR is not listed. |
outcomes | object[] | yes | The prepaid (ADVANCE) outcomes on the customer's plan. An outcome billed in ARREAR is not listed. |
units | object[] | yes | The prepaid (ADVANCE) units on the customer's plan. A unit billed in ARREAR is not listed. |
composites | object[] | yes | The prepaid (ADVANCE) composite pools on the plan. An ARREAR composite has no pool. |
Currency
| Field | Type | Required | Description |
|---|---|---|---|
code | string | yes | Always USD: every amount in the response is in USD. |
rateUsd | number | yes | Always 1. |
CustomerBalances.wallet
Both wallet balances, in USD. Always returned.
| Field | Type | Required | Description |
|---|---|---|---|
balance | number | yes | The ordinary Wallet. Always present, also with no plan or no Wallet line. May be negative. |
reservedBalance | number | no | The Reserved Wallet. Left out when the workspace has it off. Never negative. |
planGranted | number | yes | The plan's wallet top-up of each cycle. 0 with no plan or no advance wallet. |
planRemaining | number | yes | The plan's part of balance, adjustments and portal top-ups included. Can be negative. |
packages | WalletPackageShare[] | yes | The running packages that hold wallet money, oldest first. [] when none. |
WalletPackageShare
The wallet money of one running package, in USD. The plan's wallet money is used first, then the packages from the oldest attach.
| Field | Type | Required | Description |
|---|---|---|---|
purchasePackageId | string | yes | The package's id on the subscription (packages[].id of the subscription). |
packageId | string | null | yes | The package in the catalog. null when it no longer exists. |
name | string | yes | The package's name. |
quantity | number | yes | The wallet money that the package grants, in USD. |
term | "RECURRING" | "ONE_TIME" | yes | RECURRING renews with the plan. ONE_TIME is granted once. |
allocated | number | yes | This cycle's wallet money of the package, in USD: the grant, plus what rolled over. |
consumed | number | yes | What was used of allocated up to now, in USD. Live. The plan is used first. |
remaining | number | yes | What is left of it now, in USD. Never negative. |
status | "ACTIVE" | "MARKED_FOR_CANCELLATION" | yes | MARKED_FOR_CANCELLATION: it ends at the end of the billing cycle. |
startedAt | string | null | yes | When its invoice was paid. |
CustomerBalances.credits
| Field | Type | Required | Description |
|---|---|---|---|
creditId | string | yes | The credit's id. |
agentKey | string | yes | The credit's agent key: the key signals and the adjust API use for it. |
creditName | string | yes | The credit's name on the plan. |
granted | number | yes | The credits granted this cycle, the plan's and each running package's. |
used | number | yes | Credits used this cycle. |
remaining | number | yes | The credits left now. Can be negative: usage past the balance is allowed. |
originalGranted | number | null | yes | What granted was before it was ever resized for this customer; null if it never was. |
planGranted | number | yes | The plan's part of granted, packages left out. |
planRemaining | number | yes | The plan's part of remaining: the plan is used first. Can be negative. |
packages | BalancePackageShare[] | yes | The running packages that add to this balance, oldest first. [] when none. |
BalancePackageShare
What one running package adds to a balance. The plan is used first, then the packages from the oldest attach.
| Field | Type | Required | Description |
|---|---|---|---|
purchasePackageId | string | yes | The package's id on the subscription (packages[].id of the subscription). |
packageId | string | null | yes | The package in the catalog. null when it no longer exists. |
name | string | yes | The package's name. |
quantity | number | yes | The package's grant each cycle. |
term | "RECURRING" | "ONE_TIME" | yes | RECURRING renews with the plan. ONE_TIME is granted once. |
allocated | number | yes | This cycle's allocation: the grant, plus what rolled over. |
consumed | number | yes | What was used of allocated up to now, the plan used first. |
remaining | number | yes | What is left of it now. Never negative. |
status | "ACTIVE" | "MARKED_FOR_CANCELLATION" | yes | MARKED_FOR_CANCELLATION: it ends at endsAt. |
startedAt | string | null | yes | When its invoice was paid. |
invoiceNumber | string | null | yes | The invoice that started it. |
endsAt | string | null | yes | When a MARKED_FOR_CANCELLATION package ends. null while ACTIVE. |
CustomerBalances.outcomes
| Field | Type | Required | Description |
|---|---|---|---|
outcomeId | string | yes | The outcome's id. |
outcomeName | string | yes | The outcome's name on the plan. |
granted | number | yes | The outcomes granted this cycle (per-member seat plan: one member's grant × members), packages included. |
remaining | number | yes | The outcomes left now. |
originalGranted | number | null | yes | What granted was before it was ever resized; null if it never was. |
planGranted | number | yes | The plan's part of granted, packages left out. |
planRemaining | number | yes | The plan's part of remaining: the plan is used first. Can be negative. |
packages | BalancePackageShare[] | yes | The running packages that add to this balance, oldest first. [] when none. |
steps | object[] | yes | The outcome's steps, in order. |
CustomerBalances.outcomes.steps
| Field | Type | Required | Description |
|---|---|---|---|
id | string | yes | The step's id. |
name | string | yes | The step's name. |
agentKey | string | yes | The step's agent key: the key signals and the adjust API use for this outcome. |
CustomerBalances.units
| Field | Type | Required | Description |
|---|---|---|---|
unitId | string | yes | The unit's id. |
agentKey | string | yes | The unit's agent key: the key signals and the adjust API use for it. |
unitName | string | yes | The unit's name on the plan. |
granted | number | yes | The units granted (the plan's and each running package's). Usage and top-ups do not change it. |
remaining | number | yes | The units left now. Can be more than granted after a top-up. |
originalGranted | number | null | yes | What granted was before it was ever resized; null if it never was. |
planGranted | number | yes | The plan's part of granted, packages left out. |
planRemaining | number | yes | The plan's part of remaining: the plan is used first. Can be negative. |
packages | BalancePackageShare[] | yes | The running packages that add to this balance, oldest first. [] when none. |
CustomerBalances.composites
| Field | Type | Required | Description |
|---|---|---|---|
compositeId | string | yes | The composite's id. |
refId | string | yes | The tag your signals send in their composite block. |
name | string | yes | The composite's name. |
granted | number | yes | The pool size this cycle, the plan's and each running package's. |
used | number | yes | Completions counted this cycle. Every completion counts one, also a repeat of the same composite value. |
remaining | number | yes | granted − used + this cycle's adjustments. May be negative; the overrun carries into the next cycle. |
originalGranted | number | null | yes | What granted was before the pool was ever resized for this customer; null if it never was. |
planGranted | number | yes | The plan's part of granted, packages left out. |
planRemaining | number | yes | The plan's part of remaining: the plan is used first. Can be negative. |
packages | BalancePackageShare[] | yes | The running packages that add to this balance, oldest first. [] when none. |