Documentation
Webhooks
Register endpoints that receive signed notifications when wallets, customers, subscriptions, invoices, payments, credit notes and refunds change.
Webhooks lets your own backend hear about changes as they happen. You register an endpoint — a URL on your side — and pick which events it receives. Clocknext then POSTs a signed JSON message to that URL every time one of those events is triggered, and keeps a log of every delivery attempt so you can see what was sent, what your server answered, and retry anything that failed.
The events are in seven groups:
| Group | Events |
|---|---|
| Wallet | wallet.balance.update, wallet.balance.drop |
| Customer | customer.created, customer.updated, customer.archived, customer.restored |
| Subscription | subscription.created, subscription.activated, subscription.renewed, subscription.on_hold, subscription.resumed, subscription.cancellation_scheduled, subscription.cancelled |
| Invoice | invoice.created, invoice.paid, invoice.voided |
| Payment | payment.succeeded, payment.failed |
| Credit note | credit_note.created, credit_note.voided |
| Refund | refund.created, refund.succeeded, refund.failed |
For when each event is triggered, see Events.
Not triggered by usage signals
wallet.balance.update isn't triggered when a usage signal charges the
wallet. To read a balance, call
Get a customer's balances.
wallet.balance.drop is still triggered when a signal takes the balance to
the low-balance threshold.
Each event's payload is on its page in the API reference; for the headers and how to verify the signature, see Webhooks.
What you can do here
- Add an endpoint: a name, a URL, and the events it should receive.
- Set a threshold for
wallet.balance.drop, in USD or as a percentage of the plan's Wallet amount. - Copy or reveal an endpoint's signing secret, and rotate it.
- Edit an endpoint's name, URL, events and threshold.
- Disable an endpoint temporarily, or delete it.
- Browse each endpoint's delivery history, view the exact payload sent, and retry a failed delivery.
Owner or admin only
Adding, editing, disabling, deleting, rotating secrets, revealing secrets, and retrying deliveries are available to owners and admins. Members can see the endpoints but not change them.
On this page
Endpoints list
A table of every endpoint in the workspace, one row per endpoint, with its Name and Webhook URL. A Disabled badge marks endpoints that are switched off. Click a row to open its detail page. The ⋯ menu on each row holds:
- Edit — change the name, URL or events.
- Disable Endpoint / Enable Endpoint — pause or resume deliveries.
- Rotate secret — issue a new signing secret.
- Delete — remove the endpoint.
With no endpoints yet, the page shows an empty state and an Add webhook button.
Add / edit webhook
A dialog with these parts:
- Name — give it a name.
- Webhook URL — where to POST events. Must start with
http://orhttps://. - Events — one row per group (Wallet, Customer, Subscription, Invoice,
Payment, Credit note, Refund), with how many of its events are ticked (for
example
2 of 4). The Credit note and Refund groups start unticked, also on an endpoint that existed before them: tick them to get those events. Open a group to see its events, each with a checkbox and a short description. The checkbox on a group row ticks or clears every event in the group. Pick at least one event. Tickingwallet.balance.dropreveals a Threshold field with a unit dropdown (USD or Percentage (%)). The threshold is required for that event: 0 or more in USD, between 0 and 100 as a percentage.
Endpoint detail (/settings/webhooks/[id])
- The endpoint's Name, with an edit button and a Disabled badge when it's off. Endpoints created before names existed show "—".
- A Failing since notice when the most recent deliveries have been failing — it shows when the current run of failures started and disappears after the next successful delivery.
- Signing Secret — masked as
whsec_••••plus its last four characters. Use the eye button to reveal the full value and the copy button to copy it. - Subscribed events — the events this endpoint receives; the threshold is
shown next to
wallet.balance.drop(e.g.wallet.balance.drop · $50, orwallet.balance.drop · 10%for a percentage). - Message Attempts — the delivery history (below).
Message Attempts
One row per delivery attempt, newest first, filterable by All, Success, or Failed, with Load more for older rows.
| Column | Shows |
|---|---|
| Timestamp | When the attempt was made, to the millisecond. |
| Event Type | The event name, with · attempt N when this was a retry. |
| Message ID | The event's evt_… id. It's the same on every retry of one event. |
| Status | Success (your server answered 2xx) or Failed (anything else, or no answer). |
| Action | Raw data shows the exact JSON body sent. Retry (failed rows only) sends it again. |
Adding an endpoint
- Press Add webhook.
- Give it a Name.
- Enter your Webhook URL, e.g.
https://your.app/webhooks/clocknext. - Tick the events you want: a whole group, or single events inside an open
group. For
wallet.balance.drop, enter the Threshold and choose its unit, USD or Percentage (%). - Press Add webhook.
- The Your signing secret dialog shows the endpoint's secret (it starts
with
whsec_). Copy it into your server's configuration — you need it to verify that messages really come from Clocknext. You can also reveal it later from the endpoint's detail page.
How the low-balance threshold works
wallet.balance.drop uses two thresholds, and the customer's own comes first:
- The customer has their own threshold — set on the customer's Manage tab (see Wallet) or with the API. Only that threshold is used: one event goes to every endpoint subscribed to it, whatever each endpoint's own threshold is.
- The customer has none — each endpoint uses its own threshold, and each is triggered on its own crossing.
A threshold, a customer's or an endpoint's, is either an amount in USD or
a percentage (0 to 100) of the plan's Wallet amount per cycle. On a plan
that gives $100 a cycle, a 10% threshold is $10. The event then carries
threshold_percentage in place of threshold. A percentage applies to
advance-billed wallets only: with arrear billing, or no active plan Wallet
amount, a percentage threshold sends nothing.
Either way it is triggered when a single balance change takes the wallet from above the threshold to at or below it, once per drop — not on every charge while the balance stays low, and again only after the balance goes back above the threshold and drops again.
Managing an endpoint
- Edit — change the name, the URL, the selected events and the threshold. The new event list replaces the old one.
- Disable Endpoint — stops deliveries. Events that happen while it's disabled are not sent, and are not sent later when you re-enable it. Enable Endpoint resumes deliveries. The Failing since notice goes away once a delivery to the endpoint succeeds.
- Rotate secret — issues a new secret and shows it in the Your signing secret dialog. Every delivery from that moment on, including retries, is signed with the new secret, so update your server straight away.
- Delete — after confirming, removes the endpoint and its secret. This can't be undone. Clocknext keeps its delivery history for 90 days.
- Retry — on a failed row in Message Attempts, sends the same payload (same Message ID) again. The new attempt shows as a new row within half a minute.
Related
- Webhooks in the API reference — events, payloads, headers, and signature verification.
- Customer detail — a customer's wallet balance, subscriptions and invoices.
- API Keys — the key your backend uses to call the Clocknext API.