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

List purchases

The workspace's purchases, newest first. Filter by customerId or status (COMPLETED, PENDING or CANCELLED). Paged with limit (at most 50) and cursor; see Paginating results. Any other parameter is a 400.

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

GET
/purchases

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Query Parameters

customerId?string

Restrict results to this customer.

status?string

Filter by status, by payment (case-insensitive). Any other value is a 400: "status must be COMPLETED, PENDING, or CANCELLED."

Value in"COMPLETED""PENDING""CANCELLED"
limit?integer

Rows on one page: default 50, maximum 50 (a bigger value is cut to 50). Zero, a negative number or a non-number is a 400.

Range1 <= value <= 50
Default50
cursor?string

Id to page after — the last id of the previous page.

Response Body

Purchases.

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*

One page of purchases.

Example Request
curl -X GET 'https://payments.clocknext.com/api/v1/purchases?customerId=cus_abc123&status=PENDING&limit=50&cursor=cus_zzz789'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Request processed successfully."  },  "result": {    "purchases": [      {        "id": "cmvgvksil005p08l2ggbacq1l",        "purchaseNumber": "PUR-009",        "subscriptionNumber": "SUB-008",        "customerId": "cmvgva5po000c07iir1vtn8vl",        "customerName": "Northwind Traders",        "customerLogoUrl": "https://img.logo.dev/northwindtraders.com?token=pk_XyJ5Zd6NSUexPIq3rDQr4A&size=128&format=png&retina=true",        "planId": "cmvgvgfob001m08l2upi4aokj",        "planName": "Starter",        "planType": "BUNDLE",        "hasWallet": true,        "hasCredit": true,        "hasOutcome": false,        "hasUnit": true,        "hasComposite": false,        "billingCycle": "MONTHLY",        "cost": 29,        "currencyCode": "USD",        "billingDate": "2026-10-20T00:00:00.000Z",        "nextBillingDate": "2026-11-20T00:00:00.000Z",        "status": "CANCELLED",        "voidAfterMinutes": 52560000,        "autoPayment": false,        "autoPaymentPauseReason": null,        "notes": null,        "createdAt": "2026-10-20T16:05:59.517Z"      },      {        "id": "cmvgvkq9x004r08l28dpahwhv",        "purchaseNumber": "PUR-007",        "subscriptionNumber": "SUB-006",        "customerId": "cmvgvklx5002f08l2875y93k8",        "customerName": "Litware Inc",        "customerLogoUrl": null,        "planId": "cmvgvgfob001m08l2upi4aokj",        "planName": "Starter",        "planType": "BUNDLE",        "hasWallet": true,        "hasCredit": true,        "hasOutcome": false,        "hasUnit": true,        "hasComposite": false,        "billingCycle": "MONTHLY",        "cost": 29,        "currencyCode": "USD",        "billingDate": "2026-10-20T00:00:00.000Z",        "nextBillingDate": "2026-11-20T00:00:00.000Z",        "status": "COMPLETED",        "voidAfterMinutes": 52560000,        "autoPayment": false,        "autoPaymentPauseReason": null,        "notes": null,        "createdAt": "2026-10-20T16:05:56.613Z"      },      {        "id": "cmvgvkptw004i08l2d8vveucu",        "purchaseNumber": "PUR-006",        "subscriptionNumber": "SUB-005",        "customerId": "cmvgv9650000407iigjb3lt2p",        "customerName": "Adventure Works",        "customerLogoUrl": null,        "planId": "cmvgvg38w001808l2j7k6ykx3",        "planName": "Growth (6-month)",        "planType": "BUNDLE",        "hasWallet": false,        "hasCredit": true,        "hasOutcome": true,        "hasUnit": false,        "hasComposite": true,        "billingCycle": "SEMI_ANNUAL",        "cost": 2400,        "currencyCode": "USD",        "billingDate": "2026-11-03T00:00:00.000Z",        "nextBillingDate": "2026-11-03T00:00:00.000Z",        "status": "PENDING",        "voidAfterMinutes": 52560000,        "autoPayment": false,        "autoPaymentPauseReason": null,        "notes": "Starts after onboarding",        "createdAt": "2026-10-20T16:05:56.037Z"      },      {        "id": "cmvgvkp6r004a08l22itk1bh6",        "purchaseNumber": "PUR-005",        "subscriptionNumber": null,        "customerId": "cmvgv9elh000807iixkqqodos",        "customerName": "Wingtip Labs",        "customerLogoUrl": null,        "planId": "cmvgvg2dn000n08l23x83smgo",        "planName": "Free",        "planType": "BUNDLE",        "hasWallet": true,        "hasCredit": true,        "hasOutcome": false,        "hasUnit": true,        "hasComposite": false,        "billingCycle": "FREE",        "cost": 0,        "currencyCode": "USD",        "billingDate": "2026-10-20T00:00:00.000Z",        "nextBillingDate": "2026-10-20T00:00:00.000Z",        "status": "COMPLETED",        "voidAfterMinutes": 52560000,        "autoPayment": false,        "autoPaymentPauseReason": null,        "notes": null,        "createdAt": "2026-10-20T16:05:55.203Z"      },      {        "id": "cmvgvko9x003n08l2m19o4vgs",        "purchaseNumber": "PUR-003",        "subscriptionNumber": "SUB-003",        "customerId": "cmvgv9dyg000607ii9z6oghzf",        "customerName": "Fabrikam Analytics",        "customerLogoUrl": null,        "planId": "cmvgvg3iy001e08l2v6t2frb0",        "planName": "Scale (pay as you go)",        "planType": "BUNDLE",        "hasWallet": true,        "hasCredit": true,        "hasOutcome": true,        "hasUnit": true,        "hasComposite": true,        "billingCycle": "QUARTERLY",        "cost": 1000,        "currencyCode": "USD",        "billingDate": "2026-10-20T00:00:00.000Z",        "nextBillingDate": "2027-01-20T00:00:00.000Z",        "status": "COMPLETED",        "voidAfterMinutes": 52560000,        "autoPayment": false,        "autoPaymentPauseReason": "Card expired — waiting on a replacement",        "notes": null,        "createdAt": "2026-10-20T16:05:54.021Z"      },      {        "id": "cmvgvknlz003408l21rnqtsl2",        "purchaseNumber": "PUR-002",        "subscriptionNumber": "SUB-002",        "customerId": "cmvgv9th0000a07iisl2s8u6q",        "customerName": "Contoso Pharmaceuticals",        "customerLogoUrl": null,        "planId": "cmvgvgg51001s08l2gb0zp7wp",        "planName": "Enterprise",        "planType": "BUNDLE",        "hasWallet": true,        "hasCredit": true,        "hasOutcome": true,        "hasUnit": true,        "hasComposite": true,        "billingCycle": "YEARLY",        "cost": 60000,        "currencyCode": "USD",        "billingDate": "2026-10-20T00:00:00.000Z",        "nextBillingDate": "2027-10-20T00:00:00.000Z",        "status": "COMPLETED",        "voidAfterMinutes": 52560000,        "autoPayment": false,        "autoPaymentPauseReason": null,        "notes": "Signed MSA 2026-10",        "createdAt": "2026-10-20T16:05:53.160Z"      }    ],    "nextCursor": null  }}

Types

Every object type on this page, with its fields.

Purchase

FieldTypeRequiredDescription
idstringyesThe purchase's id.
purchaseNumberstringyesThe workspace's reference for the purchase, such as PUR-042.
subscriptionNumberstring | nullyesThe subscription's reference. null on a FREE plan and on older purchases.
customerIdstringyesThe id of the customer who holds the purchase.
customerNamestringyesThe customer's name.
customerLogoUrlstring | nullyesThe customer's logo URL. It can be a data: URL. null when no logo is set.
planIdstring | nullyesThe id of the plan bought. null when that plan was deleted later.
planNamestringyesThe plan's name, saved when the purchase was created.
planType"WALLET" | "BUNDLE"yesBUNDLE when the plan has credit, outcome or composite lines, else WALLET. Saved at purchase.
hasWalletbooleanyesWhether the plan has a wallet line. Read from the plan as it is now. false when the plan was deleted.
hasCreditbooleanyesWhether the plan has a credit line. Read from the plan as it is now. false when the plan was deleted.
hasOutcomebooleanyesWhether the plan has an outcome line. Read from the plan as it is now. false when the plan was deleted.
hasUnitbooleanyesWhether the plan has a unit line. Read from the plan as it is now. false when the plan was deleted.
hasCompositebooleanyesWhether the plan has a composite line. Read from the plan as it is now. false when the plan was deleted.
billingCycle"MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "YEARLY" | "FREE"yesThe plan's billing cycle, saved when the purchase was created.
costnumberyesThe pay-in-advance price of one cycle in USD, saved at purchase. 0 on a FREE plan; usage is billed apart.
currencyCodestringyesThe currency the plan's price was set in, for display. cost stays in USD.
billingDatestringyesThe purchase's billing date, as set when it was created.
nextBillingDatestringyesWhen the next billing period starts. Before the plan starts, when its first period starts.
status"COMPLETED" | "PENDING" | "CANCELLED"yesCOMPLETED, PENDING or CANCELLED, by payment.
voidAfterMinutesintegeryesMinutes an unpaid renewal invoice stays open before it is voided.
autoPaymentbooleanyesWhen true, invoices from the second cycle on are charged to the saved card.
autoPaymentPauseReasonstring | nullyesThe pauseReason sent when auto-payment was paused. null while it is on.
notesstring | nullyesA free note saved on the purchase. null when none was given.
createdAtstringyesWhen the purchase was created.

Update a tax PATCH

Updates only the fields you send. Archived taxes can be edited and stay archived. Invoices already issued keep the tax they were issued with. Renaming onto another active tax in the same country is a `409`.

Create a purchase POST

Subscribes a customer to a plan. It is `PENDING` with a first invoice (`invoice.payUrl`) and starts once that is paid. With `autoPayment: true` the balance, then the saved card, pay it. A FREE plan starts at once. It replaces any current plan without credit; for credit, [change plan](/docs/api-reference/plan-changes/createPlanChange).