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

Get a customer's wallet ledger using customer Id

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

GET
/customers/{id}/wallet

Both wallet balances in USD and the ledger, newest first. source says what moved the money; a usage charge is a USAGE_LOG row with usageLogId, the signal id. Changed on 2026-11-25: package money has its own sources (Packages). Paged with limit and cursor; narrow it with from and to.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

id*string

Customer id.

Query Parameters

limit?integer

Maximum rows to return. Must be a positive number; clamped to 1–200.

Range1 <= value <= 200
Default50
cursor?string

Opaque token from a previous response's nextCursor. Omit for the first page.

from?string

First day to include, YYYY-MM-DD (UTC). The whole day is included. Omit for no lower bound. Keep sending the same value while paging with cursor.

Formatdate
to?string

Last day to include, YYYY-MM-DD (UTC). The whole day is included. Omit for no upper bound. Must not be before from.

Formatdate

Response Body

The wallet balances and one page of the ledger, most recent first.

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 customer's Wallet balances and one page of Wallet transactions.

Example Request
curl -X GET 'https://payments.clocknext.com/api/v1/customers/cus_abc123/wallet?limit=25&cursor=eyJ0cyI6IjIwMjYtMTAtMDlUMDU6Mjc6MjEuNjM3WiIsImlkIjoiY212MGl4NHgxMDAwMjA2andjZncyM2J2ZCJ9&from=2026-10-01&to=2026-10-07'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Request processed successfully."  },  "result": {    "balanceUsd": 129.381975,    "reservedBalanceUsd": 60,    "lowBalanceThresholdUsd": 15,    "lowBalanceThresholdPercent": null,    "transactions": [      {        "id": "cmvgvxovp000c07jsvvosbnxv",        "createdAt": "2026-10-20T16:16:01.333Z",        "type": "CREDIT",        "pool": "reserved",        "source": "API",        "amount": 60,        "amountUsd": 60,        "currencyCode": "USD",        "currencyRateUsd": 1,        "notes": "Reserved overage pool for Q4",        "entitlementType": null,        "entitlementId": null,        "entitlementName": null,        "usageLogId": null,        "purchaseId": null,        "purchaseNumber": null,        "purchasePackageId": null,        "packageId": null,        "invoiceId": null      },      {        "id": "cmvgvxokd000a07js6y39h4km",        "createdAt": "2026-10-20T16:16:00.925Z",        "type": "DEBIT",        "pool": "reserved",        "source": "API",        "amount": 25,        "amountUsd": 25,        "currencyCode": "USD",        "currencyRateUsd": 1,        "notes": null,        "entitlementType": null,        "entitlementId": null,        "entitlementName": null,        "usageLogId": null,        "purchaseId": null,        "purchaseNumber": null,        "purchasePackageId": null,        "packageId": null,        "invoiceId": null      },      {        "id": "cmvgvxo09000807js16lx564n",        "createdAt": "2026-10-20T16:16:00.201Z",        "type": "DEBIT",        "pool": "reserved",        "source": "API",        "amount": 15,        "amountUsd": 15,        "currencyCode": "USD",        "currencyRateUsd": 1,        "notes": "Release part of reserve",        "entitlementType": null,        "entitlementId": null,        "entitlementName": null,        "usageLogId": null,        "purchaseId": null,        "purchaseNumber": null,        "purchasePackageId": null,        "packageId": null,        "invoiceId": null      }    ],    "nextCursor": null  }}

Get a customer's wallet ledger using external Id

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

GET
/customers/ext/{externalId}/wallet

The same call, addressed by the customer's externalId. Same query parameters 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

Query Parameters

limit?integer

Maximum rows to return. Must be a positive number; clamped to 1–200.

Range1 <= value <= 200
Default50
cursor?string

Opaque token from a previous response's nextCursor. Omit for the first page.

from?string

First day to include, YYYY-MM-DD (UTC). The whole day is included. Omit for no lower bound. Keep sending the same value while paging with cursor.

Formatdate
to?string

Last day to include, YYYY-MM-DD (UTC). The whole day is included. Omit for no upper bound. Must not be before from.

Formatdate

Response Body

The wallet balances and one page of the ledger, most recent first.

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 customer's Wallet balances and one page of Wallet transactions.

Example Request
curl -X GET 'https://payments.clocknext.com/api/v1/customers/ext/string/wallet?limit=25&cursor=eyJ0cyI6IjIwMjYtMTAtMDlUMDU6Mjc6MjEuNjM3WiIsImlkIjoiY212MGl4NHgxMDAwMjA2andjZncyM2J2ZCJ9&from=2026-10-01&to=2026-10-07'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Request processed successfully."  },  "result": {    "balanceUsd": 1000,    "reservedBalanceUsd": null,    "lowBalanceThresholdUsd": null,    "lowBalanceThresholdPercent": null,    "transactions": [      {        "id": "cmvgvllc1006h08l2me5wc1w0",        "createdAt": "2026-10-20T16:06:36.865Z",        "type": "CREDIT",        "pool": "main",        "source": "SUBSCRIPTION",        "amount": 1000,        "amountUsd": 1000,        "currencyCode": "USD",        "currencyRateUsd": 1,        "notes": null,        "entitlementType": null,        "entitlementId": null,        "entitlementName": null,        "usageLogId": null,        "purchaseId": "cmvgvko9x003n08l2m19o4vgs",        "purchaseNumber": "PUR-003",        "purchasePackageId": null,        "packageId": null,        "invoiceId": null      }    ],    "nextCursor": null  }}

Types

Every object type on this page, with its fields.

WalletLedger

FieldTypeRequiredDescription
balanceUsdnumberyesThe ordinary Wallet balance, in USD. May be negative.
reservedBalanceUsdnumber | nullyesThe Reserved Wallet balance, in USD. null when the workspace hasn't enabled it.
lowBalanceThresholdUsdnumber | nullyesThe customer's own low-balance threshold in USD; null when none is set or when it is a percentage.
lowBalanceThresholdPercentnumber | nullyesThe customer's own low-balance threshold as a percentage (0 to 100) of the plan's Wallet amount per cycle; null when none is set or when it is in USD. At most one of this and lowBalanceThresholdUsd is set.
transactionsWalletTransaction[]yesEvery movement of money in both wallets, newest first. One page of at most limit rows.
nextCursorstring | nullyesPass back as cursor for the next page. null on the last page.

WalletTransaction

One movement of wallet money.

FieldTypeRequiredDescription
idstringyesThe row's id. On a USAGE_LOG row: the signal's id, with :reserved on the Reserved Wallet row.
createdAtstringyesWhen the money moved. On a USAGE_LOG row, when the signal was received.
type"CREDIT" | "DEBIT"yesCREDIT adds money to the wallet. DEBIT takes money out.
pool"main" | "reserved"yesWhich balance moved — the ordinary Wallet or the Reserved Wallet.
source"SUBSCRIPTION" | "RENEWAL" | "MANUAL" | "API" | "CUSTOMER_PORTAL" | "USAGE_LOG" | "INVOICE_SETTLEMENT" | "INVOICE_VOID" | "ONE_TIME_PACKAGE" | "RECURRING_PACKAGE" | "RECURRING_PACKAGE_RENEWAL" | "PACKAGE_CARRY_OVER" | "PACKAGE_REMOVED" | "PACKAGE_ENDED_BY_PLAN_CHANGE"yesWhat moved the money. Since 2026-11-25, the money of a package has its own 6 sources.
amountnumberyesAlways positive — type gives the direction. In USD, the same as amountUsd.
amountUsdnumberyesThe amount, in USD.
currencyCodestringyesAlways USD.
currencyRateUsdnumberyesAlways 1.
notesstring | nullyesA person's note: yours on an API row, the admin's on a MANUAL row. null on system rows.
entitlementType"CREDIT" | "OUTCOME" | "UNIT" | "COMPOSITE" | nullyesOn a USAGE_LOG row for an entitlement: the kind charged. null on every other row.
entitlementIdstring | nullyesId of that credit, outcome, unit or composite.
entitlementNamestring | nullyesIts name when the row was written.
usageLogIdstring | nullyesOn a USAGE_LOG row: the signal's id, as in the usage log. null on every other row.
purchaseIdstring | nullyesOn a SUBSCRIPTION or RENEWAL grant and on a package line, the purchase it belongs to. On a PACKAGE_CARRY_OVER line, the old purchase on the DEBIT and the new purchase on the CREDIT.
purchaseNumberstring | nullyesThat purchase's readable number.
purchasePackageIdstring | nullyesOn a package row: the package's id on the subscription. null on every other row.
packageIdstring | nullyesOn a package row: the package in the catalog. null on every other row.
invoiceIdstring | nullyesOn a package row: the package's own invoice, or the renewal invoice. null on every other row.

Get a customer's balances GET

Previous Page

Set a customer's low-balance alert for wallet PUT

Next Page