Cancel a purchase
Cancels the purchase now: it becomes CANCELLED, its OPEN invoices are voided, and usage not billed yet gets a final invoice. This also completes a subscription marked for cancellation. A purchase already cancelled answers 200 again. To cancel at the period end, use Cancel a subscription.
Base URL https://payments.clocknext.com/api/v1
apiKeyAuthorizationBearer <cnk_…>Organisation-scoped key from Settings → API Keys.
id*stringPurchase id.
application/json- body
reason?stringWhy it is cancelled.
length <= 200Purchase cancelled.
application/json- response
statusCode*integerThe 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 result of the cancellation.
curl -X POST 'https://payments.clocknext.com/api/v1/purchases/pur_ghi789/cancel' \ -H 'Content-Type: application/json' \ -d '{ "reason": "Created by mistake — customer stays on Pro"}'{ "statusCode": 200, "statusDetail": { "status": "SUCCESS", "message": "Purchase cancelled." }, "result": { "cancelled": true }}Update a purchase's auto-payment setting PATCH
Previous Page
Create a checkout POST
Returns a link (`url`, valid 24 hours) for a customer to buy a plan on a secure payment page, then sends them to `returnUrl`. **Nothing changes until they pay.** Act on the `subscription.activated` webhook, not the redirect. A plan with nothing to pay is switched at once (`200`, `status: SWITCHED`).