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 plan change

One plan change: its status, the days, the credit and charge it worked out, the credit note and invoice it made, and the new purchase.

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

GET
/plan-changes/{id}

Authorization

apiKey
headerAuthorizationBearer <cnk_…>

Organisation-scoped key from Settings → API Keys.

Path Parameters

id*string

Plan change id.

Response Body

The plan change.

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 data of the answer.

Example Request
curl -X GET 'https://payments.clocknext.com/api/v1/plan-changes/cmvgwf8ab000e08l5p1r6s4zc'
Example Response
{  "statusCode": 200,  "statusDetail": {    "status": "SUCCESS",    "message": "Request processed successfully."  },  "result": {    "planChange": {      "id": "cmvgwf8ab000e08l5p1r6s4zc",      "customerId": "cmvgva5po000c07iir1vtn8vl",      "status": "DONE",      "failureReason": null,      "effectiveDate": "2026-10-28",      "from": {        "purchaseId": "cmvgvkmxz002h08l2h2i1dnsr",        "planName": "Pro"      },      "to": {        "planId": "cmvgvgfob001m08l2upi4aokj",        "planName": "Starter",        "purchaseId": "cmvgwg2jx000d08l5c9m2w5ts"      },      "days": {        "inPeriod": 31,        "remaining": 22      },      "credit": {        "subtotalUsd": 379.81,        "taxUsd": 0,        "totalUsd": 379.81,        "creditNoteId": "cmvgwcm7e000e08l5a3x1v9ty"      },      "charge": {        "subtotalUsd": 22.07,        "invoiceId": "cmvgwg2kp000f08l5d7n3q8vx"      },      "createdAt": "2026-10-28T09:14:07.000Z",      "executedAt": "2026-10-28T09:14:09.000Z"    }  }}

Types

Every object type on this page, with its fields.

PlanChange

A move of a customer to another plan, with the unused time of the old plan credited.

FieldTypeRequiredDescription
idstringyesThe plan change's id.
customerIdstringyesThe customer.
status"IN_PROGRESS" | "DONE" | "FAILED"yesIN_PROGRESS while it runs (a retry finishes it), DONE when finished, FAILED with a failureReason.
failureReasonstring | nullyesWhy it failed. null unless FAILED.
effectiveDatestringyesThe day it took effect and the old plan ended, YYYY-MM-DD (UTC).
fromobjectyesThe plan that ended.
toobjectyesThe plan the customer moved to.
daysobjectyesDays of the old plan's period.
creditobjectyesWhat went to the invoice balance for the unused time. The amounts are null when nothing did.
chargeobjectyesWhat the new plan costs for the rest of the period.
createdAtstringyesWhen it was requested.
executedAtstring | nullyesWhen it finished. null until then.

PlanChange.from

The plan that ended.

FieldTypeRequiredDescription
purchaseIdstringyesIts purchase.
planNamestringyesIts name.

PlanChange.to

The plan the customer moved to.

FieldTypeRequiredDescription
planIdstring | nullyesIts id. null if the plan was deleted.
planNamestringyesIts name.
purchaseIdstring | nullyesIts purchase. null until it is made.

PlanChange.days

Days of the old plan's period.

FieldTypeRequiredDescription
inPeriodinteger | nullyesDays in the period.
remaininginteger | nullyesDays left unused.

PlanChange.credit

What went to the invoice balance for the unused time. The amounts are null when nothing did.

FieldTypeRequiredDescription
subtotalUsdnumber | nullyesThe credit before tax, in USD.
taxUsdnumber | nullyesThe tax given back, in USD.
totalUsdnumber | nullyesThe credit in total, in USD.
creditNoteIdstring | nullyesThe credit note that made it.

PlanChange.charge

What the new plan costs for the rest of the period.

FieldTypeRequiredDescription
subtotalUsdnumber | nullyesThe price before tax, in USD. null until worked out.
invoiceIdstring | nullyesThe new plan's first invoice. null when none.

Change a customer's plan POST

Moves a customer to another plan. The old plan ends today and its unused time is credited to the invoice balance. The new plan is invoiced and starts when that invoice is paid. Preview it first. With `autoPayment: true` the balance and saved card pay it.

List invoices GET

Newest first, paged with `limit` (at most 50) and `cursor` → `nextCursor` — see [Paginating results](/docs/api-reference/pagination). Any other query parameter is a `400` ("Unknown parameter `offset`.").