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

Manage a customer's credit balance using customer Id

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

POST
/customers/{id}/credits/adjust

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.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

id*string

Customer id.

Request Body

application/json
  1. body
  1. body
  2. …
agentKey*string

The credit's stable agent key — the same key used to record usage.

Length1 <= length
delta*integer

Signed change: positive grants, negative claws back. Non-zero whole number; absolute value ≤ 10,000,000.

notes?string

Your note about the change, up to 200 characters. It is saved with the adjustment.

Lengthlength <= 200
idempotencyKey?string

Makes retries safe: a repeat with the same key adjusts nothing and returns replayed: true.

Length1 <= length <= 255

Response Body

Credit balance adjusted.

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 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"}'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Credit balance adjusted."  },  "result": {    "adjusted": true,    "replayed": false,    "remaining": 6493.708333,    "customerArchived": false  }}

Manage a customer's credit balance using external Id

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

POST
/customers/ext/{externalId}/credits/adjust

The same call, addressed by the customer's externalId. Same body and response.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

externalId*string

Your own id for the customer: 1–64 letters, numbers or "-". Case-sensitive.

Match^[A-Za-z0-9-]{1,64}$
Length1 <= length <= 64

Request Body

application/json
  1. body
  1. body
  2. …
agentKey*string

The credit's stable agent key — the same key used to record usage.

Length1 <= length
delta*integer

Signed change: positive grants, negative claws back. Non-zero whole number; absolute value ≤ 10,000,000.

notes?string

Your note about the change, up to 200 characters. It is saved with the adjustment.

Lengthlength <= 200
idempotencyKey?string

Makes retries safe: a repeat with the same key adjusts nothing and returns replayed: true.

Length1 <= length <= 255

Response Body

Credit balance adjusted.

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 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"}'
Example Response
{  "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

FieldTypeRequiredDescription
agentKeystringyesThe credit's stable agent key — the same key used to record usage.
deltaintegeryesSigned change: positive grants, negative claws back. Non-zero whole number; absolute value ≤ 10,000,000.
notesstringnoYour note about the change, up to 200 characters. It is saved with the adjustment.
idempotencyKeystringnoMakes 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