Webhook
Bitpayway sends a webhook when an event happens to one of your payment orders. You choose the events your business receives.
| Event | Sent when |
|---|---|
PAYMENT_PARTIALLY_PAID | A confirmed payment covers part of the amount. It is sent again for each new partial payment, with the accumulated amounts. |
ORDER_PAID | The order is fully paid and confirmed. It is sent again for each later payment the order receives within its 30 minutes. |
PAYMENT_EXPIRED | The 30 minutes ended without the full amount: the order is expired or expired partial paid. |
PAYMENT_SYNC_FAILED | Bitpayway could not confirm the order's payments by its deadline and keeps verifying them. It is sent again if the order is handed over to manual review. The order later gets ORDER_PAID or PAYMENT_EXPIRED. |
SETTLEMENT_MISMATCH | A multi-destination order received a payment with a division different from the agreed one. It is sent again for each new version of the amounts. |
Each time an event happens, Bitpayway creates an instance of it: a snapshot of the order at that moment, identified by its own eventId. A partial payment of 30 followed by another of 20 produces two instances of PAYMENT_PARTIALLY_PAID, one with paidAmount 30 and one with 50. One change can also produce instances of two events, for example PAYMENT_PARTIALLY_PAID and SETTLEMENT_MISMATCH.
No webhook is sent when an order is created (pending), nor while a payment that completes the order waits for block confirmations (paid waiting confirmations): you receive ORDER_PAID once the payment is confirmed.
Choosing the events
Select the events in the Webhook events field of the business configuration, next to the webhook URL. A new business receives every event.
Instances are created only while the business has a webhook URL and is subscribed to the event when it happens. Subscribing later does not send past events. Unsubscribing or changing the URL does not cancel instances already created: they keep their retries and go to the URL configured at the time of each attempt.
Order statuses
The table below lists every status an order can have, including the ones that do not trigger a webhook. They can appear when you query an order through the API and in the status field of data.
| Status | Meaning |
|---|---|
pending | Waiting for payment. |
partial paid | Part of the amount was paid and confirmed. |
paid waiting confirmations | The amount was paid and is waiting for block confirmations. |
paid | The amount was paid and confirmed. |
expired | The 30 minutes ended without a payment. |
expired partial paid | The 30 minutes ended with only part of the amount paid. |
sync_fail | Bitpayway could not confirm the payments by the deadline and is still verifying them. |
sync_fail_reconciliation | Automatic verification ended without a result; the order is under manual review. |
canceled | The order was canceled. |
An order accepts payments for 30 minutes after it is created. An order that is not fully paid in that time becomes expired, or expired partial paid if it received part of the amount.
HTTP request
Method: POST
Headers:
Content-Type: application/jsonSPP-Api-Timestamp: Unix timestamp in milliseconds indicating when the request was sent.SPP-Api-Signature: HMAC-SHA256 signature in the formatsha256=<hex digest>.
Body:
To avoid a separate HTTP request for every event, instances are grouped by business, with up to 30 in each request. The body is therefore always a JSON array, even with a single item, and one request can carry instances of different events and orders.
Each item is one instance:
| Field | Description |
|---|---|
eventId | UUID of the instance. Use it to discard an instance you already processed. |
event | Event name, such as ORDER_PAID. |
sequence | Number that grows with every change of the same order. Numbers are not consecutive. |
occurredAt | When the change happened (ISO 8601), not when the request was sent. |
data | The order at the moment of the event. |
The shape of data depends on the order's payment model:
- Standard order:
datacontains only the common fields. ThepaymentModelfield is not present. - Multi-destination order:
datacontains the common fields plus the multi-destination fields, andpaymentModelis'split'.
Use the presence of paymentModel === 'split' to tell the two cases apart. An integration that does not use multi-destination payments can ignore the extra fields.
type WebhookBody = WebhookItem[];
type WebhookItem = {
eventId: string;
event: WebhookEvent;
sequence: number;
occurredAt: string;
data: StandardOrderData | MultiDestinationOrderData;
};
type WebhookEvent =
| 'PAYMENT_PARTIALLY_PAID'
| 'ORDER_PAID'
| 'PAYMENT_EXPIRED'
| 'PAYMENT_SYNC_FAILED'
| 'SETTLEMENT_MISMATCH';
// Fields present on every item.
type StandardOrderData = {
id: string;
requestId: string;
description: string;
amount: string;
status: OrderStatus;
network: string;
currency: string;
paidAmount: string;
netAmount: string;
fee: string;
};
// Multi-destination order: every common field + the fields below.
type MultiDestinationOrderData = StandardOrderData & {
paymentModel: 'split';
settlementStatus: 'pending' | 'matched' | 'mismatch';
settlementVersion: number;
split: {
partnerId: string;
partnerCodeId: string;
partnerAmount: string;
};
partnerNetAmount: string;
partnerGrossAmount: string;
clientCommission: string;
partnerCommission: string;
commissionReceived: string;
};
type OrderStatus =
| 'pending' // only in SETTLEMENT_MISMATCH
| 'paid waiting confirmations' // only in SETTLEMENT_MISMATCH
| 'partial paid'
| 'paid'
| 'expired partial paid'
| 'expired'
| 'sync_fail' // only in PAYMENT_SYNC_FAILED
| 'sync_fail_reconciliation'; // only in PAYMENT_SYNC_FAILED
Common fields
Present in every data, for standard and multi-destination orders.
| Field | Description |
|---|---|
id | UUID generated by Bitpayway for the payment order. |
requestId | UUID provided by your application when the order was created. |
description | Description provided when the order was created. |
amount | Requested payment amount, represented as a decimal string. |
status | Order status when the event happened. |
network | Blockchain network name. |
currency | Token symbol. |
paidAmount | Total amount paid on the blockchain before fees, represented as a decimal string. |
netAmount | Amount sent to your wallet after payment fees, represented as a decimal string. |
fee | Platform spread, represented as a decimal string. On multi-destination orders it is the sum of clientCommission and partnerCommission. |
All monetary values are decimal strings already converted to the token's unit (for example, "1000.52" USDC), not raw wei values.
Example: standard order
[
{
"eventId": "d8820c16-da67-4b9e-8f3a-6c1e7a657ed2",
"event": "PAYMENT_PARTIALLY_PAID",
"sequence": 18342,
"occurredAt": "2026-10-25T14:03:12.000Z",
"data": {
"id": "45ccdc4c-8457-4e9c-a16d-4c9d35f128ed",
"requestId": "2f3c9d2c-1b75-4e9d-9b2f-67d0a9c3c7d1",
"description": "Order #1234",
"amount": "1000.52",
"status": "partial paid",
"network": "ethereum",
"currency": "USDC",
"paidAmount": "1000",
"netAmount": "950",
"fee": "50"
}
}
]
Multi-destination orders
A multi-destination order sends the same item, with data extended by the fields below. They are absent on standard orders, so an existing integration keeps working unchanged.
| Field | Description |
|---|---|
paymentModel | Always split. Absent on standard orders. |
settlementStatus | pending, matched or mismatch. A mismatch order needs reconciliation with your partner. It is independent of the order status. |
settlementVersion | Version of the confirmed amounts; it increases whenever they change. |
split.partnerId | UUID of the partner link. |
split.partnerCodeId | On-chain identifier of the partner link. |
split.partnerAmount | Gross share agreed when the order was created. |
netAmount | Amount effectively received by you. |
partnerNetAmount | Amount effectively received by the partner. |
partnerGrossAmount | Gross amount accumulated for the partner. |
clientCommission | Nominal fee charged on your share. |
partnerCommission | Nominal fee charged on the partner's share. |
commissionReceived | Amount effectively received by the platform. |
Example: multi-destination order
[
{
"eventId": "3f0c2a91-7d4e-4c55-9a0b-2e6f8d1c4b73",
"event": "ORDER_PAID",
"sequence": 18351,
"occurredAt": "2026-10-25T14:09:47.000Z",
"data": {
"id": "45ccdc4c-8457-4e9c-a16d-4c9d35f128ed",
"requestId": "2f3c9d2c-1b75-4e9d-9b2f-67d0a9c3c7d1",
"description": "Order #1234",
"amount": "1000",
"status": "paid",
"network": "ethereum",
"currency": "USDC",
"paidAmount": "1000",
"netAmount": "665",
"fee": "50",
"paymentModel": "split",
"settlementStatus": "matched",
"settlementVersion": 1,
"split": {
"partnerId": "9b1d2c3e-4f50-4a6b-8c7d-0e1f2a3b4c5d",
"partnerCodeId": "12",
"partnerAmount": "300"
},
"partnerNetAmount": "285",
"partnerGrossAmount": "300",
"clientCommission": "35",
"partnerCommission": "15",
"commissionReceived": "50"
}
}
]
When a multi-destination order is notified
A multi-destination order receives the same events as a standard order. When a payment brings a division different from the agreed one, it also receives SETTLEMENT_MISMATCH, once for each new settlementVersion. This has two consequences:
SETTLEMENT_MISMATCHcan arrive after a terminal status, and even while the orderstatusis stillpendingorpaid waiting confirmations, so you can start reconciliation before any payment confirmation.- An approved order stays
paidwhen a later payment is divided differently; its amounts andsettlementVersionstill change.
Do not repeat a commercial fulfilment on every financial update.
See Multi-destination payments for how the amounts are calculated and when an order is considered approved.
Delivery and retries
Your endpoint should process every item in the array and return a successful 2xx response after accepting them. Any 2xx response confirms the delivery of every instance in the request. A timeout of 10 seconds, a connection error or a non-2xx response is a failed attempt for all of them.
Each instance has up to five automatic attempts, two minutes apart. Instances are independent: a failed instance keeps its retries even after a newer instance of the same order was delivered, and it always sends its own snapshot. As a result:
- Duplicates: your endpoint can process a request even when Bitpayway does not receive the
2xx, so the same instance can arrive again. Discard aneventIdyou already processed. - Order: an older instance can arrive after a newer one. For each order (
data.id), keep the highestsequenceyou processed and ignore an item with a lower one.
History and manual resend
The Webhooks tab of the business lists every event with its instances. For each instance you can see the attempts, the exact request sent, its headers and the response of your endpoint. History is kept for 90 days after the last occurrence of each event.
A delivered instance, or one that failed all its attempts, can be resent with Resend now. The resend uses the instance's original snapshot with a new signature, on the next delivery cycle, and does not count toward the five automatic attempts. Each instance can be resent up to 5 times per hour, and up to 30 instances per business per hour.
Verifying the signature
The signature is calculated from the exact raw request body:
<timestamp>\n<uppercase HTTP method>\n<raw request body>
For a webhook, the HTTP method is POST. The URL and path are not part of the signed content.
Use the webhook secret key generated in the business configuration as the HMAC secret. Capture the raw body before parsing it; serializing the parsed JSON again can produce different bytes and invalidate the signature.
The example below verifies the signature using Node.js:
import crypto from 'node:crypto';
const verifyHmacSignature = (params: {
apiSecret: string;
timestampHeader: string | undefined;
signatureHeader: string | undefined;
method: string;
rawBody: string;
maxSkewMs?: number;
}) => {
const {
apiSecret,
timestampHeader,
signatureHeader,
method,
rawBody,
maxSkewMs = 1000 * 60 * 5, // 5 minutes
} = params;
if (!timestampHeader || !signatureHeader) {
return false;
}
const timestamp = Number(timestampHeader);
if (!Number.isFinite(timestamp)) {
return false;
}
// Protect against replay attacks.
if (Math.abs(Date.now() - timestamp) > maxSkewMs) {
return false;
}
const expectedPrefix = 'sha256=';
if (!signatureHeader.startsWith(expectedPrefix)) {
return false;
}
const receivedHmacHex = signatureHeader.slice(expectedPrefix.length);
const stringToSign = [timestamp.toString(), method.toUpperCase(), rawBody].join('\n');
const calculatedHmacHex = crypto
.createHmac('sha256', apiSecret)
.update(stringToSign, 'utf8')
.digest('hex');
const receivedBuffer = Buffer.from(receivedHmacHex, 'hex');
const calculatedBuffer = Buffer.from(calculatedHmacHex, 'hex');
if (receivedBuffer.length !== calculatedBuffer.length) {
return false;
}
return crypto.timingSafeEqual(receivedBuffer, calculatedBuffer);
};
The five-minute tolerance in this example is a client-side policy and can be adjusted. Validating the timestamp is strongly recommended to reduce the risk of replay attacks.