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

Outcomes

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

List outcomes

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

GET
/outcomes

Lists your outcomes. 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 outcomes.

Response Body

Outcomes.

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 outcomes.

Example Request
curl -X GET 'https://payments.clocknext.com/api/v1/outcomes?active=true'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Request processed successfully."  },  "result": {    "outcomes": [      {        "id": "cmvgvffng000808l237059in9",        "name": "Resolved Support Ticket",        "agentKey": "support_ticket",        "description": "A customer ticket triaged, answered and closed",        "isActive": true,        "basePrice": 0.084015,        "marginPercent": 50,        "pricePerOutcome": 0.1260225,        "createdAt": "2026-10-20T16:01:49.564Z",        "updatedAt": "2026-10-20T16:01:49.564Z"      },      {        "id": "cmvgvffxr000c08l28wch48fa",        "name": "Contract Review",        "agentKey": "contract_review",        "description": "Updated 2026-10-20 — outcome description",        "isActive": true,        "basePrice": 0.4658,        "marginPercent": 100,        "pricePerOutcome": 0.9316,        "createdAt": "2026-10-20T16:01:49.935Z",        "updatedAt": "2026-10-20T16:05:12.118Z"      }    ]  }}

Create an outcome

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

POST
/outcomes

Creates an outcome. Each step is priced from its modelBundle.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Request Body

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

A new outcome with its steps. Keys use letters, digits, ., _ and - (at most 80) and match exactly. Signals name a step's agentKey, which is unique among all outcome steps of the workspace.

name*string

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

Length1 <= length <= 120
agentKey*string

The outcome's own key. Unique among your outcomes (409 if taken). Signals name a step's key.

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

Optional note about the outcome.

Lengthlength <= 500
marginPercent*number

Markup on the base price (the sum of the steps), in percent. -100 makes the outcome free.

Range-100 <= value
steps*array<>

The steps of the outcome, in order. Each step needs a modelBundle; the server prices each step from it.

Items1 <= items <= 50

Response Body

Outcome 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 outcome.

Example Request
curl -X POST 'https://payments.clocknext.com/api/v1/outcomes' \  -H 'Content-Type: application/json' \  -d '{  "name": "Resolved Support Ticket",  "agentKey": "support_ticket",  "description": "A customer ticket triaged, answered and closed",  "marginPercent": 50,  "steps": [    {      "name": "Triage",      "agentKey": "support_ticket.triage",      "modelBundle": [        {          "modelId": "claude-haiku-4-5",          "averageTokensPerLLMCall": 4000,          "input": 80,          "output": 20,          "cache": 0,          "cacheWrite": 0        }      ]    },    {      "name": "Draft reply",      "agentKey": "support_ticket.draft",      "modelBundle": [        {          "modelId": "claude-sonnet-4-5",          "averageTokensPerLLMCall": 12000,          "input": 60,          "output": 30,          "cache": 10,          "cacheWrite": 0        }      ]    },    {      "name": "QA check",      "agentKey": "support_ticket.qa",      "modelBundle": [        {          "modelId": "gpt-4o-mini",          "averageTokensPerLLMCall": 3000,          "input": 70,          "output": 30,          "cache": 0,          "cacheWrite": 0        }      ]    }  ]}'
Example Response
{  "statusCode": 201,  "statusDetail": {    "status": "SUCCESS",    "message": "Outcome created."  },  "result": {    "created": true,    "outcome": {      "id": "cmvgvffng000808l237059in9",      "name": "Resolved Support Ticket",      "agentKey": "support_ticket",      "description": "A customer ticket triaged, answered and closed",      "isActive": true,      "basePrice": 0.084015,      "marginPercent": 50,      "pricePerOutcome": 0.1260225,      "createdAt": "2026-10-20T16:01:49.564Z",      "updatedAt": "2026-10-20T16:01:49.564Z"    }  }}

Update an outcome

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

PATCH
/outcomes/{id}

Updates only the fields you send. Send each step's id to keep it.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

id*string

Outcome id.

Request Body

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

Only the fields you send change. Keys use letters, digits, ., _ and - (at most 80) and match exactly. A step keeps its id: matched by id, else by agentKey. A step sent without modelBundle keeps its price.

name?string

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

Length1 <= length <= 120
agentKey?string

A new key for the outcome. Unique among your outcomes (409 if taken).

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

A new note. Send null to clear it.

Lengthlength <= 500
marginPercent?number

A new markup on the base price, in percent, down to -100.

Range-100 <= value
steps?array<>

The complete new step list. Saved steps that you leave out are removed.

Items1 <= items <= 50

Response Body

Outcome 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 outcome.

curl -X PATCH 'https://payments.clocknext.com/api/v1/outcomes/oc_3n7p2' \  -H 'Content-Type: application/json' \  -d '{  "steps": [    {      "agentKey": "contract_review.extract",      "name": "Extract clauses",      "modelBundle": [        {          "modelId": "claude-sonnet-4-5",          "input": 70,          "output": 30,          "cache": 0,          "cacheWrite": 0,          "averageTokensPerLLMCall": 50000        }      ]    },    {      "id": "cmvgvffxu000e08l2m2xr8edr",      "name": "Summarise for legal",      "agentKey": "contract_review.summarise",      "modelBundle": [        {          "modelId": "gpt-4o",          "input": 50,          "output": 50,          "cache": 0,          "cacheWrite": 0,          "averageTokensPerLLMCall": 20000        }      ]    },    {      "name": "Risk score",      "agentKey": "contract_review.risk",      "modelBundle": [        {          "modelId": "claude-haiku-4-5",          "averageTokensPerLLMCall": 6000,          "input": 80,          "output": 20,          "cache": 0,          "cacheWrite": 0        }      ]    }  ]}'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Outcome updated."  },  "result": {    "updated": true,    "outcome": {      "id": "cmvgvffxr000c08l28wch48fa",      "name": "Contract Review",      "agentKey": "contract_review",      "description": "Updated 2026-10-20 — outcome description",      "isActive": true,      "basePrice": 0.4658,      "marginPercent": 100,      "pricePerOutcome": 0.9316,      "createdAt": "2026-10-20T16:01:49.935Z",      "updatedAt": "2026-10-20T16:05:12.118Z"    }  }}

Get an outcome

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

GET
/outcomes/{id}

Gets one outcome with its steps.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

id*string

Outcome id.

Response Body

The outcome.

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

Example Request
curl -X GET 'https://payments.clocknext.com/api/v1/outcomes/oc_3n7p2'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Request processed successfully."  },  "result": {    "outcome": {      "id": "cmvgvffxr000c08l28wch48fa",      "name": "Contract Review",      "agentKey": "contract_review",      "description": "Updated 2026-10-20 — outcome description",      "isActive": true,      "basePrice": 0.455,      "marginPercent": 100,      "pricePerOutcome": 0.91,      "createdAt": "2026-10-20T16:01:49.935Z",      "updatedAt": "2026-10-20T16:04:51.479Z",      "steps": [        {          "id": "cmvgvffxu000d08l2e3a19jua",          "name": "Extract clauses",          "agentKey": "contract_review.extract",          "order": 0,          "basePrice": 0.33,          "modelBundle": [            {              "modelId": "claude-sonnet-4-5",              "modelName": "Claude Sonnet 4.5 (latest)",              "input": 70,              "output": 30,              "cache": 0,              "cacheWrite": 0,              "averageTokensPerLLMCall": 50000            }          ]        },        {          "id": "cmvgvffxu000e08l2m2xr8edr",          "name": "Summarise",          "agentKey": "contract_review.summarise",          "order": 1,          "basePrice": 0.125,          "modelBundle": [            {              "modelId": "gpt-4o",              "modelName": "GPT-4o",              "input": 50,              "output": 50,              "cache": 0,              "cacheWrite": 0,              "averageTokensPerLLMCall": 20000            }          ]        }      ]    }  }}

Archive an outcome

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

POST
/outcomes/{id}/archive

Archives an outcome. Nothing is deleted.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

id*string

Outcome id.

Response Body

Outcome 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 outcome.

Example Request
curl -X POST 'https://payments.clocknext.com/api/v1/outcomes/oc_3n7p2/archive'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Outcome archived."  },  "result": {    "archived": true,    "outcome": {      "id": "cmvgvffxr000c08l28wch48fa",      "name": "Contract Review",      "agentKey": "contract_review",      "description": "Updated 2026-10-20 — outcome description",      "isActive": false,      "basePrice": 0.455,      "marginPercent": 100,      "pricePerOutcome": 0.91,      "createdAt": "2026-10-20T16:01:49.935Z",      "updatedAt": "2026-10-20T16:04:50.293Z"    }  }}

Unarchive an outcome

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

POST
/outcomes/{id}/unarchive

Restores an archived outcome.

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

id*string

Outcome id.

Response Body

Outcome 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 outcome.

Example Request
curl -X POST 'https://payments.clocknext.com/api/v1/outcomes/oc_3n7p2/unarchive'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Outcome restored."  },  "result": {    "unarchived": true,    "outcome": {      "id": "cmvgvffxr000c08l28wch48fa",      "name": "Contract Review",      "agentKey": "contract_review",      "description": "Updated 2026-10-20 — outcome description",      "isActive": true,      "basePrice": 0.455,      "marginPercent": 100,      "pricePerOutcome": 0.91,      "createdAt": "2026-10-20T16:01:49.935Z",      "updatedAt": "2026-10-20T16:04:51.022Z"    }  }}

Types

Every object type on this page, with its fields.

Outcome

FieldTypeRequiredDescription
idstringyesThe outcome's id.
namestringyesThe outcome's name. Unique in the workspace, ignoring case.
agentKeystringyesUnique outcome key.
descriptionstring | nullyesOptional note about the outcome. null when not set.
isActivebooleanyesfalse once archived; it can't go on a new plan. Read-only: use archive and unarchive.
basePricenumberyesSum of the steps' prices.
marginPercentnumberyesMarkup on basePrice, in percent. Can be negative, down to -100.
pricePerOutcomenumberyesPrice of one completed outcome, in USD: basePrice × (1 + marginPercent / 100).
createdAtstringyesWhen the outcome was created.
updatedAtstringyesWhen the outcome was last changed.

CreateOutcomeInput

A new outcome with its steps. Keys use letters, digits, ., _ and - (at most 80) and match exactly. Signals name a step's agentKey, which is unique among all outcome steps of the workspace.

FieldTypeRequiredDescription
namestringyesThe outcome's name. Must be unique in the workspace, ignoring case (409 if taken).
agentKeystringyesThe outcome's own key. Unique among your outcomes (409 if taken). Signals name a step's key.
descriptionstring | nullnoOptional note about the outcome.
marginPercentnumberyesMarkup on the base price (the sum of the steps), in percent. -100 makes the outcome free.
stepsOutcomeStepInput[]yesThe steps of the outcome, in order. Each step needs a modelBundle; the server prices each step from it.

OutcomeStepInput

One step of an outcome, as sent on create or update.

FieldTypeRequiredDescription
idstringnoExisting step id (update only).
namestringyesThe step's name. Must be unique in this outcome, ignoring case.
agentKeystringyesThe key an outcome signal names for this step. Unique among all outcome steps (409 if taken).
modelBundleModelBundleLineInput[]noRequired for a new step.

ModelBundleLineInput

One model in the mix of a credit or outcome step. input, output, cache and cacheWrite are whole percentages of averageTokensPerLLMCall that add up to 100. cacheWrite is 0 when the model has no cache-write price.

FieldTypeRequiredDescription
modelIdstringyesA model id enabled in your workspace — the id you send as usage.model. An archived model is refused (400).
averageTokensPerLLMCallnumberyesAverage tokens one LLM call to this model uses. Must be above 0. The four shares split these tokens.
inputintegeryesInput-token share of averageTokensPerLLMCall: a whole percent, 0 to 100.
outputintegeryesOutput-token share of averageTokensPerLLMCall: a whole percent, 0 to 100.
cacheintegeryesCache-read share of averageTokensPerLLMCall: a whole percent, 0 to 100.
cacheWriteintegernoCache-write share: a whole percent, 0 to 100. 0 when the model has no cache-write price.

UpdateOutcomeInput

Only the fields you send change. Keys use letters, digits, ., _ and - (at most 80) and match exactly. A step keeps its id: matched by id, else by agentKey. A step sent without modelBundle keeps its price.

FieldTypeRequiredDescription
namestringnoA new name. Must be unique in the workspace, ignoring case (409 if taken).
agentKeystringnoA new key for the outcome. Unique among your outcomes (409 if taken).
descriptionstring | nullnoA new note. Send null to clear it.
marginPercentnumbernoA new markup on the base price, in percent, down to -100.
stepsOutcomeStepInput[]noThe complete new step list. Saved steps that you leave out are removed.

OutcomeWithSteps

FieldTypeRequiredDescription
idstringyesThe outcome's id.
namestringyesThe outcome's name. Unique in the workspace, ignoring case.
agentKeystringyesUnique outcome key.
descriptionstring | nullyesOptional note about the outcome. null when not set.
isActivebooleanyesfalse once archived; it can't go on a new plan. Read-only: use archive and unarchive.
basePricenumberyesSum of the steps' prices.
marginPercentnumberyesMarkup on basePrice, in percent. Can be negative, down to -100.
pricePerOutcomenumberyesPrice of one completed outcome, in USD: basePrice × (1 + marginPercent / 100).
createdAtstringyesWhen the outcome was created.
updatedAtstringyesWhen the outcome was last changed.
stepsOutcomeStep[]yesThe outcome's steps, in order. Each step has its own agentKey, which outcome signals name.

OutcomeStep

One step of an outcome: one agent call, named by its agentKey, with its own model mix and price.

FieldTypeRequiredDescription
idstringyesStep id.
namestringyesThe step's name. Unique in its outcome, ignoring case.
agentKeystringyesUnique key an outcome signal names.
orderintegeryesThe step's position in the outcome, from 0. It follows the order of the steps list that was sent.
basePricenumberyesOne run of this step in USD, without margin, worked out from modelBundle when saved.
modelBundleModelBundleLine[]yesThe models and token mix that basePrice is worked out from, one line per model.

ModelBundleLine

One model in the mix of a credit or outcome step. input, output, cache and cacheWrite are whole percentages of averageTokensPerLLMCall that add up to 100.

FieldTypeRequiredDescription
modelIdstring | nullyesThe model's id, as sent in usage.model. null when the model was removed after the bundle was saved.
modelNamestringyesModel name.
averageTokensPerLLMCallnumberyesAverage tokens per LLM call.
inputintegeryesInput share (%).
outputintegeryesOutput share (%).
cacheintegeryesCache-read share (%).
cacheWriteintegeryesCache-write share (%).

Credits

Credits your product draws down by `agentKey`, priced from a model bundle. Nothing is deleted — archive instead.

Units

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