Base URL https://payments.clocknext.com/api/v1
Grants (positive delta) or claws back (negative delta) a credit balance. The credit must be a prepaid (ADVANCE) part of the plan, or the answer is a 422. A claw-back may take the balance below 0. Send an idempotencyKey to make retries safe.
apiKeyAuthorizationBearer <cnk_…>Organisation-scoped key from Settings → API Keys.
id*stringCustomer id.
application/json- body
agentKey*stringThe credit's stable agent key — the same key used to record usage.
1 <= lengthdelta*integerSigned change: positive grants, negative claws back. Non-zero whole number; absolute value ≤ 10,000,000.
notes?stringYour note about the change, up to 200 characters. It is saved with the adjustment.
length <= 200idempotencyKey?stringMakes retries safe: a repeat with the same key adjusts nothing and returns replayed: true.
1 <= length <= 255Credit balance adjusted.
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 result of the credit balance change.
curl -X POST 'https://payments.clocknext.com/api/v1/customers/cus_abc123/credits/adjust' \ -H 'Content-Type: application/json' \ -d '{ "agentKey": "chat_message", "delta": 500, "notes": "Goodwill — outage on 2026-10-18", "idempotencyKey": "adj-nw-chat-goodwill-1"}'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Credit balance adjusted." }, "result": { "adjusted": true, "replayed": false, "remaining": 6493.708333, "customerArchived": false }}Base URL https://payments.clocknext.com/api/v1
The same call, addressed by the customer's externalId. Same body and 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 <= 64application/json- body
agentKey*stringThe credit's stable agent key — the same key used to record usage.
1 <= lengthdelta*integerSigned change: positive grants, negative claws back. Non-zero whole number; absolute value ≤ 10,000,000.
notes?stringYour note about the change, up to 200 characters. It is saved with the adjustment.
length <= 200idempotencyKey?stringMakes retries safe: a repeat with the same key adjusts nothing and returns replayed: true.
1 <= length <= 255Credit balance adjusted.
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 result of the credit balance change.
curl -X POST 'https://payments.clocknext.com/api/v1/customers/ext/string/credits/adjust' \ -H 'Content-Type: application/json' \ -d '{ "agentKey": "deep_research", "delta": 250, "notes": "Contract amendment #2"}'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Credit balance adjusted." }, "result": { "adjusted": true, "replayed": false, "remaining": 6248.914025, "customerArchived": false }}Types
Every object type on this page, with its fields.
CreditAdjustInput
| Field | Type | Required | Description |
|---|---|---|---|
agentKey | string | yes | The credit's stable agent key — the same key used to record usage. |
delta | integer | yes | Signed change: positive grants, negative claws back. Non-zero whole number; absolute value ≤ 10,000,000. |
notes | string | no | Your note about the change, up to 200 characters. It is saved with the adjustment. |
idempotencyKey | string | no | Makes retries safe: a repeat with the same key adjusts nothing and returns replayed: true. |
Look Up Usage Logs by ID GET
Deprecated. Use [Look Up Usage Logs by ID](/docs/api-reference/signals/eventsLookupUsageLogs) on `events.clocknext.com`; `@clocknext/sdk` 0.20 and later already do. Up to 10 usage-log rows by id, from any customer of your organization, in the order of `ids`. Duplicates are removed; ids that match nothing are in `notFound`.
Manage a customer's outcome balance POST
Next Page