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

refund.created POSTrefund.succeeded POSTrefund.failed POST

Customer Portal

Mint a customer-portal access token POST
Refund

refund.created

Triggered when a card refund is asked of the payment gateway, for a credit note or from the invoice balance. The money is not on the card yet: wait for refund.succeeded. A refund split over 2 card payments triggers 2 events.

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 refund.created.

triggered_at*string

When the event was triggered (ISO 8601).

Formatdate-time
data*

The customer, the refund, its invoice and its credit note.

Response Body

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

Example Requests
POST/refund.created
Request Body
application/json
{  "id": "evt_b5230214e5aec0f45c2a570efd3aa8ec",  "event_type": "refund.created",  "triggered_at": "2026-11-16T09:20:01.000Z",  "data": {    "customer": {      "id": "cus_9",      "name": "Acme"    },    "refund": {      "id": "re_1",      "status": "PENDING_AT_GATEWAY",      "gateway": "STRIPE",      "gateway_refund_id": null,      "amount": 118,      "currency_code": "usd",      "charged_amount_minor": 985000,      "charged_currency_code": "inr",      "reason": "Duplicate charge",      "failure_reason": null,      "created_at": "2026-11-16T09:20:01.000Z",      "settled_at": null    },    "invoice": {      "id": "inv_42",      "number": "INV-0042",      "subscription_id": "pur_9"    },    "credit_note": {      "id": "cn_1",      "number": "CN-007"    }  }}
Header Parameters
{  "X-Clocknext-Signature": "t=1791367200,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd",  "X-Clocknext-Event-Id": "evt_b5230214e5aec0f45c2a570efd3aa8ec",  "X-Clocknext-Event-Type": "refund.created"}

Types

Every object type on this page, with its fields.

RefundCreatedEvent

FieldTypeRequiredDescription
idstringyesevt_ + 32 hex characters. Unique per event, and the same on every retry of it — use it to skip duplicates.
event_typestringyesAlways refund.created.
triggered_atstringyesWhen the event was triggered (ISO 8601).
dataRefundEventDatayesThe customer, the refund, its invoice and its credit note.

RefundEventData

The data object of a refund.created, refund.succeeded or refund.failed event: the customer, the refund, the invoice whose card payment it refunds, and its credit note.

FieldTypeRequiredDescription
customerWebhookCustomeryesThe customer the event is about.
refundWebhookRefundyesThe refund when the event is triggered.
invoiceWebhookRefundInvoiceyesThe invoice whose card payment is refunded.
credit_noteWebhookCreditNoteRef | nullyesThe credit note that asked for the refund. Null for a refund from the invoice balance.

WebhookCustomer

The customer the event is about.

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

WebhookRefund

Money that goes back to a card, for one card payment. amount is in USD; charged_amount_minor is what goes back, in the currency the card was charged in. New values can be added to status and gateway.

FieldTypeRequiredDescription
idstringyesThe refund's id.
status"PENDING_AT_GATEWAY" | "SUCCEEDED" | "FAILED" | "REJECTED_IN_GATEWAY_REVIEW"yesPENDING_AT_GATEWAY in refund.created, SUCCEEDED in refund.succeeded, else refund.failed.
gateway"STRIPE" | "PADDLE"yesThe payment gateway that refunds the card.
gateway_refund_idstring | nullyesThe gateway's refund id (Paddle's adjustment id). Always null in refund.created.
amountnumberyesThis refund's amount, in USD.
currency_codestringyesAlways usd — amount is in USD.
charged_amount_minorinteger | nullyesWhat goes back to the card, in minor units of charged_currency_code. Null only on old refunds.
charged_currency_codestring | nullyesThe currency the card was charged in, lowercase (ISO 4217). Null with charged_amount_minor.
reasonstring | nullyesThe credit note's reason, or the reason given with a refund from the invoice balance.
failure_reasonstring | nullyesWhy it failed, as stored. Null outside refund.failed, and when the gateway gave no reason.
created_atstringyesWhen the refund was asked of the gateway (ISO 8601).
settled_atstring | nullyesWhen the refund got its last final status (ISO 8601). Null in refund.created.

WebhookRefundInvoice

The invoice whose card payment is refunded.

FieldTypeRequiredDescription
idstringyesThe invoice's id.
numberstringyesThe invoice's number.
subscription_idstring | nullyesThe subscription's purchase id. Null when the invoice belongs to no subscription.

WebhookCreditNoteRef

The credit note that asked for the refund.

FieldTypeRequiredDescription
idstringyesThe credit note's id.
numberstringyesThe credit note's number.

credit_note.voided POST

Triggered when a credit note is voided while its invoice is still open. The invoice owes the amount again, and `invoice.credit_notes_amount` no longer counts the note.

refund.succeeded POST

Triggered when the payment gateway confirms a card refund. Only this event means the money reached the card. A `refund.failed` can still follow if the gateway reverses it later.