PayMeNow

Sandbox

How the sandbox behaves, the test amounts, forced scenarios and the sandbox helper endpoints.

Generated from public-api.mdVersion 1.2.0Last updated 2026-09-20

#Sandbox Testing

#How Sandbox Works

Sandbox is the combination of a sandbox merchant account and the sandbox host:

  • Call https://sandbox-api.<domain>/v1/… (currently https://sandbox-api.paymenow.asia).
  • Use your sandbox credentials (pk_demo_… / sk_demo_…).

Sandbox transactions are stored in separate tables, never reach a payment provider, and return a mock QR payload (no qr_code_image). Balance credits and debits behave realistically, so a sandbox withdrawal still needs sandbox funds.

Contact support to request sandbox credentials.

#Test Amounts

In sandbox, specific deposit/withdraw amounts resolve to a fixed outcome:

AmountDeposit outcomeWithdraw outcome
100.00completedcompleted
500.00completedcompleted
1000.00completedcompleted
200.00pendingprocessing (default)
999.99failedfailed
Any otherpendingprocessing

The /sandbox/test-amounts helper still lists 888.88 as a timeout trigger. It is not implemented: 888.88 behaves like any other amount. Use the X-Sandbox-Scenario: timeout header instead.

Remember the hard minimums (50 THB deposit, 100 THB withdraw) apply in sandbox too, so 100.00 is the smallest useful deposit test amount.

#Test Scenarios

Override the outcome with the X-Sandbox-Scenario header. The header takes precedence over the amount, and is ignored for production merchants.

ScenarioDepositWithdraw
auto_approvecompletedcompleted
auto_failfailedfailed
auto_pendingpendingprocessing
timeoutRequest hangs ~35 s, then 504 TIMEOUTsame
invalid_account(no effect)400 INVALID_ACCOUNT

When a sandbox deposit lands in completed or failed immediately and a webhook_url was supplied, the webhook fires just as in production — so webhook handlers can be tested end to end.

Example:

bash
curl -X POST https://sandbox-api.paymenow.asia/v1/payments/deposit \
  -H "X-Sandbox-Scenario: auto_approve" \
  -H "X-API-Key: your_sandbox_api_key" \
  -H "X-Signature: ..." \
  -H "X-Timestamp: ..." \
  -H "Content-Type: application/json" \
  -d '{"amount": 500.00, "currency": "THB", "reference_id": "TEST-001", "bank_code": "004", "bank_account_no": "1234567890", "bank_account_name": "Test Payer"}'

#Sandbox helper endpoints

Served on the sandbox host only, with no authentication:

EndpointReturns
GET /sandbox/testConfirms sandbox mode is active
GET /sandbox/credentialsStatic example credentials (illustrative, not usable)
GET /sandbox/test-amountsThe test-amount table (see the 888.88 caveat above)

Limited to 300 requests/minute per IP at the edge.

#Response Headers

HeaderValueDescription
X-Environmentsandbox or productionWhich side served the request
X-Sandbox-ModetrueSandbox merchants only
X-Request-IDopaque stringTrace id, echoed from your X-Request-ID if sent