API · Notifications

Event notification

JSON v3 onlyPOSTwebhooks/notification

Description

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.

HeaderPurpose
X-LoginPlatform login at the merchant (Login2Merchant)
X-TimestampTimestamp of this delivery attempt, UTC ISO-8601
X-SignatureSignature, lowercase hex
X-Signature-VersionSignature algorithm version
X-Event-IdMirrors id from the body — lets you drop a repeat before parsing JSON
X-Event-TypeMirrors type — lets you route before parsing JSON
X-Request-AttemptDelivery 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.

POSTwebhooks/notificationPRODUCTION
Request
curl -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"    }  }}'
Read-only example. Runnable examples are available in the Sandbox section.
The specification has no example for this operation and protocol.

JSON v3 request fields

notification
Request fieldsTypeReq.Description
idstring (uuid)optional

Event id. The same across all delivery attempts — use it as the idempotency key. A repeated id must be acknowledged but not processed again.

typestringoptional

Event type. The name states the phase, not the outcome: the outcome is read from the statuses in the body.

typeWhen it is sentAddress
payment.updatedThe payment transaction for the invoice reached a final stateMerchantURL
refund.updatedThe refund state for the invoice changedMerchantRefundURL
contract.authorizedThe contract is authorized and ready for chargesMerchantURL
contract.closedThe contract is closedMerchantURL
content.deliveredContent delivery state for the invoice changedMerchantURL
receipt.issuedA fiscal receipt was issuedMerchantReceiptURL

Where to read the outcome: for payment.updated — invoice.payment_status and invoice.status; for refund.updated — invoice.refund_status. A cancelled invoice arrives as payment.updated with status: "Cancelled" and payment_status: "NOT_PAID"; a failed refund — as refund.updated with refund_status: "RefundFailed".

content.deliveredcontract.authorizedcontract.closedpayment.updatedreceipt.issuedrefund.updated
created_atstringoptional

When the event happened on the platform, UTC ISO-8601. Unchanged between retries

project_idinteger (int32)optional

Project the event belongs to

dataobjectoptional

Event payload: only the blocks relevant to the event type are filled, the rest are omitted from the JSON.

customerobjectoptional

Customer in a notification. Card details are never present here.

+12
invoiceobjectoptional+14
transactionobjectoptional

Payment transaction in a notification.

+24
contractobjectoptional+4
contentobjectoptional+3
receiptobjectoptional+1
content_requiredbooleannulloptional

Parameters and headers

NameInRequiredDescription
X-Event-Idheaderyes
X-Event-Typeheaderyes
X-Signature-Versionheaderyes
X-Loginheaderyes
X-Timestampheaderyes
X-Signatureheaderyes
X-Request-Attemptheaderyes

Responses

200
Notification accepted. The body is optional — an empty response with a success code
201
Уведомление принято
202
Уведомление принято
204
Notification accepted, no body returned

Full error codes are in Error codes.