Skip to Content
Payrudder

Webhooks

Every event Payrudder sends, the payload envelope, how to verify a signature, and how retries and ordering work.

Webhooks tell your systems what happened in Payrudder without polling: an invoice was paid, a subscription changed, a customer was blocked. Register an endpoint, pick the events you want, verify each delivery, and answer 2xx.

Register an endpoint

Create the endpoint

POST /v1/webhook-endpoints, or the console's Webhooks tab. Each endpoint has a URL, an optional description and the event types it wants (none ticked: every type). A tenant can register up to 20 endpoints.

Store the signing secret

The create response carries the signing secret (whsec_...) once. It is stored sealed and cannot be read back, only rotated.

Send a test event

POST /v1/webhook-endpoints/{id}/test sends a ping event. Its data is {"message": "This is a test event from Payrudder."} and it cannot be subscribed to.

The URL must be https://, must not carry credentials and must resolve to a public address. The check is made when the connection is opened, after DNS, so a name that points inward (or changes its answer) is refused. Redirects are not followed and no proxy is used.

To receive events on your own machine during development, see Local webhooks.

Rotate the secret

POST /v1/webhook-endpoints/{id}/rotate-secret returns the new secret once. The old one keeps signing for 24 hours, so a receiver can switch without losing a delivery.

The payload

A delivery is a JSON POST:

invoice.paid
{
  "id": "0192...",
  "type": "invoice.paid",
  "created": "2026-10-20T10:00:00Z",
  "tenant_id": "0192...",
  "data": {
    "invoice_id": "...",
    "number": "INV-2026-000007",
    "total_minor": "1116",
    "tax_minor": "186",
    "net_minor": "930",
    "environment": "live",
    "status": "paid"
  }
}
idstring

The event id. Use it to ignore a repeat.

typestring

The event type, from the catalogue below.

createdstring

When the event happened, second precision, UTC.

tenant_idstring

Your tenant.

dataobject

The event's own fields. The machine-readable shape of every data is in the API reference (WebhookEvent, one schema per type).

The body is exactly these five fields; there is no API version field. Money is a string of minor units, as in the REST API. The credit counts of credits.* events (credits, bonus_credits, balance, threshold, and credits of payment_link.created) are JSON numbers.

Events are delivered at least once and not in order. Use id to ignore a repeat, and fetch the object from the API when you need its present state.

Verify a delivery

Every delivery carries these headers:

Payrudder-Signature: t=1700000000,v1=<hex>[,v1=<hex>]
Payrudder-Event-Id: <id>
Payrudder-Event-Type: <type>
Payrudder-Delivery-Attempt: <n>

Each v1 is HMAC-SHA256(secret, "<t>.<raw body>") in hex. There are two while a rotated secret is still accepted.

  • Compute it over the raw bytes, before you parse the JSON.
  • Compare in constant time.
  • Reject a t more than five minutes from your clock.
# A delivery carries Payrudder-Signature: t=<unix time>,v1=<hex>. The hex is HMAC-SHA256 of "<t>.<raw body>" under your endpoint's secret.
# Check it on the raw body before parsing; the SDKs do it for you (see the other tabs).

Delivery and retries

Answer 2xx within 10 seconds. Anything else (a status, a timeout, a refused connection) is retried after:

AttemptDelay after the previous one
21 minute
35 minutes
430 minutes
52 hours
66 hours
724 hours

After the seventh attempt the delivery is failed.

  • GET /v1/webhook-deliveries (filter with endpoint_id) shows each delivery with its attempts and the last answer.
  • POST /v1/webhook-deliveries/{id}/redeliver sends one again from the start.
  • A paused endpoint (active: false) receives nothing new.
  • Deliveries and events are kept for 30 days.

A tenant the operator has suspended, frozen or banned sends no webhooks. Its deliveries wait (without using up an attempt, for up to the 30 days events are kept) and go out when the tenant is reinstated.

Event catalogue

Invoices and credit notes

TypeWhendata
invoice.finalizedan invoice gets its numberinvoice_id, number, customer_id, customer_external_id, period_id, currency, total_minor, status
invoice.paid, invoice.voided, invoice.uncollectiblethe invoice reaches that statethe same, plus environment (sandbox or live; invoice.finalized does not carry it). invoice.paid also has tax_minor and net_minor (the total less its TAX lines: what a partner commission is a share of), and, when the invoice came from a link that has an order_ref, order_ref and link_id (to match your order). status is paid, void (not voided) or uncollectible
credit_note.createda credit note is issuedcredit_note_id, number, invoice_id, invoice_number, customer_id, customer_external_id, currency, total_minor, tax_minor (the part of total_minor that is the invoice's tax given back; 0 when none), reason, disposition (credit/refund), and for a refund refund_state
credit_note.refunded, credit_note.refund_failedthe provider settled (or refused) a refund to the card, or an operator confirmed after checking at the provider that a refund of unknown outcome was madethe same, with the outcome (refund_error on failure)

Subscriptions

subscription is the subscription as the API returns it, but without the fields at their zero value (an empty string, 0, false and an unset time are left out). scheduled_change and coupon_code are only on subscription.created, subscription.changed and subscription.change_scheduled.

TypeWhendata
subscription.createda subscription is createdsubscription
subscription.changeda plan or interval change took effect (now, or at the end of the period)subscription (the new one), previous_subscription_id, quote; a change that was scheduled and applied at the end of the period has scheduled: true and no quote
subscription.change_scheduleda change was set for the end of the periodsubscription, quote
subscription.cancelledit ended now (credited_minor, a string, when the unused fee was credited). A cancellation with a future end_time is subscription.cancellation_scheduled; nothing is sent when that day arrivessubscription
subscription.cancellation_scheduled, subscription.cancellation_withdrawncancel at period end was set / taken backsubscription
subscription.paused, subscription.resumedthe subscription was paused / resumedsubscription
subscription.moved_to_providera provider migration took oversubscription, previous_subscription_id, to_provider
subscription.trial_will_enda trial ends in 3 days or fewer; once per trial end: an extended or restarted trial is announced again, a plan change that keeps the trial end is not. Not sent for a subscription a provider runs, or one that is paused or set to cancelsubscription (its trial_end_time says when)
subscription.updatedthe seller ended a running trial early (POST /v1/subscriptions/{id}/end-trial): the subscription is active and its first fee is due now. A trial that runs to its end sends nothingsubscription
TypeWhendata
payment_link.createda payment link was made (not the invoice links an ad-hoc link hands out)link_id, kind (invoice, adhoc or credit_pack), single_use, expires_at; when set: invoice_id, amount_minor, currency, description, customer_external_id, and for a credit pack pack_id, quantity, credits
payment_link.paidan invoice was paid through the link (once per link and invoice)link_id, kind, invoice_id, invoice_number, customer_external_id, currency, total_minor, paid_count; when the link has an order_ref: order_ref
payment_link.expiredthe link expired unpaid (a single-use link that was paid is used, not expired)link_id, kind, expires_at; when set: invoice_id, amount_minor, currency, customer_external_id
payment.disputeda customer questioned a payment with their bank, or the case moved on or ended (see below)invoice_id, invoice_number, customer_external_id, provider, dispute_id (the provider's reference of the case, the same in every event about it), payment_ref, amount_minor (a string), currency, outcome (open, won or lost), formal (true for a chargeback, which takes the money back; false for an inquiry or a warning), reason (the cardholder's, in the provider's words; may be empty), provider_status; when the provider gives a date: evidence_due_time

Credits

TypeWhendata
credits.purchaseda credit pack was paid and its credits granted (once per paid invoice)customer_id, customer_external_id, credits (the pack's and the bonus of a coupon, in one lot), bonus_credits (the part a coupon added, 0 without one), quantity, balance (spendable after the grant), pack_id, pack_name, link_id, invoice_id, invoice_number, currency, amount_minor, expires_at (absent when they never expire)
credits.lowa consume took a customer's balance from at least the tenant's threshold (PUT /v1/credits/settings, default off) to below it; once per crossingcustomer_id, customer_external_id, balance, threshold

Contracts

TypeWhendata
contract.accepteda customer accepted one or more agreements together (a hosted payment page, or your server through POST /v1/customers/{external_id}/contract-acceptances): one event for the group, not for each versiongroup_id, source (hosted, api), accepted_at, snapshot_sha256, items (acceptance_id, kind, audience, version_id, version, sha256, locale), immediate_start_consent, withdrawal_waiver_acknowledged, context (kind, ref); customer_id and customer_external_id unless it was a guest payment
contract.version_publisheda new version of an agreement was published (POST /v1/contracts/versions)version_id, kind, audience, number, material, sha256, locales, published_at
contract.withdrawal_requesteda customer's withdrawal statement was recorded (POST /v1/customers/{external_id}/contract-withdrawals)withdrawal_id, customer_id, customer_external_id, subscription_id, invoice_id (the last two may be empty), source, received_at
contract.withdrawal_decidedthe seller accepted or rejected a withdrawal, or marked an accepted one refunded (PUT /v1/contract-withdrawals/{id}/status). The refund a decision to accept asks of billing is announced by credit_note.createdwithdrawal_id, customer_id, customer_external_id, subscription_id, invoice_id (the last two may be empty), status, decided_by, decided_at, note

Plans, customers and entitlements

TypeWhendata
plan.createda plan was created (POST /v1/plans)plan, exactly as the API returns it (every field present, latest_version 0)
plan.version_publisheda version of a plan was published (POST /v1/plans/{code}/versions)plan_version, exactly as the API returns it (every field present)
customer.blockeda customer was blocked (POST /v1/customers/{external_id}/block); blocking one who is blocked already sends nothingcustomer_id, customer_external_id, category (fraud, chargeback, abuse, request, other or empty), reason (the seller's own note), blocked_until (RFC 3339) when the block ends by itself, and suspend_service (true when the block also suspended the customer's service; absent on an event queued before the field existed)
customer.unblockeda block was lifted (POST /v1/customers/{external_id}/unblock), or ran out by itself (blocked_until passed): a sweep that runs every few minutes clears it and sends the event, so it can come minutes after the endcustomer_id, customer_external_id
entitlement.updatedwhat a customer may use of a meter changed: a subscription was created, changed, cancelled, paused or resumed, its trial was ended early, an entitlement override was set or deleted, a block that suspends the service started or was lifted, or the customer reached a limit (a threshold of 100% or more crossed). Use it to drop a cached entitlement; one event per customer and meter in a transactioncustomer_external_id, meter_code (empty: every meter of the customer)

Price changes and campaigns

TypeWhendata
price_change.scheduleda run of a price change (POST /v1/plans/{code}/price-changes, or POST /v1/price-changes/{id}/retry) scheduled at least one subscription; once per run, not for a dry run. Each subscription also sends subscription.change_scheduledprice_change (as GET /v1/price-changes/{id} returns it, without the fields at their zero value: id, plan_code, from_version, to_version, notice_days, effective_time, state, created_by, create_time and the counts scheduled, applied, withdrawn, skipped), scheduled and skipped (what that run did)
campaign.starteda campaign's window opened (start_time passed; POST /v1/campaigns). A sweep that runs every minute sends it, so it can come up to a minute late, and once per campaignpromotion_code (the campaign's code, as GET /v1/promotion-codes returns one, with automatic and start_time) and coupon (as GET /v1/coupons returns one)
campaign.endeda campaign's window closed (expire_time passed) or it was ended early (DELETE /v1/campaigns/{code}); sent by the same sweep, once per campaignpromotion_code and coupon, as for campaign.started

Two kinds of page you can hand to a customer without building one. The full flow is in Accept payments.

Only the provider's confirmed notification marks an invoice paid. The browser's return from a checkout shows the state and settles nothing. Wait for invoice.paid before you fulfil an order.

  • A link-collected invoice waits for the customer: no stored method is charged, a decline is the customer's to retry, and there is no dunning.
  • An invoice in dunning can be paid through its link too; invoices the dunning gave up on cannot.
  • The public pages (/i/{token}, /c/{token}) have the same headers and 60 requests a minute as the invoice page, 10 a minute for the requests that start a payment.

Next steps