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

Get a purchase

One purchase. status is by payment (COMPLETED, PENDING or CANCELLED); lifecycleStatus says whether the plan has started.

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

GET
/purchases/{id}

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

id*string

Purchase id.

Response Body

Purchase detail.

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

Example Request
curl -X GET 'https://payments.clocknext.com/api/v1/purchases/pur_ghi789'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Request processed successfully."  },  "result": {    "purchase": {      "id": "cmvgvknlz003408l21rnqtsl2",      "purchaseNumber": "PUR-002",      "subscriptionNumber": "SUB-002",      "status": "COMPLETED",      "lifecycleStatus": "ACTIVE",      "cost": 60000,      "billingCycle": "YEARLY",      "planName": "Enterprise",      "billingDate": "2026-10-20T00:00:00.000Z",      "nextBillingDate": "2027-10-20T00:00:00.000Z",      "createdAt": "2026-10-20T16:05:53.160Z",      "createdByName": "Josewin D D",      "customer": {        "id": "cmvgv9th0000a07iisl2s8u6q",        "name": "Contoso Pharmaceuticals",        "logoUrl": null      },      "voidAfterMinutes": 52560000,      "autoPayment": false,      "autoPaymentPauseReason": null,      "autoPaymentPausedAt": null,      "notes": "Signed MSA 2026-10",      "plan": {        "id": "cmvgvgg51001s08l2gb0zp7wp"      },      "stats": {        "invoiceCount": 1,        "paidCount": 1      }    }  }}

Types

Every object type on this page, with its fields.

PurchaseDetail

FieldTypeRequiredDescription
idstringyesThe purchase's id.
purchaseNumberstringyesThe workspace's reference for the purchase, such as PUR-042.
subscriptionNumberstring | nullnoThe subscription's reference. null on a FREE plan and on older purchases.
status"COMPLETED" | "PENDING" | "CANCELLED"yesCOMPLETED, PENDING or CANCELLED, by payment.
lifecycleStatus"SCHEDULED" | "ACTIVE" | "CANCELLED"yesWhether the plan has started: SCHEDULED until it starts, then ACTIVE; CANCELLED once cancelled.
costnumberyesThe pay-in-advance price of one cycle in USD, saved at purchase. 0 on a FREE plan; usage is billed apart.
billingCycle"MONTHLY" | "QUARTERLY" | "SEMI_ANNUAL" | "YEARLY" | "FREE"yesThe plan's billing cycle, saved when the purchase was created.
planNamestringyesThe plan's name, saved when the purchase was created.
billingDatestringyesThe purchase's billing date, as set when it was created. It does not move forward from cycle to cycle.
nextBillingDatestringyesWhen the next billing period starts. Before the plan starts, when its first period starts.
createdAtstringyesWhen the purchase was created.
createdByNamestringnoWho created it: the member's name or email. Through the API: the API key's creator.
customerobjectnoThe customer who holds the purchase.
voidAfterMinutesintegernoMinutes an unpaid renewal invoice stays open before it is voided.
autoPaymentbooleannoWhen true, invoices from the second cycle on are charged to the saved card.
autoPaymentPauseReasonstring | nullnoThe pauseReason sent when auto-payment was paused. null while it is on.
autoPaymentPausedAtstring | nullnoWhen auto-payment was last paused. null while auto-payment is on, or when it was never paused.
notesstring | nullnoA free note saved on the purchase. null when none was given.
planobject | nullnoThe plan this purchase was made from. null when that plan was deleted later.
statsobjectnoInvoice counts for this purchase.

PurchaseDetail.customer

The customer who holds the purchase.

FieldTypeRequiredDescription
idstringyesThe customer's id.
namestringyesThe customer's name.
logoUrlstring | nullyesThe customer's logo URL. It can be a data: URL. null when no logo is set.

PurchaseDetail.plan

FieldTypeRequiredDescription
idstringyesThe plan's id.

PurchaseDetail.stats

Invoice counts for this purchase.

FieldTypeRequiredDescription
invoiceCountintegernoHow many invoices the purchase raised, of every status.
paidCountintegernoHow many of the purchase's invoices are PAID.

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

Update a purchase's auto-payment setting PATCH

Next Page