Полная документация по работе с PSPAY P2P API Complete documentation for PSPAY P2P API
PSPAY API предоставляет полный набор методов для работы с платежами, выплатами и апелляциями в системе P2P переводов.
PSPAY API provides a complete set of methods for working with payments, payouts and appeals in the P2P transfer system.
API поддерживает работу с данными в формате JSON. Все запросы должны отправляться через HTTPS.
API supports data in JSON format. All requests must be sent via HTTPS.
Для авторизации запросов используется API токен, который необходимо передавать в заголовке каждого запроса.
API token is used for request authorization, which must be passed in the header of each request.
X-API-TOKEN: your_api_token
curl -X POST https://api.pspay.io/api/v1/order/create \
-H "Content-Type: application/json" \
-H "X-API-TOKEN: YOUR_API_TOKEN" \
-d '{
"order_id": "test123",
"customer_id": "781",
"submerchant_id": "shop_alpha",
"amount": 500,
"cred_type": 1,
"currency": "RUB"
}'
Каждый коллбек подписывается HMAC SHA-256. Подпись генерируется из тела запроса и API-токена мерчанта.
Each callback is signed using HMAC SHA-256. The signature is generated from the request body and merchant's API token.
X-Signature$signature = hash_hmac('sha256', json_encode($order_data), $merchant['api_token']);
$received_signature = $_SERVER['HTTP_X_SIGNATURE'];
$expected_signature = hash_hmac('sha256', file_get_contents('php://input'), $api_token);
if (hash_equals($expected_signature, $received_signature)) {
// Signature is valid
}
| ПараметрProperty | ЗначениеValue |
|---|---|
Content-Type | application/json |
X-API-TOKEN | Ваш токен в каждом запросеYour token in every request |
| КодировкаEncoding | UTF-8 |
| ПротоколProtocol | HTTPS |
| Формат данныхData format | JSON |
После завершения транзакции система автоматически отправляет HTTP POST запрос на URL мерчанта.
After transaction completion, the system sends an HTTP POST request to the merchant's callback URL.
{
"order_id": "ORD12345",
"transaction_id": "167259",
"amount": 1500,
"commission": 120,
"merch_amount": 1380,
"cred": "4441111065570016",
"cred_type": 1,
"receiver_name": "Артем М.",
"receiver_bank": "Сбер",
"status_id": 5
}
| ПараметрParameter | ТипType | ОписаниеDescription |
|---|---|---|
order_id | string | Идентификатор ордераOrder identifier |
transaction_id | string | ID транзакции в системеTransaction ID in the system |
amount | number | Сумма платежаPayment amount |
commission | number | Комиссия системыSystem commission |
merch_amount | number | Сумма к зачислению мерчантуAmount credited to merchant |
cred | string | Реквизиты получателяReceiver credentials |
cred_type | integer | Тип: 1 — карта, 2 — СБП, 3 — номер счёта (пополнение и выплаты)Type: 1 — card, 2 — SBP, 3 — bank account number (payins and payouts) |
receiver_name | string | Имя получателяReceiver name |
receiver_bank | string | Банк получателяReceiver bank |
status_id | integer | Статус (5 — успешно)Status (5 — completed) |
POST /merchant/callback HTTP/1.1
Host: merchant.com
Content-Type: application/json
X-Signature: d3b07384d113edec49eaa6238ad5ff00fa2b4ca6
{ "order_id": "ORD12345", "status_id": 5, ... }
{ "status": "ok" }
<?php
function handleCallback($api_token) {
$raw_data = file_get_contents('php://input');
$received_signature = $_SERVER['HTTP_X_SIGNATURE'] ?? '';
$expected_signature = hash_hmac('sha256', $raw_data, $api_token);
if (!hash_equals($expected_signature, $received_signature)) {
http_response_code(401);
echo json_encode(['status' => 'error', 'message' => 'Invalid signature']);
return;
}
$data = json_decode($raw_data, true);
// ... your business logic ...
echo json_encode(['status' => 'ok']);
}
{"status":"ok"} при успехе{"status":"ok"} on successКонечный мерч внутри агрегатора регистрируется заранее. Его external_id затем передаётся в submerchant_id при создании ордера. Пара ваш аккаунт + external_id уникальна.
Register each end-merchant first. Its external_id is then sent as submerchant_id on order create. The pair of your account + external_id is unique.
Создаёт запись в реестре субмерчантов. После этого external_id можно передавать как submerchant_id в order/create.
Creates a submerchant registry row. After that, external_id can be sent as submerchant_id on order/create.
| ПараметрParameter | ТипType | ОбязательныйRequired | ОписаниеDescription |
|---|---|---|---|
external_id | string | ДаYes | Постоянный Merchant ID конечного мерча. Это же значение передаётся в submerchant_id.Permanent end-merchant ID. The same value is sent as submerchant_id. |
title | string | НетNo | Название конечного мерча. Рекомендуем всегда передавать. Алиас: name.End-merchant name. Recommended. Alias: name. |
name | string | НетNo | Алиас для title. Если title пустой — берётся name.Alias for title. Used when title is empty. |
url | string | НетNo | URL сайта / проекта.Site / project URL. |
traffic_type | string | НетNo | FD, TRUSTED или MIXED.FD, TRUSTED, or MIXED. |
commission | number | НетNo | Комиссия. Если не передана — 0.Commission. Defaults to 0. |
min_tx_amount | number | НетNo | Минимальная сумма транзакции.Minimum transaction amount. |
max_tx_amount | number | НетNo | Максимальная сумма транзакции.Maximum transaction amount. |
daily_limit | number | НетNo | Дневной лимит.Daily limit. |
is_active | integer | НетNo | Флаг активности. Если не передан — 0.Active flag. Defaults to 0. |
traders_group | integer | НетNo | ID группы трейдеров.Trader group ID. |
curl -X POST https://api.pspay.io/api/v1/submerchant/create \
-H "Content-Type: application/json" \
-H "X-API-TOKEN: your_api_token" \
-d '{
"external_id": "shop_alpha",
"title": "Shop Alpha",
"url": "https://shop-alpha.example",
"traffic_type": "MIXED",
"is_active": 1
}'
{
"status": "ok",
"id": 1842,
"title": "Shop Alpha",
"commission": 0,
"url": "https://shop-alpha.example",
"external_id": "shop_alpha"
}
| code | error_message |
|---|---|
101 | API token is required / Merchant not found or not active |
103 | external_id is required |
103 | Submerchant with this external_id already exists |
Формат ошибки: {"status":"error","error_message":"...","code":103}.
Error format: {"status":"error","error_message":"...","code":103}.
Обновляет title и/или url уже зарегистрированного субмерчанта. Ищется по паре ваш аккаунт + external_id.
Updates title and/or url of an existing submerchant. Lookup is your account + external_id.
| ПараметрParameter | ТипType | ОбязательныйRequired | ОписаниеDescription |
|---|---|---|---|
external_id | string | ДаYes | Merchant ID конечного мерча — тот же, что при регистрации.End-merchant ID — the same value as at registration. |
title | string | Да, если нет urlIf no url | Новое название. Алиас: name.New name. Alias: name. |
name | string | НетNo | Алиас для title.Alias for title. |
url | string | Да, если нет title/nameIf no title/name | URL сайта / проекта.Site / project URL. |
curl -X POST https://api.pspay.io/api/v1/submerchant/update \
-H "Content-Type: application/json" \
-H "X-API-TOKEN: your_api_token" \
-d '{
"external_id": "shop_alpha",
"name": "Shop Alpha",
"url": "https://shop-alpha.example"
}'
{
"status": "ok",
"id": 1842,
"title": "Shop Alpha",
"url": "https://shop-alpha.example",
"external_id": "shop_alpha"
}
| code | error_message |
|---|---|
101 | API token is required / Merchant not found or not active |
103 | external_id is required |
103 | title or url is required |
103 | Submerchant not found |
Формат ошибки: {"status":"error","error_message":"...","code":103}.
Error format: {"status":"error","error_message":"...","code":103}.
Возвращает всех субмерчантов, зарегистрированных на ваш API-токен.
Returns all submerchants registered on your API token.
curl -X GET https://api.pspay.io/api/v1/submerchant/list \
-H "X-API-TOKEN: your_api_token"
{
"status": "ok",
"submerchants": [
{
"id": "1842",
"title": "Shop Alpha",
"external_id": "shop_alpha",
"url": "https://shop-alpha.example",
"traffic_type": "MIXED",
"is_active": "1"
}
]
}
Инициализация нового платежа. Система автоматически выберет подходящие реквизиты.
Initialize a new payment. The system automatically selects suitable payment credentials.
cred НЕ передаётся — система выбирает реквизиты автоматически.
The cred parameter is NOT passed — the system selects payment credentials automatically.
| ПараметрParameter | ТипType | ОбязательныйRequired | ОписаниеDescription |
|---|---|---|---|
order_id | string | ДаYes | Уникальный идентификатор ордераUnique order identifier |
customer_id | string | ДаYes | Постоянный идентификатор плательщика. Один плательщик — одно значение во всех платежах. Нельзя генерировать новый случайный ID на каждую транзакцию.Permanent payer identifier. One payer = one value on every payment. Do not generate a new random ID per transaction. |
submerchant_id | string | ДаYes | Постоянный Merchant ID конечного мерча. Должен совпадать с external_id зарегистрированного субмерчанта (POST /api/v1/submerchant/create).Permanent end-merchant Merchant ID. Must match a registered submerchant external_id (POST /api/v1/submerchant/create). |
customer_name | string | УсловноConditional | Имя плательщика (как в документе/банке). Для части гео обязательно, например Турция (TRY); для других валют/стран — по требованиям маршрута или не используется. Уточняйте у поддержки под вашу валюту.Payer name (as on ID/bank records). Required for some regions (e.g. Turkey / TRY); for other currencies or corridors follow support guidance. |
amount | number | ДаYes | Сумма платежа (мин. 300)Payment amount (min. 300) |
cred_type | integer | ДаYes | Тип: 1 — карта, 2 — СБП, 3 — номер счёта (пополнение и выплаты)Type: 1 — card, 2 — SBP, 3 — bank account number (payins and payouts) |
currency | string | НетNo | Валюта (по умолчанию RUB)Currency (default RUB) |
return_url | string | НетNo | URL возврата после оплатыReturn URL after payment |
customer_name — см. строку в таблице параметров.
for some regions (including Turkey) you must send customer_name — see the parameter table.
{
"order_id": "ORDER_2025_001",
"customer_id": "781",
"submerchant_id": "shop_alpha",
"amount": 500,
"cred_type": 1,
"currency": "RUB"
}
customer_name, например Турция)Example with payer name (regions requiring customer_name, e.g. Turkey){
"order_id": "ORDER_TR_001",
"customer_id": "user-9921",
"submerchant_id": "shop_alpha",
"customer_name": "Mehmet Yilmaz",
"amount": 1500,
"cred_type": 1,
"currency": "TRY"
}
{
"status": "ok",
"amount": 500,
"usdt_amount": 11.67,
"usdt_rate": 42.85,
"foreign_amount": 44250,
"order_id": "ORDER_2025_001",
"transaction_id": 167259,
"bank_name": "Сбер",
"receiver_name": "Artem M.",
"cred": "4441111065570016",
"cred_formatted": "4441 1110 6557 0016",
"cred_type": 1,
"redirect_url": "https://checkout.pspay.io/?id=167516&hash=9f5ab8...",
"deadline": "2025-08-25T20:18:43Z"
}
Для трансграничных маршрутов (оплата на российскую карту, в т.ч. через мобильное приложение банка плательщика) в успешном ответе создания ордера может быть передан объект deeplinks: готовые ссылки для открытия приложений банков на Android и iOS. По полю code можно подписать кнопки выбора банка (например TBANK, SBER); по полю link — открывать соответствующий URI в мобильном клиенте. Поле необязательное: если deeplink'и недоступны для маршрута, объект отсутствует.
For cross-border flows (payment to a Russian card, including from the payer’s bank mobile app), a successful create-order response may include a deeplinks object: ready-made links to open bank apps on Android and iOS. Use code for bank labels (e.g. TBANK, SBER) and link as the URI to open on the device. This field is optional; it is omitted when deeplinks are not available for the route.
deeplinksdeeplinks structure| ПолеField | ТипType | ОписаниеDescription |
|---|---|---|
deeplinks | object | Корневой объект; может отсутствоватьRoot object; may be absent |
deeplinks.android | array | Список deeplink'ов для AndroidDeeplinks for Android |
deeplinks.ios | array | Список deeplink'ов для iOSDeeplinks for iOS |
[].code | string | Идентификатор банка для UIBank identifier for UI |
[].link | string | Ссылка (custom scheme, intent или https)Link (custom scheme, intent, or https) |
deeplinks (трансгран)Example response with deeplinks (cross-border){
"status": "ok",
"amount": 600,
"order_id": "tg5678",
"transaction_id": 805499,
"bank_name": "Mobile Wallet",
"receiver_name": "Mobile Wallet",
"cred": "9860091729313550",
"cred_formatted": "9860 0917 2931 3550",
"cred_type": 1,
"redirect_url": "https://checkout.pspay.io/?id=805499&hash=d5631cf4b4acd7ff4b29f2918e3fdde0e9cd41c1b3ac58367859a3607da4b706",
"usdt_rate": 79.95,
"usdt_amount": 7.5,
"deeplinks": {
"android": [
{
"code": "TBANK",
"link": "tbank://Main/Pay/C2C?amount=600&targetCardNumber=9860091729313550&numberCard=9860091729313550&fio=FIO+FIO"
},
{
"code": "SBER",
"link": "intent://ru.sberbankmobile/payments/p2p?type=card_number&requisiteNumber=9860091729313550"
}
],
"ios": [
{
"code": "TBANK",
"link": "https://www.tbank.ru/mybank/payments/transfer-card-to-card/?internal_source=homePayments_transferList_category&predefined=%7B%22currency%22%3A%22RUB%22%2C%22moneyAmount%22%3A600%2C%22providerFields%22%3A%7B%22bankCard%22%3A%229860091729313550%22%7D%7D&requiredParams=%5B%22accountId%22%5D"
},
{
"code": "SBER",
"link": "onlineappmobile://sbolonline/p2ptransfer?amount=600&isNeedToOpenNextScreen=true&skipContactsScreen=true&to=9860091729313550&type=cardNumber"
}
]
}
}
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
101 | 401 | API-токен отсутствует; мерчант не найден или не активен (API token is required / Merchant not found or not active).Missing API token; merchant not found or inactive. |
403 | 403 | IP address is not allowed — IP отправителя отсутствует в разрешённом списке мерчанта.IP address is not allowed — caller IP is not on the merchant allowlist. |
102 | 400 | Сумма ниже минимальной в обработчике подбора. В общем потоке v1/v2/v4 предварительная проверка возвращает 106.Amount below minimum in the selection handler. The shared v1/v2/v4 precheck returns 106. |
103 | 400 | Превышена максимальная сумма; customer_id is required; Customer is not allowed; Customer is blocked; submerchant_id is required / is not registered.Maximum amount exceeded; missing, disallowed or blocked customer; missing or unregistered submerchant. |
104 | 409 | Order ID already exists / Order ID is already being processed — дубликат или параллельное создание. Перед повтором проверьте статус.Duplicate order ID or concurrent creation. Check order status before retrying. |
105 | 400 | Invalid cred_type — неверный тип реквизитов.Invalid cred_type. |
106 | 400 | Нет подходящих реквизитов/провайдера, сумма ниже минимума, субмерчант временно отключён (Merchant is temporary disabled), ошибка создания/проверки ордера. Возможен текст отказа провайдера.No suitable credentials/provider, amount below minimum, temporarily disabled submerchant, or order creation/verification failure. Provider rejection text may be returned. |
108 | 400 | Payment type … is not allowed for this merchant — тип оплаты запрещён мерчанту (v4).Payment type is not allowed for this merchant (v4). |
109 | 422 | Отказ при подборе/резервировании: клиент не подходит, реквизит или трейдер занят/отключён, изменились лимиты, маршрут, интервал или доступный депозит. Итоговый отказ после повторного подбора/каскада может быть 106.Selection/reservation rejected: customer eligibility, busy/disabled credential or trader, changed limits, routing, interval or available deposit. Final selection/cascade failure may return 106. |
110 | 404 | Invalid lifetime — некорректное время жизни ордера. Текущий HTTP-статус для этого кода — 404.Invalid lifetime. The current HTTP status for this business code is 404. |
1011 | 400 | Merchant's USDT rate not found — курс мерчанта не настроен.Merchant's USDT rate not found. |
Создание ордера с автоматическим подбором суммы при нехватке лимита у карты.
Create an order with automatic amount adjustment when a card has insufficient limits.
| ПараметрParameter | ТипType | ОбязательныйRequired | ОписаниеDescription |
|---|---|---|---|
order_id | string | ДаYes | Уникальный идентификатор ордераUnique order identifier |
customer_id | string | ДаYes | Постоянный идентификатор плательщика. Один плательщик — одно значение во всех платежах. Нельзя генерировать новый случайный ID на каждую транзакцию.Permanent payer identifier. One payer = one value on every payment. Do not generate a new random ID per transaction. |
submerchant_id | string | ДаYes | Постоянный Merchant ID конечного мерча. Должен совпадать с external_id зарегистрированного субмерчанта.Permanent end-merchant Merchant ID. Must match a registered submerchant external_id. |
customer_name | string | УсловноConditional | Как в POST /api/v1/order/create: для части гео (в т.ч. Турция) обязательно.Same as POST /api/v1/order/create: required for some regions (e.g. Turkey). |
amount | number | ДаYes | Желаемая сумма платежаDesired payment amount |
cred_type | integer | ДаYes | Тип: 1 — карта, 2 — СБП, 3 — номер счёта (пополнение и выплаты)Type: 1 — card, 2 — SBP, 3 — bank account number (payins and payouts) |
randomize_enable | integer | НетNo | 1 — включить рандомизацию1 — enable randomization |
randomize_direction | string | НетNo | "increase" или "decrease""increase" or "decrease" |
randomize_stepping | number | НетNo | Шаг изменения суммы (по умолчанию 5)Amount change step (default 5) |
randomize_max_steps | integer | НетNo | Максимальное количество шаговMaximum number of steps |
randomize_max_final_amount | number | НетNo | Верхняя граница итоговой суммыUpper limit of the final amount |
{
"order_id": "order12345",
"customer_id": "cust-5501",
"submerchant_id": "shop_alpha",
"amount": 1000.00,
"cred_type": 1,
"randomize_enable": 1,
"randomize_direction": "increase",
"randomize_stepping": 5,
"randomize_max_steps": 10,
"randomize_max_final_amount": 1200
}
Проверка текущего статуса платежа. Можно передать order_id или transaction_id.
Check the current payment status. Pass either order_id or transaction_id.
{ "order_id": "order12345" }
// или / or
{ "transaction_id": 167259 }
| ID | СтатусStatus | ОписаниеDescription |
|---|---|---|
| 1 | НоваяNew | Ордер создан, ожидает обработкиOrder created, awaiting processing |
| 2 | Реквизиты выданыCredentials Issued | Реквизиты отправлены клиентуCredentials sent to customer |
| 3 | Клиент оплатилCustomer Paid | Получено подтверждение оплатыPayment confirmation received |
| 4 | Клиент отменилCancelled by Customer | Клиент отменил транзакциюCustomer cancelled the transaction |
| 5 | ИсполненоCompleted | Платёж успешно завершёнPayment successfully completed |
| 6 | ОтказDeclined | Платёж отклонёнPayment was declined |
| 7 | АпелляцияAppeal | Открыта апелляция по транзакцииAppeal opened for the transaction |
| 8 | Не взят в работуNot Claimed | Ордер не взят трейдером в работуOrder not claimed by a trader |
| 9 | ПросроченоExpired | Истёк срок действия ордераOrder deadline has expired |
Замена реквизита у активного ордера (status_id = 2) без новой транзакции. transaction_id и order_id сохраняются; сумма, дедлайн, foreign_amount, usdt_* не меняются. Ответ — как у POST /api/v1/order/create (в т.ч. cred_data.emvco, cred_url, deeplinks). Callback не отправляется.
Replace credentials on an active order (status_id = 2) without a new transaction. transaction_id and order_id are preserved; amount, deadline, foreign_amount, and usdt_* stay unchanged. Response matches POST /api/v1/order/create (including cred_data.emvco, cred_url, deeplinks). No merchant callback.
| ПараметрParameter | ТипType | Обяз.Req. | ОписаниеDescription |
|---|---|---|---|
order_id | string | * | ID ордера мерчанта (или transaction_id)Merchant order ID (or transaction_id) |
transaction_id | integer | * | Внутренний ID (p2p_orders.id)Internal ID (p2p_orders.id) |
payer_bank | string | НетNo | SBER или VTB — как при create (cred_type=3)SBER or VTB — same as create (cred_type=3) |
allowed_payer_banks | array | НетNo | VTB → VND + PHP; SBER → VND + PHPVTB → VND + PHP; SBER → VND + PHP |
* Ровно один из order_id / transaction_id. Без payer_bank* фильтр восстанавливается по карте ордера.
* Exactly one of order_id / transaction_id. Without payer_bank*, filter is restored from the order card.
curl -X POST https://api.pspay.io/api/v1/order/change_cred \
-H "Content-Type: application/json" \
-H "X-API-TOKEN: YOUR_TOKEN" \
-d '{ "order_id": "order12345" }'
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
101 | 401 | API-токен отсутствует; мерчант не найден или не активен (API token is required / Merchant not found or not active).Missing API token; merchant not found or inactive. |
403 | 403 | IP address is not allowed — IP отправителя отсутствует в разрешённом списке мерчанта.IP address is not allowed — caller IP is not on the merchant allowlist. |
106 | 400 | Order not found — ордер мерчанта не найден (HTTP 400).Order not found (HTTP 400). |
107 | 400 | Order ID or Transaction ID is required.Order ID or Transaction ID is required. |
109 | 422 | Нет подходящих альтернативных реквизитов.No suitable alternative credentials. |
110 | 404 | Неподдерживаемый fallback (Invalid fallback) или ошибка выбора банка плательщика (payer_bank); HTTP 404.Invalid fallback or payer-bank selection error (payer_bank); HTTP 404. |
114 | 403 | Order cannot change cred in current status / Payment method not available for this merchant — замена запрещена состоянием ордера, апелляцией или настройками метода.Current order status, appeal or merchant payment-method settings prohibit replacement. |
Получение списка ордеров с фильтрацией по статусу, дате создания, дате исполнения и опциональной пагинацией.
Get a list of orders with filters by status, creation date, execution date, and optional pagination.
| ПараметрParameter | ТипType | ОписаниеDescription |
|---|---|---|
status_id | integer | Статус ордераOrder status |
date_from / date_to | string | Диапазон по дате создания, YYYY-MM-DD. Синонимы: created_date_from / created_date_toCreation date range, YYYY-MM-DD. Aliases: created_date_from / created_date_to |
executed_date_from / executed_date_to | string | Диапазон по дате исполнения, YYYY-MM-DDExecution date range, YYYY-MM-DD |
page | integer | Номер страницы (с 1)Page number (from 1) |
page_size | integer | Размер страницы, от 1 до 1000 (по умолчанию 100)Page size, 1 to 1000 (default 100) |
Ограничения: без page / page_size обязателен диапазон дат не длиннее 31 дня (включительно) — date_from + date_to или executed_date_from + executed_date_to, и в одном ответе не более 10000 ордеров. При нарушении — ошибка с кодом 400.
Limits: without page / page_size a date range of up to 31 days (inclusive) is required — date_from + date_to or executed_date_from + executed_date_to, and one response contains at most 10000 orders. Violations return an error with code 400.
{ "status_id": 5, "executed_date_from": "2025-10-01", "executed_date_to": "2025-10-31" }
{
"status": "ok",
"orders": [
{
"order_id": "1756152755766_32lxfyu",
"transaction_id": 167259,
"amount": 666,
"usdt_amount": 15.52,
"usdt_rate": 42.91,
"commission": 34.97,
"merch_amount": 631.04,
"cred": "4441111065570016",
"cred_formatted": "4441 1110 6557 0016",
"cred_type": 1,
"receiver_name": "Артем М.",
"receiver_bank": "Сбер",
"status_id": 5,
"deadline": "2025-10-16T13:16:20Z"
}
]
}
ECOM API позволяет принимать карточные платежи в RUB. Поддерживаются два сценария: редирект на защищённую платёжную страницу и прямой режим с передачей карточных данных в API.
ECOM API accepts card payments in RUB. Two flows are supported: redirect to a hosted secure payment page and direct mode with card data sent to the API.
Тестовый ECOM (test_provider, 3DS, api.pspay.io): см. отдельный файл ECOM_TEST_INTEGRATION.md.
Test ECOM (test_provider, 3DS, api.pspay.io): see ECOM_TEST_INTEGRATION.md.
RUB. Другие валюты в запросах не передаются.
ECOM uses RUB only. Other currencies are not sent in requests.
POST /api/v1/ecom/init создаёт ECOM-транзакцию без передачи карточных данных и возвращает URL платёжной страницы.
POST /api/v1/ecom/init creates an ECOM transaction without card data and returns a hosted checkout URL.
| ПараметрParameter | ТипType | ОбязательныйRequired | ОписаниеDescription |
|---|---|---|---|
order_id | string | ДаYes | Уникальный идентификатор заказа в системе мерчантаUnique merchant-side order identifier |
amount | number | ДаYes | Сумма платежа в рублях (RUB)Payment amount in RUB |
customer_id | string | НетNo | Идентификатор клиентаCustomer identifier |
return_url | string | НетNo | URL возврата после платежаReturn URL after payment |
currency | string | НетNo | Код валюты: RUBCurrency code: RUB |
{
"order_id": "merchant_order_123",
"amount": 500.00,
"customer_id": "customer_456",
"return_url": "https://merchant.example/success",
"currency": "RUB"
}
{
"success": true,
"order_id": "merchant_order_123",
"checkout_url": "https://checkout.pspay.io/3ds/?session=abc123def456",
"session_token": "abc123def456",
"amount": 500.00,
"currency": "RUB",
"response_time": 0.234
}
POST /api/v1/ecom/create создаёт ECOM-платёж и сразу отправляет его на обработку.
POST /api/v1/ecom/create creates an ECOM payment and sends it for processing immediately.
| ПараметрParameter | ТипType | ОбязательныйRequired | ОписаниеDescription |
|---|---|---|---|
order_id | string | ДаYes | Уникальный идентификатор заказаUnique order identifier |
amount | number | ДаYes | Сумма платежа в рублях (RUB)Payment amount in RUB |
customer_id | string | НетNo | Идентификатор клиентаCustomer identifier |
card_pan | string | ДаYes | Номер карты, 13–19 цифрCard number, 13–19 digits |
card_expire | string | ДаYes | Срок действия карты в формате MMYYCard expiry in MMYY format |
card_cvv | string | ДаYes | CVV-код картыCard CVV code |
return_url | string | НетNo | URL возврата после платежаReturn URL after payment |
{
"order_id": "merchant_order_123",
"amount": 500.00,
"customer_id": "customer_456",
"card_pan": "4441111111111111",
"card_expire": "1225",
"card_cvv": "123",
"return_url": "https://merchant.example/success"
}
{
"success": true,
"status": "ok",
"order_id": "merchant_order_123",
"transaction_id": 12345,
"amount": 500.00,
"commission": 25.00,
"merch_amount": 475.00,
"ecom_status": "PAID",
"currency": {
"id": "1",
"code": "RUB",
"title": "RUB"
},
"response_time": 1.234
}
Если карта требует 3DS, в ответе приходит status: "pending_3ds". Направьте плательщика на acs_url или redirect_url (как правило совпадают), затем дождитесь финального статуса через коллбек или GET /api/v1/ecom/status.
If 3DS is required, the response has status: "pending_3ds". Redirect the payer to acs_url or redirect_url (usually the same), then wait for the final status via callback or GET /api/v1/ecom/status.
{
"success": true,
"status": "pending_3ds",
"order_id": "test700-99123222323412333221231232432",
"transaction_id": 829357,
"amount": 501,
"commission": 27.56,
"merch_amount": 473.44,
"ecom_status": "PENDING",
"acs_url": "https://3ds.ru-processing.com/pay/wait_v2/tx_86a743bdb20720dc7b1be7305d3032f9",
"provider": "unipay",
"is_test": false,
"currency": {
"id": "1",
"code": "RUB",
"title": "RUB"
},
"response_time": 1.034,
"redirect_url": "https://3ds.ru-processing.com/pay/wait_v2/tx_86a743bdb20720dc7b1be7305d3032f9"
}
| ПолеField | ОписаниеDescription |
|---|---|
status | pending_3ds — требуется прохождение 3DSpending_3ds — 3DS flow required |
ecom_status | Статус у процессинга (например PENDING)Processor-facing status (e.g. PENDING) |
acs_url | URL страницы 3DS для редиректа или iframe3DS page URL for redirect or iframe |
redirect_url | Часто совпадает с acs_url; альтернативная ссылка для редиректаOften same as acs_url; redirect link |
provider | Код провайдера процессинга (например unipay)Processing provider code (e.g. unipay) |
is_test | Флаг тестовой транзакцииTest transaction flag |
| МетодMethod | НазначениеPurpose |
|---|---|
POST /api/v1/ecom/process | Обработка ранее созданного платежа по order_id с карточными даннымиProcess a previously created payment by order_id with card data |
GET /api/v1/ecom/status?order_id={order_id} | Проверка текущего статуса ECOM-платежаCheck the current ECOM payment status |
{
"success": true,
"status": "PAID",
"order_status": "completed",
"transaction_id": 12345,
"amount": 500.00,
"processed_at": "2025-01-15 14:30:25",
"response_time": 0.056
}
SberPay QR создаёт платёжный ордер с типом реквизита cred_type = 3, возвращает сумму в нативной валюте, ссылку на PNG QR-код и EMVCo payload.
SberPay QR creates a payment order with cred_type = 3 and returns the native-currency amount, a PNG QR link, and an EMVCo payload.
| ПараметрParameter | ТипType | ОбязательныйRequired | ОписаниеDescription |
|---|---|---|---|
cred_type | integer | ДаYes | Тип реквизита. Для SberPay QR — 3 (банковский счёт)Credential type. For SberPay QR use 3 (bank account) |
amount | number | ДаYes | Сумма в базовой валюте мерчанта (RUB)Amount in merchant base currency (RUB) |
order_id | string | ДаYes | Уникальный идентификатор ордераUnique order identifier |
customer_id | string | ДаYes | Постоянный идентификатор плательщика. Один плательщик — одно значение во всех платежах.Permanent payer identifier. One payer = one value on every payment. |
submerchant_id | string | ДаYes | Постоянный Merchant ID конечного мерча. Должен совпадать с external_id зарегистрированного субмерчанта.Permanent end-merchant Merchant ID. Must match a registered submerchant external_id. |
return_url | string | НетNo | URL возврата после оплатыReturn URL after payment |
{
"cred_type": 3,
"amount": 1021,
"order_id": "vqr_order_001",
"customer_id": "user_12345",
"submerchant_id": "shop_alpha"
}
{
"status": "ok",
"amount": 1021,
"usdt_amount": 12.47,
"usdt_rate": 81.87,
"order_id": "vqr_order_001",
"transaction_id": 775189,
"bank_name": "Bidv",
"receiver_name": "Bidv",
"cred": "8846332777",
"cred_formatted": "8846332777",
"cred_type": 3,
"foreign_amount": 328762,
"cred_url": "https://checkout.pspay.io/qr_sberpay_qr?id=775189&hash=6139b39d...",
"cred_data": {
"bank": "BIDV",
"bank_bin": "970418",
"account_number": "8846332777",
"amount_vnd": 328762,
"currency": "VND",
"country": "VN",
"emvco": "00020101021238540010A00000072701240006970418011088463327770208QRIBFTTA530370454063287625802VN63041961"
},
"redirect_url": "https://checkout.pspay.io/sberpay_qr_payment?id=775189&hash=6139b39d...",
"deadline": "2026-03-30T07:57:59Z"
}
| ПолеField | ОписаниеDescription |
|---|---|
foreign_amount | Сумма в нативной валюте — именно её должен оплатить клиентAmount in native currency that the customer must pay |
cred_url | Прямая ссылка на PNG QR-код для вставки как изображениеDirect PNG QR link for image embedding |
cred_data.emvco | Полная строка EMVCo payload с CRC для самостоятельной генерации QRFull EMVCo payload with CRC for custom QR generation |
redirect_url | Готовая страница оплаты с QR, таймером и инструкциейHosted payment page with QR, timer, and instructions |
redirect_url для редиректа на готовую страницу или cred_url как <img src="..."> на своей странице.
use redirect_url to redirect to the hosted page or cred_url as <img src="..."> on your own page.
POST /api/v2/order/status принимает order_id или transaction_id.
POST /api/v2/order/status accepts either order_id or transaction_id.
{ "order_id": "vqr_order_001" }
// или / or
{ "transaction_id": 775189 }
API для создания и управления выплатами на банковские карты, через СБП, на номер счёта и по QR НСПК (https://qr.nspk.ru/…).
API for creating and managing payouts to bank cards, via SBP, to bank account numbers, and by NSPK QR (https://qr.nspk.ru/…).
Инициализация новой выплаты на карту, телефон (СБП), номер счёта или по QR НСПК.
Initialize a new payout to a card, phone (SBP), bank account number, or by NSPK QR.
| ПараметрParameter | ТипType | ОбязательныйRequired | ОписаниеDescription |
|---|---|---|---|
order_id | string | ДаYes | Уникальный идентификатор выплатыUnique payout identifier |
cred | string | ДаYes | Номер карты, телефон для СБП, номер счёта (при cred_type = 3) или ссылка НСПК https://qr.nspk.ru/<32 символа> (при cred_type = 4, до 1024 байт)Card number, phone for SBP, bank account number (when cred_type = 3), or NSPK payment link https://qr.nspk.ru/<32 characters> (when cred_type = 4, up to 1024 bytes) |
cred_type | integer | ДаYes | 1 — карта, 2 — СБП, 3 — номер счёта (пополнение и выплаты), 4 — QR НСПК (только выплаты, только для мерчантов, подключённых к выплатам по QR; иначе ошибка 108)1 — card, 2 — SBP, 3 — bank account number (payins and payouts), 4 — NSPK QR (payouts only, only for merchants enabled for QR payouts; otherwise error 108) |
amount | string | ДаYes | Сумма выплаты в рублях. Для cred_type = 4 — необязателен, если в QR зашита сумма (берётся из НСПК; переданное значение должно совпасть, иначе 122); обязателен, если в QR суммы нет (123)Payout amount in RUB. For cred_type = 4 it is optional when the QR has a fixed amount (taken from NSPK; a supplied value must match, otherwise 122); required when the QR has no amount (123) |
recipient_name | string | Для счёта — даYes for account | Имя получателя. Обязательно при cred_type = 3, для карты и СБП — по желанию. Для QR НСПК подставляется название получателя из НСПК (до 100 символов)Recipient name. Required when cred_type = 3, optional for card and SBP. For NSPK QR the recipient name returned by NSPK is used (up to 100 characters) |
receiver_bank | string | НетNo | Название банка получателя (для СБП и счёта)Recipient bank name (for SBP and account) |
{
"order_id": "payout-test-1",
"cred": "2202206898864454",
"cred_type": 1,
"amount": "2000.00"
}
{
"order_id": "payout-test-2",
"cred": "+79001234567",
"cred_type": 2,
"amount": "2000.00",
"recipient_name": "Иван И.",
"receiver_bank": "Сбер"
}
{
"order_id": "payout-test-3",
"cred": "40817810000000000001",
"cred_type": 3,
"amount": "2000.00",
"recipient_name": "Иванов Иван Иванович",
"receiver_bank": "Сбер"
}
{
"order_id": "payout-test-4",
"cred": "https://qr.nspk.ru/BD1000EXAMPLE0000000000000000000",
"cred_type": 4
}
{
"status": "ok",
"amount": "2000",
"commission": "40",
"final_amount": "2040",
"payout_id": "12813",
"payout_type": "CARD",
"cred_formatted": "2202 2068 9886 4454",
"currency": { "id": "1", "code": "RUB", "title": "RUB" },
"receiver_country": "RUS",
"receiver_bank": "Сбер",
"bank_info": { "name": "Сбер", "country": "RUS", "payment_system": "Visa" }
}
{
"status": "ok",
"amount": 2000,
"commission": 40,
"final_amount": 2040,
"payout_id": "12814",
"payout_type": "SBP",
"cred_formatted": "+7 (900) 123-45-67",
"currency": { "id": "1", "code": "RUB", "title": "RUB" },
"recipient_name": "Иван И.",
"receiver_country": "RU",
"country_info": { "country": "Russia", "code": "+7", "name": "Россия", "iso": "RU" },
"country_iso": "RU",
"receiver_bank": "Сбер"
}
{
"status": "ok",
"amount": 2000,
"commission": 40,
"final_amount": 2040,
"payout_id": "12815",
"payout_type": "ACCOUNT",
"cred_formatted": "40817810000000000001",
"currency": { "id": "1", "code": "RUB", "title": "RUB" },
"recipient_name": "Иванов Иван Иванович"
}
{
"status": "ok",
"amount": 1000,
"commission": 25,
"final_amount": 1025,
"payout_id": "12816",
"payout_type": "QR",
"cred_formatted": "https://qr.nspk.ru/BD1000EXAMPLE0000000000000000000",
"currency": { "id": "1", "code": "RUB", "title": "RUB" },
"recipient_name": "Название получателя из НСПК"
}
| ПолеField | ТипType | ОписаниеDescription |
|---|---|---|
amount | string | Исходная сумма выплатыOriginal payout amount |
commission | string | Комиссия системыSystem commission |
final_amount | string | Итоговая сумма с комиссиейTotal amount including commission |
payout_id | string | ID выплаты в системеPayout ID in the system |
payout_type | string | Тип выплаты (CARD, SBP, ACCOUNT, QR)Payout type (CARD, SBP, ACCOUNT, QR) |
cred_formatted | string | Форматированный номер получателя (для QR — ссылка НСПК)Formatted receiver number (NSPK link for QR) |
currency | object | Информация о валютеCurrency information |
recipient_name | string | Имя получателя (если передано)Recipient name (if provided) |
receiver_country | string | Страна получателяReceiver country |
country_info, country_iso | object, string | Страна по номеру телефона (только СБП)Country detected from the phone number (SBP only) |
receiver_bank | string | Банк получателя (для СБП — если передан)Receiver bank (for SBP — if provided) |
bank_info | object | Детальная информация о банкеDetailed bank information |
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
101 | 401 | API-токен отсутствует; мерчант не найден или не активен (API token is required / Merchant not found or not active).Missing API token; merchant not found or inactive. |
403 | 403 | IP address is not allowed — IP отправителя отсутствует в разрешённом списке мерчанта.IP address is not allowed — caller IP is not on the merchant allowlist. |
104 | 409 | Order ID already exists — идентификатор выплаты уже занят.Order ID already exists. |
106 | 400 | Invalid card number — неверный номер карты.Invalid card number. |
107 | 400 | Invalid phone number format.Invalid phone number format. |
108 | 400 | Invalid cred_type (в том числе cred_type = 4 для мерчанта без выплат по QR).Invalid cred_type (including cred_type = 4 for a merchant not enabled for QR payouts). |
109 | 422 | Insufficient balance — недостаточно средств с учётом комиссии.Insufficient balance including commission. |
112 | 500 | Default currency (RUB) not found in database — ошибка настройки валюты.Default currency (RUB) not found in database. |
114 | 403 | Payouts are disabled for this merchant — выплаты отключены.Payouts are disabled for this merchant. |
115 | 400 | order_id обязателен: 1–255 байт после удаления пробелов по краям; значения NOW() и NULL зарезервированы.order_id is required: 1–255 bytes after trimming; NOW() and NULL are reserved. |
116 | 400 | recipient_name is required for cred_type 3 (account payout).recipient_name is required for cred_type 3 (account payout). |
117 | 400 | Account number is required.Account number is required. |
118 | 400 | QR payload is required — не передан QR (cred_type = 4).QR payload is required (cred_type = 4). |
119 | 400 | QR payload must not exceed 1024 bytes.QR payload must not exceed 1024 bytes. |
120 | 400 | QR payload must be an NSPK payment link https://qr.nspk.ru/<id> — принимаются только ссылки НСПК.QR payload must be an NSPK payment link https://qr.nspk.ru/<id>. |
121 | 400 | НСПК отклонила ссылку или недоступна; в тексте ошибки — код и сообщение НСПК (например, ссылка истекла).NSPK rejected the link or is unavailable; the message contains the NSPK code and text (for example, the link has expired). |
122 | 400 | amount does not match NSPK payment link amount — переданная сумма не совпадает с суммой в QR.amount does not match the NSPK payment link amount. |
123 | 400 | amount is required: NSPK payment link has no fixed amount — в QR нет суммы, передайте amount.amount is required: the NSPK payment link has no fixed amount. |
400 | 400 | Некорректная amount: требуется число от 0.01 до 99999999.99, не более двух знаков после точки. Проверка действует для v1, v2 и SP payout/create.Invalid amount: must be between 0.01 and 99999999.99 with at most two decimal places. Applies to v1, v2 and SP payout/create. |
Получение текущего статуса выплаты. Можно передать payout_id или order_id.
Get the current payout status. Pass either payout_id or order_id.
{ "payout_id": 12813 }
// или / or
{ "order_id": "payout-test-1" }
{
"status": "ok",
"payout_id": "12813",
"order_id": "payout-test-1",
"type": "CARD",
"amount": "2000.00",
"commission": "40.00",
"payout_status": "NEW",
"created_at": "2025-10-15 22:56:06",
"updated_at": "2025-10-15 22:56:06",
"cred_formatted": "2202 2068 9886 4454",
"currency": { "id": "1", "code": "RUB", "title": "RUB" },
"receiver_country": "RUS",
"receiver_bank": "Сбер",
"bank_info": { "name": "Сбер", "country": "RUS", "payment_system": "Visa" }
}
| СтатусStatus | ОписаниеDescription |
|---|---|
NEW | Новая выплата, ожидает обработкиNew payout, awaiting processing |
PROCESSING | Выплата в обработкеPayout in processing |
COMPLETED | Выплата выполнена успешноPayout completed successfully |
FAILED | Выплата не удаласьPayout failed |
CANCELLED | Выплата отмененаPayout cancelled |
Возвращает данные выплаты вашего мерчанта, связанные чеки и извлечённые из них сведения. Заголовки: X-API-TOKEN и Content-Type: application/json. Версия этого метода — v1, в том числе для выплат, созданных через v2.
Returns your merchant's payout data, associated receipts and extracted receipt details. Headers: X-API-TOKEN and Content-Type: application/json. This endpoint uses v1, including for payouts created through v2.
| ПараметрParameter | ТипType | ОписаниеDescription |
|---|---|---|
payout_id | integer | Внутренний ID выплаты. Имеет приоритет, если переданы оба идентификатора.Internal payout ID. Takes precedence when both identifiers are supplied. |
order_id | string | Ваш идентификатор выплаты, переданный при создании. Используется, если не передан payout_id.Your payout identifier supplied at creation. Used when payout_id is not supplied. |
Обязателен хотя бы один идентификатор: payout_id или order_id.
At least one identifier is required: payout_id or order_id.
curl -X POST 'https://api.pspay.io/api/v1/payout/details' \
-H 'X-API-TOKEN: YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"order_id":"payout-test-1"}'
| ПолеField | ОписаниеDescription |
|---|---|
status | ok при успешном запросе.ok for a successful request. |
payout_data | Объект выплаты: payout_id (строка), order_id, type (CARD/SBP/ACCOUNT/QR), cred_type (1/2/3/4), amount, filled_amount, commission, trader_commission, payout_status, created_at, updated_at, cred_formatted, recipient_name.Payout object: payout_id (string), order_id, type (CARD/SBP/ACCOUNT/QR), cred_type (1/2/3/4), amount, filled_amount, commission, trader_commission, payout_status, created_at, updated_at, cred_formatted, recipient_name. |
payout_data.currency | Валюта: id, code, title. Возвращается, если валюта найдена.Currency: id, code, title. Returned when currency information is available. |
checks | Массив чеков. Каждый элемент содержит id, check_url, date, amount, created_at, receiving_bank, sender, recipient, bank. При наличии деталей добавляется parsed_details (разобранный JSON) либо raw_details (исходная строка).Receipt array. Each item contains id, check_url, date, amount, created_at, receiving_bank, sender, recipient, bank. Available details are added as parsed_details (decoded JSON) or raw_details (original text). |
checks_count | Количество элементов в checks.Number of items in checks. |
total_checks_amount | Сумма amount по всем возвращённым чекам.Sum of amount across all returned receipts. |
В payout_data также могут присутствовать receiver_country, receiver_bank, bank_info, country_info, country_iso, sender_names_from_checks и recipient_names_from_checks. При отсутствии чеков checks пустой, checks_count и total_checks_amount равны 0. Если вместо отдельных чеков сохранена общая ссылка на чек выплаты, она возвращается в checks с id: null; некоторые поля такого чека также могут быть null.
payout_data may also include receiver_country, receiver_bank, bank_info, country_info, country_iso, sender_names_from_checks and recipient_names_from_checks. Without receipts, checks is empty and both totals are 0. If only a payout-level receipt URL is stored, it is returned in checks with id: null; other receipt fields may also be null.
Ошибки: 101 → HTTP 401 — токен отсутствует или мерчант неактивен; 403 → HTTP 403 — IP не разрешён; 111 → HTTP 400 — не передан идентификатор; 110 → HTTP 404 — выплата мерчанта не найдена. Формат: status: "error", error_message, code. Общие ошибки API.
Errors: 101 → HTTP 401 — missing token or inactive merchant; 403 → HTTP 403 — IP not allowed; 111 → HTTP 400 — missing identifier; 110 → HTTP 404 — merchant payout not found. Format: status: "error", error_message, code. Common API errors.
Получение списка выплат с фильтрацией по статусу.
Get a list of payouts filtered by status.
{ "status": "COMPLETED" }
{
"status": "ok",
"payouts": [
{
"payout_id": "2854",
"order_id": "TEST-U-5",
"type": "CARD",
"cred_type": 1,
"amount": "1000.00",
"filled_amount": "1000.00",
"commission": "20.00",
"trader_commission": "20.00",
"payout_status": "COMPLETED",
"created_at": "2025-09-11 14:02:18",
"updated_at": "2025-09-30 19:21:09",
"cred_formatted": "2202 2068 9886 4454",
"recipient_name": "Жасмин Н",
"currency": { "id": "1", "code": "RUB", "title": "RUB" }
}
]
}
API для работы с апелляциями по спорным транзакциям.
API for managing appeals on disputed transactions.
Открытие апелляции по спорной транзакции.
Open an appeal for a disputed transaction.
| ПараметрParameter | ТипType | ОбязательныйRequired | ОписаниеDescription |
|---|---|---|---|
order_id | string | ДаYes | ID ордера, к которому относится апелляцияOrder ID for this appeal |
comments | string | ДаYes | Описание проблемыProblem description |
{
"order_id": "order12345",
"comments": "Проблема с оплатой, прошу разобраться."
}
{
"status": "ok",
"appeal_id": 12893,
"upload_url": "https://api.pspay.io/appeal/upload?hash=2ef5ab8fe857b4f1..."
}
Загрузка подтверждающего скриншота через multipart/form-data с полем file. Хеш берётся из ответа метода создания апелляции.
Upload a confirming screenshot via multipart/form-data with field file. The hash comes from the appeal create response.
curl -X POST -F 'file=@/path/to/screenshot.png' \
"https://api.pspay.io/appeal/upload?hash=2ef5ab8fe857b4f1..."
{
"status": "ok",
"file_url": "https://minio.pspay.io/my-bucket/appeal_screenshot_2ef5ab8f...pdf"
}
{ "appeal_id": 12893 }
{
"status": "ok",
"appeal_data": {
"appeal_id": "12893",
"order_id": "299147",
"status": "1",
"comments": "Проблема с оплатой, прошу разобраться.",
"screenshot": "https://minio.pspay.io/my-bucket/appeal_screenshot_...pdf",
"order_data": {
"id": "299147",
"external_id": "order12345",
"amount": "1000.00",
"amount_initial": "1000.00",
"datetime": "2025-10-15 22:12:08",
"executed_datetime": null,
"cred": "4111111111111111"
}
}
}
| ID | ОписаниеDescription |
|---|---|
| 1 | Новая, ожидает обработкиNew, awaiting processing |
| 2 | Отклонена — фейковый чекRejected — fake receipt |
| 3 | Отклонена — нет оплатыRejected — no payment |
| 4 | Отклонена — неверная суммаRejected — incorrect amount |
| 5 | Удовлетворена — исполнить ордерApproved — execute order |
| 6 | Удовлетворена — изменить сумму и исполнитьApproved — change amount and execute |
| 7 | Отправлена на модерациюSent for moderation |
{ "status": 1 }
{
"status": "ok",
"appeals": [
{
"appeal_id": "12893",
"appeal_datetime": "2025-10-15 22:32:08",
"amount": "1000.00",
"transaction": {
"datetime": "2025-10-15 22:12:08",
"id": "299147",
"merchant_order_id": "order12345"
},
"status": "1",
"comment": "Проблема с оплатой, прошу разобраться.",
"screenshot": "https://minio.pspay.io/my-bucket/appeal_screenshot_...pdf"
}
]
}
Получение текущего баланса и статистики по транзакциям.
Get current balance and transaction statistics.
{ "currency_mode": "base" }
{
"status": "ok",
"currency_mode": "RUB",
"overalls": {
"tx_count": "115",
"amount": "15351.00",
"merchant_commission": "768.30"
},
"created": {
"tx_count": "100",
"amount": "76712.00",
"merchant_commission": "3915.20"
},
"payouts": 0,
"instant_payouts": "0.00",
"available": "14582.70",
"conversion": "15",
"balance": "14582.70"
}
| ПолеField | ОписаниеDescription |
|---|---|
currency_mode | Режим просмотра валютыCurrency mode |
overalls.tx_count | Количество исполненных транзакцийCompleted transaction count |
overalls.amount | Общая сумма исполненных транзакцийTotal completed transactions amount |
overalls.merchant_commission | Комиссия мерчантаMerchant commission |
available | Доступный балансAvailable balance |
conversion | Конверсия (%)Conversion rate (%) |
balance | Текущий балансCurrent balance |
API для проверки доступности и работоспособности системы.
API for checking system availability and health.
Успешный ответ подтверждает, что API работает корректно.
A successful response confirms the API is functioning correctly.
200 OK{ "status": "ok" }
<?php
require_once 'pspay_client.php';
$api = new PspayApiClient('your_api_token');
// Создать ордер / Create order
$order = $api->createOrder(
orderId: 'ORDER_' . time(),
customerId: '781',
amount: 500,
credType: 1,
currency: 'RUB',
submerchantId: 'shop_alpha'
);
// Для части гео (напр. Турция / TRY) передайте customerName: '...' последним аргументом createOrder.
echo "Order: " . $order['order_id'] . "\n";
echo "Card: " . $order['cred_formatted'] . "\n";
echo "Bank: " . $order['bank_name'] . "\n";
echo "Link: " . $order['redirect_url'] . "\n";
// Статус / Status
$status = $api->orderStatus('ORDER_' . time());
echo "Status: " . $status['status_id'] . "\n";
// Выплата / Payout
$payout = $api->createPayout(
orderId: 'PAY_' . time(),
amount: 300,
cred: '4441111065570016',
credType: 1
);
echo "Payout: " . $payout['payout_id'] . "\n";
import requests
class PspayAPI:
BASE = 'https://api.pspay.io'
def __init__(self, api_token):
self.headers = {
'Content-Type': 'application/json',
'X-API-TOKEN': api_token,
}
def _post(self, path, data):
r = requests.post(self.BASE + path, headers=self.headers, json=data)
r.raise_for_status()
return r.json()
def create_order(self, order_id, customer_id, amount, cred_type=1, currency='RUB', customer_name=None, submerchant_id=None):
payload = {
'order_id': order_id,
'customer_id': customer_id,
'amount': amount,
'cred_type': cred_type,
'currency': currency,
}
if customer_name:
payload['customer_name'] = customer_name
if submerchant_id:
payload['submerchant_id'] = submerchant_id
return self._post('/api/v1/order/create', payload)
def order_status(self, order_id):
return self._post('/api/v1/order/status', {'order_id': order_id})
def create_payout(self, order_id, amount, cred, cred_type=1):
return self._post('/api/v1/payout/create', {
'order_id': order_id,
'amount': amount,
'cred': cred,
'cred_type': cred_type,
})
api = PspayAPI('your_api_token')
order = api.create_order('ORDER_001', '781', 500, submerchant_id='shop_alpha')
# order = api.create_order('ORDER_TR_001', 'user-1', 1500, cred_type=1, currency='TRY', customer_name='Mehmet Yilmaz')
print(f"Card: {order['cred_formatted']}")
print(f"Bank: {order['bank_name']}")
print(f"Link: {order['redirect_url']}")
status = api.order_status('ORDER_001')
print(f"Status: {status['status_id']}")
payout = api.create_payout('PAY_001', 300, '4441111065570016')
print(f"Payout: {payout['payout_id']}")
// Node.js 18+ (native fetch)
const BASE_URL = 'https://api.pspay.io';
const API_TOKEN = 'your_api_token';
async function apiPost(path, body) {
const res = await fetch(BASE_URL + path, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-TOKEN': API_TOKEN,
},
body: JSON.stringify(body),
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
return res.json();
}
// Создать ордер / Create order
const order = await apiPost('/api/v1/order/create', {
order_id: 'ORDER_' + Date.now(),
customer_id: '781',
submerchant_id: 'shop_alpha',
amount: 500,
cred_type: 1,
currency: 'RUB',
// customer_name: 'Mehmet Yilmaz', // для части гео обязательно, напр. TR / Turkey
});
console.log('Card: ', order.cred_formatted);
console.log('Bank: ', order.bank_name);
console.log('Link: ', order.redirect_url);
// Статус / Status
const status = await apiPost('/api/v1/order/status', {
order_id: order.order_id,
});
console.log('Status:', status.status_id);
// Выплата / Payout
const payout = await apiPost('/api/v1/payout/create', {
order_id: 'PAY_' + Date.now(),
amount: 300,
cred: '4441111065570016',
cred_type: 1,
});
console.log('Payout:', payout.payout_id);
Код code / error_code в JSON не равен HTTP-статусу. Значение кода зависит от метода. Проверяйте HTTP и тело ответа; сообщения могут содержать динамические значения. Таблицы описывают текущие публичные обработчики API.
JSON code / error_code is distinct from HTTP status and depends on the endpoint. Check both HTTP and the response body; messages may contain dynamic values. Tables describe the current public API handlers.
Основной формат: {"status":"error","code":104,"error_message":"Order ID already exists"}. Исключение, обработанное роутером (включая ошибки создания v1/v2): {"status":"error","error_code":104,"error_description":"Order ID already exists"}. Оба примера имеют HTTP 409.
Main format: {"status":"error","code":104,"error_message":"Order ID already exists"}. Router-handled exceptions (including v1/v2 creation failures): {"status":"error","error_code":104,"error_description":"Order ID already exists"}. Both examples use HTTP 409.
Неизвестный код также считайте ошибкой: исключения без кода возвращают 0 (HTTP 500); код 400–599 передаётся как HTTP-статус. Остальные бизнес-коды по умолчанию дают HTTP 400. При таймауте или неоднозначном результате создания сначала запросите статус по исходному order_id.
Treat unknown codes as failures too: exceptions without a code return 0 (HTTP 500); codes 400–599 are used as HTTP status. Other business codes default to HTTP 400. After a timeout or ambiguous creation result, query status using the original order_id first.
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
101 | 401 | API-токен отсутствует; мерчант не найден или не активен (API token is required / Merchant not found or not active).Missing API token; merchant not found or inactive. |
403 | 403 | IP address is not allowed — IP отправителя отсутствует в разрешённом списке мерчанта.IP address is not allowed — caller IP is not on the merchant allowlist. |
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
102 | 400 | Сумма ниже минимальной в обработчике подбора. В общем потоке v1/v2/v4 предварительная проверка возвращает 106.Amount below minimum in the selection handler. The shared v1/v2/v4 precheck returns 106. |
103 | 400 | Превышена максимальная сумма; customer_id is required; Customer is not allowed; Customer is blocked; submerchant_id is required / is not registered.Maximum amount exceeded; missing, disallowed or blocked customer; missing or unregistered submerchant. |
104 | 409 | Order ID already exists / Order ID is already being processed — дубликат или параллельное создание. Перед повтором проверьте статус.Duplicate order ID or concurrent creation. Check order status before retrying. |
105 | 400 | Invalid cred_type — неверный тип реквизитов.Invalid cred_type. |
106 | 400 | Нет подходящих реквизитов/провайдера, сумма ниже минимума, субмерчант временно отключён (Merchant is temporary disabled), ошибка создания/проверки ордера. Возможен текст отказа провайдера.No suitable credentials/provider, amount below minimum, temporarily disabled submerchant, or order creation/verification failure. Provider rejection text may be returned. |
108 | 400 | Payment type … is not allowed for this merchant — тип оплаты запрещён мерчанту (v4).Payment type is not allowed for this merchant (v4). |
109 | 422 | Отказ при подборе/резервировании: клиент не подходит, реквизит или трейдер занят/отключён, изменились лимиты, маршрут, интервал или доступный депозит. Итоговый отказ после повторного подбора/каскада может быть 106.Selection/reservation rejected: customer eligibility, busy/disabled credential or trader, changed limits, routing, interval or available deposit. Final selection/cascade failure may return 106. |
110 | 404 | Invalid lifetime — некорректное время жизни ордера. Текущий HTTP-статус для этого кода — 404.Invalid lifetime. The current HTTP status for this business code is 404. |
1011 | 400 | Merchant's USDT rate not found — курс мерчанта не настроен.Merchant's USDT rate not found. |
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
106 | 400 | Order not found — ордер мерчанта не найден (HTTP 400).Order not found (HTTP 400). |
107 | 400 | Order ID or Transaction ID is required.Order ID or Transaction ID is required. |
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
106 | 400 | Order not found — ордер мерчанта не найден (HTTP 400).Order not found (HTTP 400). |
107 | 400 | Order ID or Transaction ID is required.Order ID or Transaction ID is required. |
109 | 422 | Нет подходящих альтернативных реквизитов.No suitable alternative credentials. |
110 | 404 | Неподдерживаемый fallback (Invalid fallback) или ошибка выбора банка плательщика (payer_bank); HTTP 404.Invalid fallback or payer-bank selection error (payer_bank); HTTP 404. |
114 | 403 | Order cannot change cred in current status / Payment method not available for this merchant — замена запрещена состоянием ордера, апелляцией или настройками метода.Current order status, appeal or merchant payment-method settings prohibit replacement. |
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
104 | 409 | Order ID already exists — идентификатор выплаты уже занят.Order ID already exists. |
106 | 400 | Invalid card number — неверный номер карты.Invalid card number. |
107 | 400 | Invalid phone number format.Invalid phone number format. |
108 | 400 | Invalid cred_type (в том числе cred_type = 4 для мерчанта без выплат по QR).Invalid cred_type (including cred_type = 4 for a merchant not enabled for QR payouts). |
109 | 422 | Insufficient balance — недостаточно средств с учётом комиссии.Insufficient balance including commission. |
112 | 500 | Default currency (RUB) not found in database — ошибка настройки валюты.Default currency (RUB) not found in database. |
114 | 403 | Payouts are disabled for this merchant — выплаты отключены.Payouts are disabled for this merchant. |
115 | 400 | order_id обязателен: 1–255 байт после удаления пробелов по краям; значения NOW() и NULL зарезервированы.order_id is required: 1–255 bytes after trimming; NOW() and NULL are reserved. |
116 | 400 | recipient_name is required for cred_type 3 (account payout).recipient_name is required for cred_type 3 (account payout). |
117 | 400 | Account number is required.Account number is required. |
118 | 400 | QR payload is required — не передан QR (cred_type = 4).QR payload is required (cred_type = 4). |
119 | 400 | QR payload must not exceed 1024 bytes.QR payload must not exceed 1024 bytes. |
120 | 400 | QR payload must be an NSPK payment link https://qr.nspk.ru/<id> — принимаются только ссылки НСПК.QR payload must be an NSPK payment link https://qr.nspk.ru/<id>. |
121 | 400 | НСПК отклонила ссылку или недоступна; в тексте ошибки — код и сообщение НСПК (например, ссылка истекла).NSPK rejected the link or is unavailable; the message contains the NSPK code and text (for example, the link has expired). |
122 | 400 | amount does not match NSPK payment link amount — переданная сумма не совпадает с суммой в QR.amount does not match the NSPK payment link amount. |
123 | 400 | amount is required: NSPK payment link has no fixed amount — в QR нет суммы, передайте amount.amount is required: the NSPK payment link has no fixed amount. |
400 | 400 | Некорректная amount: требуется число от 0.01 до 99999999.99, не более двух знаков после точки. Проверка действует для v1, v2 и SP payout/create.Invalid amount: must be between 0.01 and 99999999.99 with at most two decimal places. Applies to v1, v2 and SP payout/create. |
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
110 | 404 | Payout not found — выплата мерчанта не найдена.Payout not found. |
111 | 400 | Either payout_id or order_id must be provided.Either payout_id or order_id must be provided. |
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
103 | 400 | external_id is required / Submerchant with this external_id already exists.external_id is required / Submerchant with this external_id already exists. |
103 | 400 | external_id is required / title or url is required / Submerchant not found.external_id is required / title or url is required / Submerchant not found. |
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
400 | 400 | Некорректная дата (ожидается YYYY-MM-DD), page < 1 или page_size вне 1–1000. Без пагинации обязателен полный диапазон дат не длиннее 31 дня; максимум 10000 ордеров в ответе.Invalid YYYY-MM-DD date, page < 1 or page_size outside 1–1000. Without pagination, a complete date range of at most 31 days is required; at most 10000 orders per response. |
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
102 | 400 | Invalid currency_mode. Allowed values: 'base', 'usdt'.Invalid currency_mode. Allowed values: 'base', 'usdt'. |
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
102 | 400 | Необходимо передать Order ID.Order ID is required. |
104 | 409 | Заказ для данного мерчанта не найден (HTTP 409).Order not found for this merchant (HTTP 409). |
105 | 400 | Диспут по этому заказу уже существует, создать новый нельзя.An appeal already exists and a new one cannot be created. |
107 | 400 | Не передан чек при обязательной загрузке receipt.Receipt is missing when required. |
108 | 400 | Invalid base64 receipt либо недопустимое содержимое файла.Invalid base64 receipt or invalid file contents. |
109 | 422 | Receipt too large (max 5 MB) — превышен лимит декодированного base64-чека.Decoded base64 receipt exceeds 5 MB. |
110 | 404 | Ордер уже исполнен — открытие диспута недоступно (HTTP 404).Order already completed; opening an appeal is unavailable (HTTP 404). |
111 | 400 | Срок открытия диспута истёк; срок указан в сообщении.Appeal creation window expired; the message specifies the window. |
404 | 404 | Апелляция не найдена для загрузки чека.Appeal not found for receipt upload. |
500 | 500 | Не удалось сохранить или загрузить чек.Failed to save or upload receipt. |
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
400 | 400 | Необходимо передать Appeal ID.Appeal ID is required. |
404 | 404 | Апелляция не найдена.Appeal not found. |
Отдельный формат: {"error":"Hash is required"} (400), File is required (400), Appeal not found (404). Ошибка проверки/сохранения: {"error":"Invalid file","message":"…"}, HTTP 400 при неверном файле и 500 при сбое загрузки. Числового кода в JSON нет.
Separate format: {"error":"Hash is required"} (400), File is required (400), Appeal not found (404). Validation/storage failure: {"error":"Invalid file","message":"…"}, HTTP 400 for invalid files and 500 for upload failures. No numeric JSON code.
Поле message при Invalid file: Cannot read uploaded file; File too small (меньше 100 байт); Invalid file content (not a receipt image, PDF or video); Unsupported file type (allowed: PDF, JPEG, PNG, WEBP, MP4, WebM, MOV); Video too large (max 64 MB); Cannot extract PDF from signed receipt; Cannot normalize uploaded file; Error uploading file: … (HTTP 500). Лимит 5 MB выше относится к base64 receipt, а не к multipart-загрузке.
Invalid file message values: Cannot read uploaded file; File too small (under 100 bytes); Invalid file content (not a receipt image, PDF or video); Unsupported file type (allowed: PDF, JPEG, PNG, WEBP, MP4, WebM, MOV); Video too large (max 64 MB); Cannot extract PDF from signed receipt; Cannot normalize uploaded file; Error uploading file: … (HTTP 500). The 5 MB limit above applies to base64 receipt, not multipart upload.
Ошибки имеют success: false, error_code, error. У ecom/create дополнительно status: "error", действует общая HTTP-карта выше. У ecom/init, ecom/process, ecom/status бизнес-коды вне 400–599 дают HTTP 500, в том числе 101 и 104. Невалидный JSON обрабатывается роутером до ECOM: HTTP 400, status/error_code/error_description.
Errors contain success: false, error_code, error. ecom/create also includes status: "error" and uses the common HTTP mapping above. For ecom/init, ecom/process, ecom/status, business codes outside 400–599 use HTTP 500, including 101 and 104. Invalid JSON is handled before ECOM by the router: HTTP 400, status/error_code/error_description.
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
101 | 500 | API-токен отсутствует, мерчант не найден/не активен.Missing API token or merchant not found/inactive. |
403 | 403 | IP address is not allowed — IP отправителя отсутствует в разрешённом списке мерчанта.IP address is not allowed — caller IP is not on the merchant allowlist. |
103 | 500 | Сумма превышает максимум мерчанта.Amount exceeds merchant maximum. |
104 | 500 | Order ID already exists / Order ID is already being processed.Order ID already exists / Order ID is already being processed. |
106 | 500 | Сумма ниже минимума, нет доступного ECOM-терминала или ошибка его настройки.Amount below minimum, no available ECOM terminal or terminal configuration error. |
112 | 500 | Default currency not found in database.Default currency not found in database. |
500 | 500 | Ошибка создания/проверки ордера или платёжного провайдера.Order creation/verification or payment provider failure. |
400 | 400 | order_id is required / amount is required and must be numeric / amount must be greater than 0.order_id is required / amount is required and must be numeric / amount must be greater than 0. |
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
101 | 401 | API-токен отсутствует, мерчант не найден/не активен.Missing API token or merchant not found/inactive. |
403 | 403 | IP address is not allowed — IP отправителя отсутствует в разрешённом списке мерчанта.IP address is not allowed — caller IP is not on the merchant allowlist. |
103 | 400 | Сумма превышает максимум мерчанта.Amount exceeds merchant maximum. |
104 | 409 | Order ID already exists / Order ID is already being processed.Order ID already exists / Order ID is already being processed. |
106 | 400 | Сумма ниже минимума, нет доступного ECOM-терминала или ошибка его настройки.Amount below minimum, no available ECOM terminal or terminal configuration error. |
112 | 500 | Default currency not found in database.Default currency not found in database. |
400 | 400 | Не переданы amount / card_pan / card_expire / card_cvv либо срок карты истёк (Card has expired).Missing amount / card_pan / card_expire / card_cvv or expired card. |
500 | 500 | Ошибка создания/проверки ордера или платёжного провайдера.Order creation/verification or payment provider failure. |
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
101 | 500 | API-токен отсутствует, мерчант не найден/не активен.Missing API token or merchant not found/inactive. |
403 | 403 | IP address is not allowed — IP отправителя отсутствует в разрешённом списке мерчанта.IP address is not allowed — caller IP is not on the merchant allowlist. |
104 | 500 | Order ID is already being processed.Order ID is already being processed. |
400 | 400 | Не переданы order_id / card_pan / card_expire / card_cvv, карта просрочена или Order cannot be processed, current status: …Missing order_id / card_pan / card_expire / card_cvv, expired card or invalid order status. |
404 | 404 | Order not found.Order not found. |
500 | 500 | Ошибка платёжного провайдера.Payment provider failure. |
| Код JSONJSON code | HTTP | ОписаниеDescription |
|---|---|---|
101 | 500 | API-токен отсутствует, мерчант не найден/не активен.Missing API token or merchant not found/inactive. |
403 | 403 | IP address is not allowed — IP отправителя отсутствует в разрешённом списке мерчанта.IP address is not allowed — caller IP is not on the merchant allowlist. |
400 | 400 | order_id is required.order_id is required. |
404 | 404 | Order not found / ECOM transaction not found.Order not found / ECOM transaction not found. |
ECOM create/process также передают код отказа платёжного провайдера из диапазона 400–599; иначе используют 500. Текст начинается с Failed to create ECOM payment / Failed to create payment.
ECOM create/process also propagate payment provider error codes in the 400–599 range, otherwise using 500. Messages start with Failed to create ECOM payment / Failed to create payment.
400 — неверный JSON (Invalid JSON: …) / URI / параметры; 401 — авторизация; 403 — IP или операция запрещены; 404 — маршрут или объект не найден (также бизнес-код 110); 409 — конфликт/дубликат (также код 104 апелляции); 422 — бизнес-код 109; 500 — внутренняя ошибка. 501 Method not implemented — для HTTP-метода вообще нет маршрутов; если метод известен, но путь ему не соответствует, возвращается 404 Route not found. Ошибки маршрута содержат error, requested_uri, requested_method.
400 — invalid JSON (Invalid JSON: …), URI or parameters; 401 — authentication; 403 — forbidden IP or operation; 404 — missing route/object (also business code 110); 409 — conflict/duplicate (also appeal code 104); 422 — business code 109; 500 — internal failure. 501 Method not implemented means no routes exist for the HTTP method; a known method with no matching path returns 404 Route not found. Routing errors contain error, requested_uri, requested_method.