Event notification
webhooks/notificationDescription
The platform calls the merchant whenever something happens to a payment or a contract.
POST to the merchant address, Content-Type: application/json (UTF-8). Delivery is
performed by the Hydra transport: it queues the event, retries on a schedule until the
merchant acknowledges it, and can fall back to several addresses.
The format follows the project protocol version: 3 and above — JSON, below — the previous XML notifications.
Addresses. MerchantURL (main), MerchantRefundURL (refunds),
MerchantReceiptURL (receipts) — configured per project. If a specialised address is
not set, the notification goes to the main MerchantURL. An event may have several
addresses: when one is unreachable the transport moves on to the next.
The body carries the event only. Everything about delivery lives in headers, so the signature can be verified without parsing JSON, and the body does not depend on the delivery mechanics.
| Header | Purpose |
|---|---|
X-Login | Platform login at the merchant (Login2Merchant) |
X-Timestamp | Timestamp of this delivery attempt, UTC ISO-8601 |
X-Signature | Signature, lowercase hex |
X-Signature-Version | Signature algorithm version |
X-Event-Id | Mirrors id from the body — lets you drop a repeat before parsing JSON |
X-Event-Type | Mirrors type — lets you route before parsing JSON |
X-Request-Attempt | Delivery attempt number |
X-Timestamp, X-Signature and X-Request-Attempt belong to a particular attempt and
change on every retry. Everything describing the event stays the same.
X-Event-Id and X-Event-Type are not covered by the signature. Version 4 signs
the timestamp and the body; headers are not part of it. They are good for fast routing
and pre-filtering, but the decision — process the event or treat it as a repeat — must
be made from id and type in the body: only those are signed.
Signature. Notifications are signed with a separate key pair — the one the platform
uses when calling the merchant: Login2Merchant and Password2Merchant from the
project settings. This is not the password the merchant signs its own requests with.
Version 4 — the signature covers the whole body:
signature = LOWERCASE(HMACSHA256(Password2Merchant, X-Timestamp + "." + RAW_BODY))
RAW_BODY is the request body exactly as received, before parsing. Verify the
signature over the raw bytes: re-serialising may change field order or whitespace,
and the signature will stop matching.
Version 3 — the signature proves the sender only, it does not cover the content:
innerHash = LOWERCASE(HMACSHA256(Password2Merchant, X-Timestamp))
signature = LOWERCASE(HMACSHA256(Password2Merchant, X-Login + innerHash))
Answer immediately, without waiting for your own processing to finish: the platform
waits a limited time, and a slow answer counts as a timeout and causes a retry. A 4xx
answer (except 408 and 429) stops retries: the request is considered unacceptable
for the merchant. 408, 429, 5xx, timeouts, connection resets and an unreachable
address lead to redelivery.
Retries and idempotency. Intervals are a ladder per event type — for example
0, 60, 300, 900, 3600 seconds. The number of attempts equals the ladder length; once
it is exhausted the platform stops delivering and records that in the log.
Delivery order is not guaranteed: events for one invoice may arrive out of order.
Rely on created_at and on the state inside data.
Compatibility rule. The platform may add new fields to data and introduce new
type values. The merchant must ignore unknown fields, and acknowledge notifications
with an unknown type rather than answering with an error.
Request and response
Examples come from OpenAPI and are read-only here. Run requests in the Sandbox section.
webhooks/notificationPRODUCTIONcurl -X POST "https://pay-api.digitalspb.comwebhooks/notification" \ -H "Content-Type: application/json" \ -H "X-Login: YOUR_LOGIN" \ -H "X-Timestamp: YOUR_TIMESTAMP" \ -H "X-Signature-Version: 3" \ -H "X-Signature: YOUR_SIGNATURE" \ -d '{ "id": "bae26b7d-6f0b-4a8b-9c3f-2a1d5e7c9b10", "type": "payment.updated", "created_at": "2026-03-29T20:00:12Z", "project_id": 1001, "data": { "customer": { "type": "mobile_phone", "msisdn": "79600000000", "country": "RU", "network": { "id": 3, "name": "Beeline" }, "operator": { "id": 42, "name": "Beeline" } }, "invoice": { "invoice_id": "1624505c-0031-00cf-7d54-4cf1ce08cb30", "merchant_order_id": "order_123", "status": "Processed", "payment_status": "PAID", "price": { "amount": "25.00", "currency": "RUB", "vat_included": true }, "created_at": "2026-03-29T20:00:10Z", "expires_at": "2026-03-29T22:00:10Z", "authorization": { "type": "BY_CONTRACT", "is_authorized": true } }, "transaction": { "transaction_id": "4d9e95c6-0006-0062-6727-4ea756dba333", "part_number": 1, "sequence_number": 1, "status": "Success", "result_code": 0, "result_description": "OK", "paid_at": "2026-03-29T20:00:12Z", "price": { "amount": "25.00", "currency": "RUB", "vat_included": true }, "billing_channel": "CPA" } }}'JSON v3 request fields
notification| Request fields | Type | Req. | Description | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | string (uuid) | optional | Event id. The same across all delivery attempts — use it as the idempotency key.
A repeated | |||||||||||||||||||||
type | string | optional | Event type. The name states the phase, not the outcome: the outcome is read from the statuses in the body.
Where to read the outcome: for content.deliveredcontract.authorizedcontract.closedpayment.updatedreceipt.issuedrefund.updated | |||||||||||||||||||||
created_at | string | optional | When the event happened on the platform, UTC ISO-8601. Unchanged between retries | |||||||||||||||||||||
project_id | integer (int32) | optional | Project the event belongs to | |||||||||||||||||||||
data | object | optional | Event payload: only the blocks relevant to the event type are filled, the rest are omitted from the JSON. | |||||||||||||||||||||
customer | object | optional | Customer in a notification. Card details are never present here. | |||||||||||||||||||||
type | string | optional | ||||||||||||||||||||||
msisdn | string | optional | ||||||||||||||||||||||
source | string | optional | ||||||||||||||||||||||
country | string | optional | ||||||||||||||||||||||
merchant_customer_id | string | optional | ||||||||||||||||||||||
email | string | optional | ||||||||||||||||||||||
network | object | optional | +2 | |||||||||||||||||||||
id | integer (int32) | optional | ||||||||||||||||||||||
name | string | optional | ||||||||||||||||||||||
operator | object | optional | +2 | |||||||||||||||||||||
id | integer (int32) | optional | ||||||||||||||||||||||
name | string | optional | ||||||||||||||||||||||
invoice | object | optional | +14 | |||||||||||||||||||||
invoice_id | string | optional | ||||||||||||||||||||||
merchant_order_id | string | optional | ||||||||||||||||||||||
status | string | optional | ||||||||||||||||||||||
payment_status | string | optional | ||||||||||||||||||||||
price | object | optional | Amount in a notification. | |||||||||||||||||||||
amount | string | optional | ||||||||||||||||||||||
currency | string | optional | ||||||||||||||||||||||
vat_included | boolean | optional | ||||||||||||||||||||||
created_at | string | optional | ||||||||||||||||||||||
expires_at | string | optional | ||||||||||||||||||||||
authorization | object | optional | Authorization state in a notification. | |||||||||||||||||||||
type | string | optional | ||||||||||||||||||||||
is_authorized | boolean | optional | ||||||||||||||||||||||
refund_status | string | optional | ||||||||||||||||||||||
transaction | object | optional | Payment transaction in a notification. | |||||||||||||||||||||
transaction_id | string | optional | ||||||||||||||||||||||
part_number | integer (int32) | optional | ||||||||||||||||||||||
sequence_number | integer (int32) | optional | ||||||||||||||||||||||
status | string | optional | ||||||||||||||||||||||
result_code | integer (int32) | optional | ||||||||||||||||||||||
result_description | string | optional | ||||||||||||||||||||||
paid_at | string | optional | ||||||||||||||||||||||
price | object | optional | Amount in a notification. | |||||||||||||||||||||
amount | string | optional | ||||||||||||||||||||||
currency | string | optional | ||||||||||||||||||||||
vat_included | boolean | optional | ||||||||||||||||||||||
partner_profit | object | optional | Amount in a notification. | |||||||||||||||||||||
amount | string | optional | ||||||||||||||||||||||
currency | string | optional | ||||||||||||||||||||||
vat_included | boolean | optional | ||||||||||||||||||||||
total_paid | object | optional | Amount in a notification. | |||||||||||||||||||||
amount | string | optional | ||||||||||||||||||||||
currency | string | optional | ||||||||||||||||||||||
vat_included | boolean | optional | ||||||||||||||||||||||
total_remaining | object | optional | Amount in a notification. | |||||||||||||||||||||
amount | string | optional | ||||||||||||||||||||||
currency | string | optional | ||||||||||||||||||||||
vat_included | boolean | optional | ||||||||||||||||||||||
billing_channel | string | optional | ||||||||||||||||||||||
contract | object | optional | +4 | |||||||||||||||||||||
contract_id | string | optional | ||||||||||||||||||||||
merchant_contract_id | string | optional | ||||||||||||||||||||||
authorization_type | string | optional | ||||||||||||||||||||||
expires_at | string | optional | ||||||||||||||||||||||
content | object | optional | +3 | |||||||||||||||||||||
merchant_content_id | string | optional | ||||||||||||||||||||||
delivery_state | string | optional | ||||||||||||||||||||||
delivered_at | string | optional | ||||||||||||||||||||||
receipt | object | optional | +1 | |||||||||||||||||||||
url | string | optional | ||||||||||||||||||||||
content_required | booleannull | optional |
Parameters and headers
| Name | In | Required | Description |
|---|---|---|---|
X-Event-Id | header | yes | |
X-Event-Type | header | yes | |
X-Signature-Version | header | yes | |
X-Login | header | yes | |
X-Timestamp | header | yes | |
X-Signature | header | yes | |
X-Request-Attempt | header | yes |
Responses
Full error codes are in Error codes.