Webhooks
Event types
| Event | Emitted when |
|---|---|
customer.created · customer.updated · customer.deleted | Customer changes |
instrument.attached · instrument.detached | Instrument saved or removed |
enrollment.created · enrollment.updated · enrollment.failed | Hosted enrollment started, progressed, or failed |
subscription.created | Subscription created (before the first charge settles) |
subscription.updated | Update call, a status change from a charge outcome (e.g. → active, past_due, unpaid, incomplete_expired), or a renewal: a paid period moves current_period_start and current_period_end, even when the status stays active |
subscription.canceled | Actually canceled: immediately, when the period ends after cancel_at_period_end, or after retries when the exhaustion action is canceled. Scheduling a cancellation emits subscription.updated instead. |
subscription.paused · subscription.resumed | Pause, resume (manual, via update, or scheduled) |
subscription.trial_will_end | Once, when a trial is within 3 days of ending (payload is the full subscription) |
payment.review_required | A succeeded payment needs manual resolution: late settlement on an expired or canceled subscription, an agent anomaly (agent_anomaly), or an invoice that was voided or changed before money arrived (invoice_not_payable) |
payment.review_resolved | Merchant recorded the completed external refund/service disposition |
payment.succeeded | A charge succeeded (renewal, first payment, proration, standalone payment, or late confirmation) |
payment.failed | A charge was declined; includes retry_at (null for standalone payments) |
payment.expired | A payment the payer did not complete in time became expired (1 hour in test mode, 2 hours in live mode, counted from when it was sent to NETOPIA Payments); a later confirmation sends payment.succeeded or payment.failed |
payment.refunded | A succeeded payment was refunded (reported by NETOPIA Payments); the payment's amount_refunded grows and, once all of amount is refunded, its status becomes refunded and its invoice is voided (invoice.voided with reason: payment_refunded). A refund of only part of the amount leaves the payment succeeded and its invoice paid. A subscription is not changed by a refund |
checkout_session.completed · checkout_session.expired · checkout_session.canceled | A checkout session ended: its payment succeeded, it ran out of time, or it was canceled before payment. Sent once per session; the payload is the checkout session. Sessions also raise the usual payment.* events |
mandate.created · mandate.approved · mandate.revoked · mandate.exhausted · mandate.expired | A mandate was created, approved by the customer, revoked, exhausted (budget or payment count reached), or passed its expiry |
invoice.created | A draft receivable was created |
invoice.voided · invoice.marked_uncollectible | An unpaid invoice was voided, or given up on (it can still be paid) |
invoice.finalized · invoice.paid | An invoice was issued with its number; an invoice issued from a payment is issued already paid, so both arrive together |
invoice.payment_failed | The automatic charge of a charge_automatically invoice was declined; next_payment_attempt is when the next attempt is (null after the last one) and attempt_count how many were made |
domain.active · domain.failed | A domain became usable for Apple Pay, or stopped working (the payload is the domain, with last_error) |
invoice.overdue | An unpaid send_invoice invoice passed its due date (sent once) |
invoice.needs_details | An invoice you created is waiting for billing details; includes missing_fields (payload carries no billing details) |
invoice.email_bounced · invoice.email_complained | The invoice email did not arrive (the address does not exist or refused it), or the payer marked it as spam; email_status on the invoice changes to bounced or complained. The payload is the invoice plus email.kind; it carries no email address |
invoice.email_replied | The payer replied to an invoice email; the reply was forwarded to your issuer email address (the text is not stored) |
Delivery
Payware POSTs one JSON envelope per event to each matching endpoint:
{
"id": "01…",
"object": "event",
"type": "payment.succeeded",
"created": "2026-10-23T12:00:00.000Z",
"data": {
"object": { "object": "payment", "id": "01…", "subscription_id": "01…",
"amount": 4900, "currency": "RON", "status": "succeeded", "…": "…" }
}
}
ididentifies the logical event and is the same for every endpoint that receives it.data.objectis always the full API object: the subscription forsubscription.*, the customer forcustomer.*, the payment transaction forpayment.*, the instrument forinstrument.attached. Deletions (customer.deleted,instrument.detached) carry{ "object": "...", "id": "...", "deleted": true }.- Extra context sits next to
objectinsidedata:payment.failedaddsretry_at(the next attempt, ornullwhen retries are exhausted);instrument.detachedaddsreplacement_instrument_id.
Headers:
| Header | Value |
|---|---|
x-signature | t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>.<raw body>">, keyed with the endpoint secret |
x-event-type | e.g. payment.succeeded |
x-webhook-id | ID of this delivery (unique per endpoint); stable across retries |
Respond with any 2xx within 10 seconds. Anything else — a timeout, an
error, or a redirect (redirects are never followed) — is retried after 1 min, 5 min, 30 min, 2 h and
24 h; after the sixth attempt the delivery is marked failed. Delivery is at least once: dedupe on
id, and expect events to arrive out of order (trust the object's status and
current_period_end, not arrival order). Each retry is re-signed with a fresh timestamp.
Verifying the signature
import { createHmac, timingSafeEqual } from "node:crypto";
export const verify = (rawBody: string, header: string, secret: string, toleranceSeconds = 300) => {
const parts = Object.fromEntries(header.split(",").map((part) => part.trim().split("=") as [string, string]));
const timestamp = Number(parts.t);
if (!Number.isInteger(timestamp) || !parts.v1) return false;
if (Math.abs(Date.now() / 1000 - timestamp) > toleranceSeconds) return false; // replay protection
const expected = createHmac("sha256", secret).update(`${timestamp}.${rawBody}`).digest("hex");
return expected.length === parts.v1.length && timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
};
Compute it over the raw bytes you received, before JSON parsing. The timestamp is part of the signed data, so a captured request cannot be replayed outside the tolerance window.
Secrets and endpoint URLs
- Secrets are 256-bit random values (
whsec_+ 64 hex chars), returned at creation and on matching idempotency replays; normal endpoint reads omit them. To use a secret your receiver already holds, sendsecret(whsec_and 32 to 128 letters or digits) when you create the endpoint or rotate it. POST /v1/webhooks/:id/rotate-secretissues a new secret and returns it (including on matching idempotency replays); the old one stops working immediately, so update the receiver first or accept a short window of failures (failed deliveries are retried and re-signed with the new secret).- URLs must use
httporhttpsand may not contain credentials. Live endpoints must also usehttpsand may not point to localhost,*.local,*.internalor private and reserved addresses. Violations return400 invalid_webhook_url.