Skip to content

Sandbox

The sandbox is a separate environment for testing the whole integration without moving money. The API, signing, limits, errors and callbacks work as in production.

Sandbox
API the sandbox {{base_url}}, issued with your access
Cabinet the sandbox {{cabinet_url}}
Token starts with nl_test_
Request signing required, as in production

How it works

  1. Test project. Support turns on test mode with test requisites for your project. Its payments never make real payments and carry is_test: true in responses and callbacks.
  2. Test requisites. A create response carries test requisites: a test phone number for SBP or a test card number. Nothing needs to be transferred. The payment is processing.
  3. The amount sets the outcome. 2 minutes after the requisites are issued the payment closes by itself. The digits after the decimal point of the amount you sent on create decide the outcome — see the table.
  4. Callbacks arrive as in production. When the payment becomes completed or canceled, a callback is sent to your address with the same signing, delivery and retries as in production — see Callbacks. You can also read the result with GET /api/v1/payments/{id}.

Payment outcome by amount

The outcome depends on the digits after the decimal point — exactly .13, .25, .50 or .75. 1000.13 and 1000.130 are .13; 1000.135 is "any other ending".

Amount ends with After 2 minutes Final amount Example
.00 and any other ending completed equals initial_amount 1000.00 → completed, amount: 1000
.13 canceled equals initial_amount 1000.13 → canceled
.25 completed, underpaid initial_amount minus 10% 1000.25 → completed, amount: 900.23
.75 completed, overpaid initial_amount plus 10% 1000.75 → completed, amount: 1100.82
.50 stays processing equals initial_amount 1000.50 → canceled after the payment lifetime
  • The 10% difference is 10% of initial_amount rounded down to hundredths: 100.02 for 1000.25, 100.07 for 1000.75. initial_amount does not change; the paid result is in amount. In production this is how a payment looks after its amount was corrected by a payment receipt. merchant_information is recalculated for the new amount.
  • The .50 ending tests expiry: the payment waits for the project's payment lifetime (15 minutes by default) plus 2 minutes, then becomes canceled.
  • The 2 minutes run from the moment the requisites were issued; the outcome is set within 15 seconds after that.
  • There is no late success (canceled → completed) in the sandbox yet.
  • If support closed the payment earlier, the amount-based outcome no longer applies: the first outcome stays, and the callback reports it.

What else to test

What to test What to do
Successful payment Amount ending .00, e.g. 1000.00 → completed after 2 minutes, plus a callback
Cancellation Amount ending .13 → canceled, plus a callback
Underpayment and overpayment Amounts ending .25 and .75 → completed with a different amount, plus a callback
Expired deadline Amount ending .50 → canceled after the payment lifetime, plus a callback
Idempotency Send the same request twice → 201, then 200 with the same payment
Id conflict The same merchant_payment_id with another amount → 409 payment_idempotency_conflict
Nonce replay Send one signed request twice → 409 request_replayed
Bad signature Change the body after signing → 401 signature_invalid
Callback retries Do not answer 2xx → 2 more attempts after 30 and 60 seconds

Differences from production

  • No money moves, requisites are not real, payments are marked is_test: true in responses and callbacks.
  • The amount, not the payer, sets the payment outcome.
  • The sandbox has its own token, signing key and callback secret. Issue new ones for production.
  • The API address differs: keep it in configuration — see Environments.
  • A test payment created with the cabinet button is different: you set its outcome with the buttons on its card, the amount does not affect it, and it gets no callback.