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

invoice.created POSTinvoice.paid POSTinvoice.voided POST

Customer Portal

Mint a customer-portal access token POST
Invoice

invoice.created

Triggered when an invoice is issued.

Header Parameters

X-Clocknext-Signature*string

t=<unix seconds>,v1=<hex HMAC-SHA256> — the HMAC of ${t}.${rawBody} keyed with the endpoint's signing secret. See Verify the signature.

X-Clocknext-Event-Id*string

The event's id — the same as id in the body, and the same on every retry.

X-Clocknext-Event-Type*string

The event name — the same as event_type in the body.

Request Body

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

evt_ + 32 hex characters. Unique per event, and the same on every retry of it — use it to skip duplicates.

event_type*string

Always invoice.created.

triggered_at*string

When the event was triggered (ISO 8601).

Formatdate-time
data*

The customer and the invoice, as it is after the change.

Response Body

Answer any 2xx within 5 seconds; the body is ignored. Anything else counts as failed and is retried.

Example Requests
POST/invoice.created
Request Body
application/json
{  "id": "evt_137f6e90bfbfdf10517fbdbcacb56873",  "event_type": "invoice.created",  "triggered_at": "2026-11-01T00:00:02.509Z",  "data": {    "customer": {      "id": "cus_abc123",      "name": "Acme Corp"    },    "invoice": {      "id": "inv_def456",      "number": "INV-0042",      "status": "OPEN",      "subscription_id": "pur_ghi789",      "plan_name": "Growth",      "billing_mode": "ADVANCE",      "cycle_index": 1,      "subtotal": 100,      "tax_amount": 18,      "amount": 118,      "currency_code": "usd",      "display_amount": 118,      "display_currency_code": "usd",      "issued_at": "2026-11-01T00:00:00.000Z",      "paid_at": null,      "voided_at": null    }  }}
Header Parameters
{  "X-Clocknext-Signature": "t=1791367200,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd",  "X-Clocknext-Event-Id": "evt_137f6e90bfbfdf10517fbdbcacb56873",  "X-Clocknext-Event-Type": "invoice.created"}

Types

Every object type on this page, with its fields.

InvoiceCreatedEvent

FieldTypeRequiredDescription
idstringyesevt_ + 32 hex characters. Unique per event, and the same on every retry of it — use it to skip duplicates.
event_typestringyesAlways invoice.created.
triggered_atstringyesWhen the event was triggered (ISO 8601).
dataInvoiceEventDatayesThe customer and the invoice, as it is after the change.

InvoiceEventData

The data object of an invoice.created, invoice.paid or invoice.voided event: the customer and the invoice, as it is after the change.

FieldTypeRequiredDescription
customerWebhookCustomeryesThe customer the event is about.
invoiceWebhookInvoiceyesThe invoice when the event is triggered.

WebhookCustomer

The customer the event is about.

FieldTypeRequiredDescription
idstringyesThe customer's Clocknext id.
namestringyesThe customer's name.

WebhookInvoice

The invoice when the event is triggered. Amounts are USD.

FieldTypeRequiredDescription
idstringyesThe invoice's id.
numberstringyesThe invoice's number.
status"OPEN" | "PAID" | "VOID" | "AUTO_CLOSED"yesOPEN, PAID, VOID or AUTO_CLOSED.
subscription_idstring | nullyesThe subscription the invoice bills — subscription.id in the subscription events.
plan_namestringyesThe plan's name.
billing_mode"ADVANCE" | "ARREAR"yesADVANCE — billed at the start of the period. ARREAR — billed for usage at its end.
cycle_indexintegeryesThe billing period the invoice covers. 0 is the first.
subtotalnumberyesThe total before tax, in USD.
tax_amountnumberyesThe tax, in USD.
amountnumberyesThe total, in USD.
currency_codestringyesAlways usd — subtotal, tax_amount and amount are in USD.
display_amountnumberyesThe same as amount, in USD (Clocknext converts no money).
display_currency_codestringyesAlways usd.
issued_atstringyesWhen the invoice was issued (ISO 8601).
paid_atstring | nullyesWhen it was paid. Null until then.
voided_atstring | nullyesWhen it was voided. Null unless it was.

package.ended POST

Triggered when a package ends. `ended_reason` is `REMOVED`, `INVOICE_VOIDED` (its unpaid invoice was voided), `PLAN_CHANGED` or `SUBSCRIPTION_CANCELLED`.

invoice.paid POST

Triggered when an invoice is marked paid, by a payment recorded by hand or through a payment gateway.