Flow: bank card
- CreateInvoice with
<UndefinedBankCardCustomer>(XML) or"customer":{"type":"undefined_bank_card"}(JSON). - Take
AuthorizationUrl/checkout_urlfrom the response and redirect the user. - The user enters the card details and a PIN code (any 4 digits).
- The mock sends a callback to your callback URL → the “Success” page.
Step 3 may be absent. The 3-D Secure confirmation page is switched by the project setting card_3ds_enabled (on by default): with it off the payment is settled right after the details are submitted, and the card form at the same URL stays. Neither the response nor the callback is affected — the only difference is the number of screens the payer sees. How to exercise both modes — Flow: 3-D Secure.
Sandbox
Test card number: 4111 1111 1111 1111 — any expiry date and CVV. The last 4 digits determine the result — see “Bank card error emulation”.
The payment screens are bilingual. The language is picked automatically from the payer’s Accept-Language header: the card form, PIN entry, SBP pages and the final screens open in English for an English-speaking customer on their own. Nothing has to be appended to the URL. To open a specific version from your own machine, add ?lang=en or ?lang=ru — an explicit choice beats the header and survives to the end of the flow. A language we do not have falls back to Russian.
CreateInvoice — bank card (XML)
<Request>
<Header><Authentication>
<Login>demo_login</Login>
<NowUtc>20260625120000</NowUtc>
<Signature>abcdef1234...</Signature>
</Authentication></Header>
<CreateInvoiceRequest>
<ProjectID>1001</ProjectID>
<BankCardCustomer>
<Source>my_source</Source>
<Country>ru</Country>
<MerchantCustomerId>user_123</MerchantCustomerId>
</BankCardCustomer>
<InvoiceInfo>
<MerchantOrderID>ORDER-001</MerchantOrderID>
<CustomerPrice amount="99.00" currency="RUB" includingVAT="true"/>
</InvoiceInfo>
</CreateInvoiceRequest>
</Request>CreateInvoice — bank card (JSON)
Sandbox
curl
curl -X POST \
https://pay-sandbox.digitalspb.com/api/v3/projects/1001/invoices \
-H "Content-Type: application/json" \
-H "X-Login: demo_login" \
-H "X-Timestamp: $TS" \
-H "X-Signature-Version: 3" \
-H "X-Signature: $SIG" \
-d '{
"customer": {
"type": "undefined_bank_card",
"source": "my_source",
"country": "RU",
"merchant_customer_id": "user_123"
},
"order": {
"merchant_order_id": "ORDER-001",
"price": { "amount": "99.00", "currency": "RUB", "vat_included": true }
}
}'
# The response contains checkout_url to redirect the user