Skip to content

Callbacks

Callbacks are used to receive the final status of a transaction. Once a transaction reaches a final status, a request is sent to the Finish callback URL specified in the shop's settings.

Method: POST

Parameters

Name
Data type Description
id string Payment ID in the system
transaction string Unique transaction number on the merchant's side
status string Transaction status
description string Transaction description
ecommerce_type string | null Transaction type
instrument string | null Payment method
amount integer Transaction amount in kopecks
commission integer Commission in kopecks
error_code string Error code
error_message string Error message
created_at string Transaction creation date
extra_data json Additional parameters passed by the merchant
fiscal_data json Receipt fiscalization
additional_data json Additional transaction data

Transaction types for the ecommerce_type parameter:

  • payment — a payment;
  • payout — a payout;
  • unknown — type not determined;
  • null — not specified (e.g. older transactions).

Payment methods for the instrument parameter:

  • card — card;
  • sbp — SBP;
  • tpay — T-pay;
  • alfapay — Alfa-pay;
  • sbpb2b — SBP B2B;
  • null — not specified (e.g. older transactions).

additional_data fields

This object is present in the callback if at least one of its fields has a non-empty value. The fields are populated for SBP transactions.

Name Data type Description
bank_id string Identifier of the payer's bank in the NSPK (SBP) system
subscription_token string Unique identifier of the payer's account binding at the payer's bank
{
  "id": "fbfe9f88-d5c7-4994-aed6-ee8003f4f342",
  "transaction": "test",
  "status": "completed",
  "description": "Продукт №1",
  "ecommerce_type": "payment",
  "instrument": "card",
  "amount": 10000,
  "commission": 0,
  "error_code": null,
  "error_message": null,
  "created_at": "2023-11-30T07:52:29.150747+00:00",
  "extra_data": {
    "ls": "12345"
  },
  "fiscal_data": {},
  "additional_data": {
    "bank_id": "100000000111",
    "subscription_token": "c0de0a5c-cc27-4de9-b242-96e9d7e895d9"
  }
}

Headers

The request headers also include:

  • X-Api-Key — the shop's unique identifier;
  • X-Signature — the request signature.

Signature generation:

sha256({api-key}{request_body}{secret-key})

where request_body is the request body as a string:

{\"id\":\"fbfe9f88-d5c7-4994-aed6-ee8003f4f342\",\"transaction\":\"test\",\"status\":\"completed\",\"description\":\"Продукт №1\",\"ecommerce_type\":\"payment\",\"instrument\":\"card\",\"amount\":10000,\"commission\":0,\"created_at\":\"2023-11-30T07:52:29.150747+00:00\",\"extra_data\":{\"ls\":\"12345\"},\"fiscal_data\":{}}

Callback delivery

A delivery is considered successful only if the merchant's server returns an HTTP 200 status code. Any other HTTP code, a timeout, or a connection error is considered a failed attempt.

If the first delivery attempt fails, 5 more attempts will be made every 10 minutes.