Base URL https://payments.clocknext.com/api/v1
Grants (positive delta) or claws back (negative delta) a unit balance; fractions are allowed. The unit 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 unit's stable agent key — the same key used to record usage.
1 <= lengthdelta*numberSigned change: positive grants, negative reduces. Non-zero; fractional allowed; 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 <= 255Unit 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 unit balance change.
curl -X POST 'https://payments.clocknext.com/api/v1/customers/cus_abc123/units/adjust' \ -H 'Content-Type: application/json' \ -d '{ "agentKey": "pdf_export", "delta": 25, "notes": "Bonus exports for Q4 board pack"}'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Unit balance adjusted." }, "result": { "adjusted": true, "replayed": false, "remaining": 268, "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 unit's stable agent key — the same key used to record usage.
1 <= lengthdelta*numberSigned change: positive grants, negative reduces. Non-zero; fractional allowed; 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 <= 255Unit 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 unit balance change.
curl -X POST 'https://payments.clocknext.com/api/v1/customers/ext/string/units/adjust' \ -H 'Content-Type: application/json' \ -d '{ "agentKey": "seat", "delta": 10}'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Unit balance adjusted." }, "result": { "adjusted": true, "replayed": false, "remaining": 90, "customerArchived": false }}Types
Every object type on this page, with its fields.
UnitAdjustInput
| Field | Type | Required | Description |
|---|---|---|---|
agentKey | string | yes | The unit's stable agent key — the same key used to record usage. |
delta | number | yes | Signed change: positive grants, negative reduces. Non-zero; fractional allowed; 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. |