ClocknextHelp
DocumentationAPI ReferenceMCP Tools
Dashboard

Get started

OverviewQuickstart

Core concepts

The response envelopeErrorsPaginationAsync, flushing & reliability

API reference

Record Signals POSTRecord usage logs POST
List customers GETCreate a customer POSTGet a customer GETUpdate a customer PATCHDelete a customer DELETEGet a customer's balances GETGet a customer's current plan GETList a customer's wallet transactions GETAdd a wallet transaction POSTAdjust a customer's credit balance POSTAdjust a customer's outcome balance POSTAdjust a customer's unit balance POST
List a customer's members GETAdd a member POSTUpdate a member PATCHRemove a member DELETE
List purchases GETCreate a purchase POSTGet a purchase GETUpdate a purchase's auto-payment setting PATCHCancel a purchase POST
List invoices GETGet an invoice GETMint a hosted pay link GET
List payments GETGet a payment GET
Mint a customer-portal access token POST
Customer Portal

Mint a customer-portal access token

Returns a short-lived HS256 JWT for the customer portal. A customer not in the key's organisation is reported as `400` here (not `404`); an `organizationId` mismatch is `403`.

POST
/portal/token

Authorization

apiKey
AuthorizationBearer <token>

Per-organisation API key from Settings → API Keys, sent as Authorization: Bearer cnk_…. Missing, unknown or expired keys return 401.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/portal/token" \  -H "Content-Type: application/json" \  -d '{    "customerId": "cus_abc123",    "organizationId": "org_2b9c4d",    "ttlSeconds": 900,    "memberEmail": "dana@acme.com"  }'
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "OK"  },  "result": {    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJjdXNfYWJjMTIzIiwib3JnIjoib3JnXzJiOWM0ZCJ9.4kTjZq8x1vXK9mYw2rL6nQ",    "expiresAt": 1785499500,    "expiresIn": 900  }}
{  "statusCode": 400,  "statusDetail": {    "status": "ERROR",    "message": "Request body must be valid JSON."  },  "result": {}}
{  "statusCode": 401,  "statusDetail": {    "status": "ERROR",    "message": "Invalid API key."  },  "result": {}}
{  "statusCode": 403,  "statusDetail": {    "status": "ERROR",    "message": "organizationId does not match this API key."  },  "result": {}}
{  "statusCode": 500,  "statusDetail": {    "status": "ERROR",    "message": "Could not complete the request."  },  "result": {}}

Get a payment GET

Resolves only PAID invoices; anything else is a 404.

customerId*string
Length1 <= length
organizationId?string

If present, must equal the key's organisation (else 403).

Length1 <= length
ttlSeconds?integer

Clamped to the organisation's configured TTL cap.

Range1 <= value <= 3600
memberEmail?string

Paid-by / receipt email; embedded as the token's email claim.

Formatemail