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

Units

Fixed-price events, priced FLAT, SLAB or VOLUME. Nothing is deleted — archive instead.

List units

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

GET
/units

Lists your units. Pass active=true for active ones only.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Query Parameters

active?boolean

true returns only active units.

Response Body

Units.

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 workspace's units.

Example Request
curl -X GET 'https://payments.clocknext.com/api/v1/units?active=true'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Request processed successfully."  },  "result": {    "units": [      {        "id": "cmvgv92mk000n08l5jjjxnnul",        "name": "PDF Export",        "agentKey": "pdf_export",        "description": "One exported PDF report",        "pricingType": "FLAT",        "flatPrice": 0.25,        "tiers": [],        "isActive": true,        "createdAt": "2026-10-20T15:56:52.748Z",        "updatedAt": "2026-10-20T15:56:52.748Z"      },      {        "id": "cmvgv92vf000o08l5qnqm39eo",        "name": "Voice Minute",        "agentKey": "voice_minute",        "description": "One minute of voice-agent call time",        "pricingType": "FLAT",        "flatPrice": 0.06,        "tiers": [],        "isActive": true,        "createdAt": "2026-10-20T15:56:53.067Z",        "updatedAt": "2026-10-20T16:05:17.414Z"      },      {        "id": "cmvgv9342000p08l59sk1lk51",        "name": "Web Scrape",        "agentKey": "web_scrape",        "description": "Updated 2026-10-20 — unit description",        "pricingType": "SLAB",        "flatPrice": 0,        "tiers": [          {            "id": "cmvgv9346000q08l5m2bwxenu",            "upTo": 1000,            "price": 0.012,            "order": 0          },          {            "id": "cmvgv9346000r08l51j8eism0",            "upTo": 5000,            "price": 0.009,            "order": 1          },          {            "id": "cmvgv9346000s08l501x42the",            "upTo": null,            "price": 0.006,            "order": 2          }        ],        "isActive": true,        "createdAt": "2026-10-20T15:56:53.378Z",        "updatedAt": "2026-10-20T16:05:13.120Z"      },      {        "id": "cmvgv93fx000007iiew8xnjd8",        "name": "Seat",        "agentKey": "seat",        "description": "One active workspace seat",        "pricingType": "VOLUME",        "flatPrice": 0,        "tiers": [          {            "id": "cmvgv93g1000107ii3qewqa3l",            "upTo": 10,            "price": 12,            "order": 0          },          {            "id": "cmvgv93g2000207iij83us6ox",            "upTo": 50,            "price": 10,            "order": 1          },          {            "id": "cmvgv93g2000307iiu4njc6lk",            "upTo": null,            "price": 8,            "order": 2          }        ],        "isActive": true,        "createdAt": "2026-10-20T15:56:53.805Z",        "updatedAt": "2026-10-20T15:56:53.805Z"      }    ]  }}

Create a unit

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

POST
/units

Creates a unit. The last tier must have upTo: null.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Request Body

application/json
  1. body
  1. body
  2. …

SLAB and VOLUME need tiers. FLAT: flatPrice per unit. SLAB: each band of tiers prices its units. VOLUME: the band the total is in prices all units. Worked example, 3000 units (0.01 to 1000, then 0.008): SLAB 26, VOLUME 24.

name*string

The unit's name. Must be unique in the workspace, ignoring case (409 if taken).

Length1 <= length <= 80
agentKey*string

The key a unit signal names. Unique among your units (409 if taken).

Match^[A-Za-z0-9._-]+$
Length1 <= length <= 80
description?|

Optional note about the unit. An empty string is saved as null.

Lengthlength <= 400
pricingType*string

How units are priced. FLAT uses flatPrice. SLAB and VOLUME use tiers.

Value in"FLAT""SLAB""VOLUME"
flatPrice?number

FLAT only.

Range0 <= value
tiers?array<>

SLAB / VOLUME only. Last tier has upTo: null.

Itemsitems <= 50

Response Body

Unit created.

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 new unit.

curl -X POST 'https://payments.clocknext.com/api/v1/units' \  -H 'Content-Type: application/json' \  -d '{  "name": "PDF Export",  "agentKey": "pdf_export",  "description": "One exported PDF report",  "pricingType": "FLAT",  "flatPrice": 0.25}'
Example Response
{  "statusCode": 201,  "statusDetail": {    "status": "SUCCESS",    "message": "Unit created."  },  "result": {    "created": true,    "unit": {      "id": "cmvgv92mk000n08l5jjjxnnul",      "name": "PDF Export",      "agentKey": "pdf_export",      "description": "One exported PDF report",      "pricingType": "FLAT",      "flatPrice": 0.25,      "tiers": [],      "isActive": true,      "createdAt": "2026-10-20T15:56:52.748Z",      "updatedAt": "2026-10-20T15:56:52.748Z"    }  }}

Update a unit

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

PATCH
/units/{id}

Updates only the fields you send. tiers, when sent, is the complete new list. A tier keeps its id: matched by id, else by position. Only a new tier gets a new id; a saved tier left out is removed. An unknown or repeated tier id is a 400.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

id*string

Unit id.

Request Body

application/json
  1. body
  1. body
  2. …

Only sent fields change. FLAT: flatPrice per unit. SLAB: each band of tiers prices its units. VOLUME: the band the total is in prices all units. Worked example, 3000 units (0.01 to 1000, then 0.008): SLAB 26, VOLUME 24.

name?string

A new name. Must be unique in the workspace, ignoring case (409 if taken).

Length1 <= length <= 80
agentKey?string

A new key for unit signals. Unique among your units (409 if taken).

Match^[A-Za-z0-9._-]+$
Length1 <= length <= 80
description?|

A new note. Send null to clear it.

Lengthlength <= 400
pricingType?string

A new pricing type. A change to FLAT removes all tiers.

Value in"FLAT""SLAB""VOLUME"
flatPrice?number

A new price in USD for each unit. FLAT only.

Range0 <= value
tiers?array<>

The complete new tier list, for SLAB or VOLUME only. Saved tiers that you leave out are removed.

Itemsitems <= 50

Response Body

Unit updated.

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 updated unit.

curl -X PATCH 'https://payments.clocknext.com/api/v1/units/un_5q9w4' \  -H 'Content-Type: application/json' \  -d '{  "tiers": [    {      "upTo": 1000,      "price": 0.012    },    {      "upTo": 5000,      "price": 0.009    },    {      "upTo": null,      "price": 0.006    }  ]}'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Unit updated."  },  "result": {    "updated": true,    "unit": {      "id": "cmvgv9342000p08l59sk1lk51",      "name": "Web Scrape",      "agentKey": "web_scrape",      "description": "Updated 2026-10-20 — unit description",      "pricingType": "SLAB",      "flatPrice": 0,      "tiers": [        {          "id": "cmvgv9346000q08l5m2bwxenu",          "upTo": 1000,          "price": 0.012,          "order": 0        },        {          "id": "cmvgv9346000r08l51j8eism0",          "upTo": 5000,          "price": 0.009,          "order": 1        },        {          "id": "cmvgv9346000s08l501x42the",          "upTo": null,          "price": 0.006,          "order": 2        }      ],      "isActive": true,      "createdAt": "2026-10-20T15:56:53.378Z",      "updatedAt": "2026-10-20T16:05:13.120Z"    }  }}

Get a unit

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

GET
/units/{id}

Gets one unit.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

id*string

Unit id.

Response Body

The unit.

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 unit with this id, in unit.

Example Request
curl -X GET 'https://payments.clocknext.com/api/v1/units/un_5q9w4'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Request processed successfully."  },  "result": {    "unit": {      "id": "cmvgv9342000p08l59sk1lk51",      "name": "Web Scrape",      "agentKey": "web_scrape",      "description": "Updated 2026-10-20 — unit description",      "pricingType": "SLAB",      "flatPrice": 0,      "tiers": [        {          "id": "cmvgv9346000q08l5m2bwxenu",          "upTo": 1000,          "price": 0.01,          "order": 0        },        {          "id": "cmvgv9346000r08l51j8eism0",          "upTo": 5000,          "price": 0.008,          "order": 1        },        {          "id": "cmvgv9346000s08l501x42the",          "upTo": null,          "price": 0.005,          "order": 2        }      ],      "isActive": true,      "createdAt": "2026-10-20T15:56:53.378Z",      "updatedAt": "2026-10-20T16:04:56.741Z"    }  }}

Archive a unit

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

POST
/units/{id}/archive

Archives a unit. Nothing is deleted.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

id*string

Unit id.

Response Body

Unit archived.

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 archived unit.

Example Request
curl -X POST 'https://payments.clocknext.com/api/v1/units/un_5q9w4/archive'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Unit archived."  },  "result": {    "archived": true,    "unit": {      "id": "cmvgv9342000p08l59sk1lk51",      "name": "Web Scrape",      "agentKey": "web_scrape",      "description": "Updated 2026-10-20 — unit description",      "pricingType": "SLAB",      "flatPrice": 0,      "tiers": [        {          "id": "cmvgv9346000q08l5m2bwxenu",          "upTo": 1000,          "price": 0.01,          "order": 0        },        {          "id": "cmvgv9346000r08l51j8eism0",          "upTo": 5000,          "price": 0.008,          "order": 1        },        {          "id": "cmvgv9346000s08l501x42the",          "upTo": null,          "price": 0.005,          "order": 2        }      ],      "isActive": false,      "createdAt": "2026-10-20T15:56:53.378Z",      "updatedAt": "2026-10-20T16:04:55.760Z"    }  }}

Unarchive a unit

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

POST
/units/{id}/unarchive

Restores an archived unit.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

id*string

Unit id.

Response Body

Unit unarchived.

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 restored unit.

Example Request
curl -X POST 'https://payments.clocknext.com/api/v1/units/un_5q9w4/unarchive'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Unit restored."  },  "result": {    "unarchived": true,    "unit": {      "id": "cmvgv9342000p08l59sk1lk51",      "name": "Web Scrape",      "agentKey": "web_scrape",      "description": "Updated 2026-10-20 — unit description",      "pricingType": "SLAB",      "flatPrice": 0,      "tiers": [        {          "id": "cmvgv9346000q08l5m2bwxenu",          "upTo": 1000,          "price": 0.01,          "order": 0        },        {          "id": "cmvgv9346000r08l51j8eism0",          "upTo": 5000,          "price": 0.008,          "order": 1        },        {          "id": "cmvgv9346000s08l501x42the",          "upTo": null,          "price": 0.005,          "order": 2        }      ],      "isActive": true,      "createdAt": "2026-10-20T15:56:53.378Z",      "updatedAt": "2026-10-20T16:04:56.420Z"    }  }}

Types

Every object type on this page, with its fields.

Unit

FLAT: flatPrice per unit. SLAB: each band of tiers prices its units. VOLUME: the band the total is in prices all units. Worked example, 3000 units (0.01 to 1000, then 0.008): SLAB 26, VOLUME 24.

FieldTypeRequiredDescription
idstringyesThe unit's id.
namestringyesThe unit's name. Unique in the workspace, ignoring case.
agentKeystringyesUnique key a unit signal names.
descriptionstring | nullyesOptional note about the unit. null when not set.
pricingType"FLAT" | "SLAB" | "VOLUME"yesFLAT uses flatPrice; SLAB and VOLUME use tiers. See the Unit type for the rule.
flatPricenumberyesFLAT only.
tiersUnitTier[]yesSLAB / VOLUME only.
isActivebooleanyesfalse once archived; it can't go on a new plan. Read-only: use archive and unarchive.
createdAtstringyesWhen the unit was created.
updatedAtstringyesWhen the unit was last changed.

UnitTier

One price band of a SLAB or VOLUME unit. Tiers are in order, and each upTo is larger than the one before.

FieldTypeRequiredDescription
idstringyesStays the same when the unit is updated, until this tier is removed.
upTointeger | nullyesThe last unit this tier covers; the limit is included. null on the last tier: every unit above.
pricenumberyesPrice per unit.
orderintegeryesThe tier's position in the list, from 0. Tiers are applied in this order.

CreateUnitInput

SLAB and VOLUME need tiers. FLAT: flatPrice per unit. SLAB: each band of tiers prices its units. VOLUME: the band the total is in prices all units. Worked example, 3000 units (0.01 to 1000, then 0.008): SLAB 26, VOLUME 24.

FieldTypeRequiredDescription
namestringyesThe unit's name. Must be unique in the workspace, ignoring case (409 if taken).
agentKeystringyesThe key a unit signal names. Unique among your units (409 if taken).
descriptionstring | nullnoOptional note about the unit. An empty string is saved as null.
pricingType"FLAT" | "SLAB" | "VOLUME"yesHow units are priced. FLAT uses flatPrice. SLAB and VOLUME use tiers.
flatPricenumbernoFLAT only.
tiersobject[]noSLAB / VOLUME only. Last tier has upTo: null.

CreateUnitInput.tiers

FieldTypeRequiredDescription
upTointeger | nullyesThe last unit this tier covers, included. Larger than the one before. null on the last tier only.
pricenumberyesPrice in USD for each unit in this band.

UpdateUnitInput

Only sent fields change. FLAT: flatPrice per unit. SLAB: each band of tiers prices its units. VOLUME: the band the total is in prices all units. Worked example, 3000 units (0.01 to 1000, then 0.008): SLAB 26, VOLUME 24.

FieldTypeRequiredDescription
namestringnoA new name. Must be unique in the workspace, ignoring case (409 if taken).
agentKeystringnoA new key for unit signals. Unique among your units (409 if taken).
descriptionstring | nullnoA new note. Send null to clear it.
pricingType"FLAT" | "SLAB" | "VOLUME"noA new pricing type. A change to FLAT removes all tiers.
flatPricenumbernoA new price in USD for each unit. FLAT only.
tiersobject[]noThe complete new tier list, for SLAB or VOLUME only. Saved tiers that you leave out are removed.

UpdateUnitInput.tiers

FieldTypeRequiredDescription
idstringnoThe id of a saved tier, to update it. Leave it out to match the tier at the same position.
upTointeger | nullyesThe last unit this tier covers, included. Larger than the one before. null on the last tier only.
pricenumberyesPrice in USD for each unit in this band.

Outcomes

Multi-step deliverables billed per completed outcome. Nothing is deleted — archive instead.

Composites

Credits, outcomes and units billed together as one thing. Nothing is deleted — archive instead.