API платёжного шлюза интернет-эквайринга Help

Базовые запросы

API использует JSON для обмена данными.

{ "order": { "typeRid": "Purchase", "amount": 100.00, "currency": "RUB", "title": "Название заказа", "description": "Описание заказа", "hppRedirectUrl":"https://pgtest.bspb.ru/result" } }

Примеры выполнения запросов

Создание заказа

Первоначальный и обязательный запрос

Запрос

{ "order": { "typeRid": "Purchase", "amount": 100.00, "currency": "RUB", "title": "Название заказа", "description": "Описание заказа", "hppRedirectUrl":"https://pgtest.bspb.ru/result" } }

Ответ

{ "order": { "id": 2000000004730, "hppUrl": "https://pgtest.bspb.ru/flex", "password": "11r23x81ncu2k", "accessToken": "0-cNtluTUmf9FGyx6IlTBaL8IXKmIyx26lTj8dixAJPV8", "status": "Preparing", "cvv2AuthStatus": "Required" } }

Отмена (reverse)

Запрос

{ "tran": { "phase": "Single", "voidKind": "Partial", "amount": 50.00 } }

Ответ

{ "tran": { "approvalCode": "004545", "approvedPartial": false, "match": { "tranActionId": "230822-07063337-00300r=", "ridByPmo": "230822255935240835" } } }

Возврат (refund)

Запрос

{ "tran": { "type": "Refund", "phase": "Single", "amount": 50.00 } }

Ответ

{ "tran": { "approvalCode": "716684", "approvedPartial": false, "match": { "tranActionId": "231216-21365573-003y6v=", "ridByPmo": "231216778160538495" } } }

Информация по заказу

Ответ

{ "order": { "id": 2000000004730, "typeRid": "Purchase", "status": "FullyPaid", "prevStatus": "Preparing", "lastStatusLogin": "TT00001", "amount": 300, "currency": "RUB", "createTime": "2023-12-16 22:52:57", "title": "Название заказа", "expTime": "2023-12-17 00:52:57", "type": { "allowVoid": false, "title": "TWPGPurchase", "allowCVV2": false } } }

Детальная информация по заказу

Ответ

{ "order": { "id": 2000000004730, "hppUrl": "https://pgtest.bspb.ru/flex", "hppRedirectUrl": "https://pgtest.bspb.ru/payment_result", "password": "11r23x81ncu2k", "accessToken": "0-cNtluTUmf9FGyx6IlTBaL8IXKmIyx26lTj8dixAJPV8", "status": "FullyPaid", "prevStatus": "Preparing", "lastStatusLogin": "TT00001", "amount": 300, "currency": "RUB", "terminal": { "id": 38, "rid": "TT00001", "title": "TT00001", "mcc": 8062, "status": "Active" }, "srcAmount": 300, "srcAmountFull": 300, "srcCurrency": "RUB", "dstAmount": 300, "dstCurrency": "RUB", "createTime": "2023-12-16 22:52:57", "lastTran": { "approvalCode": "643027", "actionId": "231216-19541818-003y6b=", "orderId": 2000000004730, "terminalId": 38, "merchantId": 42, "billingStatus": "Normal", "isReversal": false, "ridByAcquirer": "231216716583438418", "ridByPmo": "231216716583438418", "regTime": "2023-12-16 22:54:18", "clearAmount": 300, "clearCcy": "RUB", "amount": 300, "currency": "RUB", "description": "Покупка", "phase": "Single", "type": "Purchase", "pmoResultCode": "Approved", "receiptContent": { "consumer": { "email": "pg@bspb.ru", "phone": "+79211234567" }, "items": [ { "desc": "Товар 1", "quantity": 1, "price": 100.00, "taxRate": "1", "type": "1", "mode": "1" }, { "desc": "Товар 2", "quantity": 1, "price": 200.00, "taxRate": "1", "type": "2", "mode": "4" } ], "payments": [ { "type": 1, "amt": 300.00 } ], "taxRid": "7831000027", "taxSystemCode": "1" } }, "cvv2AuthStatus": "Provided", "tdsV1AuthStatus": "NotSupportedIss", "tdsV2AuthStatus": "Verified", "authorizedChargeAmount": 200, "clearedChargeAmount": 200, "clearedRefundAmount": 0, "title": "Название заказа", "description": "Описание заказа", "srcEmail": "pg@bspb.ru", "consumerDevice": { "browser": { "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Safari/605.1.15", "colorDepth": 24, "pixelRatio": 1, "language": "ru", "tzOffset": -180, "localStorage": false, "languageReplaced": false, "resolutionReplaced": false, "osReplaced": false, "browserReplaced": false, "screenW": 1920, "screenH": 1080, "screenAvailW": 1920, "screenAvailH": 1055, "platform": "MacIntel", "acceptHeader": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "ip": "127.0.0.1", "refUrl": "pgtest.bspb.ru", "javaEnabled": false, "jsEnabled": true } }, "merchant": { "id": 42, "rid": "TT00001", "title": "TT00001", "businessAddress": { "country": "RUS", "countryA2": "RU", "countryN3": 643 } }, "initiationEnvKind": "Browser", "expTime": "2023-12-17 00:52:57", "type": { "allowVoid": true, "hppTranPhase": "Single", "secretLength": 0, "title": "TWPGPurchase", "rid": "Purchase", "paymentMethods": [ "Card", "IpsRu", "MirPay" ], "cardBrands": [ "Mir", "Visa", "Mastercard", "UP" ], "allowTdsAttempt": false, "allowTdsCant": false, "allowTdsChallenged": false, "allowTranTypes": [ "Purchase", "Refund", "CheckToken" ], "allowAuthKinds": [ "Final", "Undefined" ], "allowCofStoreUsages": [ "Cit", "PartialShipment", "Instalment", "Recurring", "UnspecifiedMit", "DelayedCharge" ], "orderClass": "Sale", "allowCVV2": true }, "receipt": { "consumer": { "email": "pg@bspb.ru", "phone": "+79211234567" }, "items": [ { "desc": "Товар 1", "quantity": 1, "price": 100.00, "taxRate": "1", "type": "1", "mode": "1" }, { "desc": "Товар 2", "quantity": 1, "price": 200.00, "taxRate": "1", "type": "2", "mode": "4" } ], "payments": [ { "type": 1, "amt": 200.00 } ] }, "fdoKind": "PayKiosk", "custAttrs": [], "reportPubs": {} } }

Отмена заказа

Запрос

{ "order": { "status": "Refused" } }
11 сентября 2025