Skip to content
UnknownPay
ไทย
Sandbox

Top-up & Reset

Credit your test balance and wipe your own test data — two sandbox-only triggers

These two sandbox-only triggers let you set up and tear down test state. Both require HMAC + Idempotency-Key, and both return 404 if you call them with a live key.

Top-up — POST /v1/test/top-up

POST /v1/test/top-up

Credit your test balance directly (test ledger only — it never touches your live balance). Use it to rehearse flows that need a balance, such as withdrawals.

Request body (TopUpReq)

fieldtyperequireddescription
amountstring (baht)yesThe amount to credit, e.g. "1000.00". Must be > 0.
currencystringnoCurrency (can be omitted; the response returns "THB").

Response (200, TopUpResult)

{
  "amount": "1000.00",
  "currency": "THB",
  "status": "credited"
}

Limits / cap

SituationHTTPcode
amount ≤ 0422INVALID_AMOUNT
amount malformed422INVALID_AMOUNT
Over the sandbox cap of 1,000,000 baht per call422AMOUNT_TOO_LARGE
currency fails validation422INVALID_CURRENCY
More than 60 calls/minute per merchant429RATE_LIMITED
Live key404NOT_FOUND

Example request

cURL
curl -X POST https://api.unkpay.co/v1/test/top-up \
  -H "X-Api-Key: unk_test_xxxxxxxxxxxxxxxx" \
  -H "X-Timestamp: 1718790000" \
  -H "X-Signature: <hex hmac>" \
  -H "Idempotency-Key: topup-0001" \
  -H "Content-Type: application/json" \
  -d '{"amount":"1000.00","currency":"THB"}'

Reset — POST /v1/test/reset

POST /v1/test/reset

Wipe all of your own test data atomically: test deposits + withdrawals + any test bank_transactions/unmatched produced + the entire test ledger (live data and other merchants' data are untouched). You send no body (but Idempotency-Key is still required). This endpoint has no rate limit (it only clears your own data).

reset permanently deletes all of your test data. There is no undo — it is for tearing down your own sandbox state.

Response (200, ResetResult)

{
  "status": "reset"
}
Test data older than ~30 days is purged automatically by the system (a daily worker) anyway — reset is for clearing it yourself right away.

Example request

cURL
curl -X POST https://api.unkpay.co/v1/test/reset \
  -H "X-Api-Key: unk_test_xxxxxxxxxxxxxxxx" \
  -H "X-Timestamp: 1718790000" \
  -H "X-Signature: <hex hmac>" \
  -H "Idempotency-Key: reset-0001"

Errors

SituationHTTPcode
Live key404NOT_FOUND
Missing Idempotency-Key400IDEMPOTENCY_KEY_REQUIRED
Missing/invalid signature, API key, or timestamp401UNAUTHORIZED