Testing
Use the sandbox and test API keys to drive every payment outcome without moving real money.
The sandbox is a full copy of the API that doesn't move real money. Use it to build and test your integration end to end before going live.
Sandbox basics
- Base URL:
https://sandbox.shadhinpay.pay/api/v1 - Keys: use a test key (
sk_test_…) from your business in the dashboard. - Sandbox payments never reach a real provider, never post to your balance, never count toward quota, and are excluded from settlement.
A live key can't be used in the sandbox and a test key can't move real money — mixing them is rejected, so you can't accidentally charge a customer while testing.
Driving outcomes with test phone numbers
In the sandbox, the customer phone number you pass decides the result. This lets you exercise every branch deterministically:
customerPhone | Outcome |
|---|---|
01770618575 | Payment completes successfully |
01770618576 | Payment fails (insufficient balance) |
01770618577 | Provider times out — exercise your polling / expiry handling |
01770618578 | Customer cancels |
Example — create a payment that will complete:
curl -X POST https://sandbox.shadhinpay.pay/api/v1/payments \
-H "Client-Id: HM_4f8c2b1a" \
-H "Business-Id: HB_71c4a09e" \
-H "X-Api-Key: sk_test_aB3kC9...9xQ2" \
-H "X-Idempotency-Key: test-order-1" \
-H "Content-Type: application/json" \
-d '{
"amount": "500.00",
"currency": "BDT",
"merchantTxnId": "test-order-1",
"callbackUrl": "http://localhost:3000/return",
"customerPhone": "01770618575"
}'HTTP callbacks allowed in sandbox
The sandbox accepts http:// callback and redirect URLs (e.g. localhost) so you
can test locally. Live mode requires HTTPS.
Testing webhooks
Webhooks fire in the sandbox exactly as they do in production:
- Point your sandbox business's webhook URL at your endpoint (a tunneling tool like ngrok works well for local development).
- Create a sandbox payment with the "completes" phone number.
- Receive and verify the
payment.completedwebhook — see Webhooks.
Setting the URL triggers a test ping that must succeed before it's saved, so you'll know immediately if your endpoint isn't reachable.
Viewing test data
Sandbox traffic is hidden from the dashboard by default. Flip the Include sandbox toggle to see it in your metrics and transaction lists while you build — see Analytics & exports.
Going live
When your integration works in the sandbox:
- Make sure your account is Active and your business's providers are configured.
- Create a live API key (
sk_live_…) — this requires two-factor authentication. - Switch your base URL to
https://api.shadhinpay.pay/api/v1and swap in the live key. - Run one small real payment end to end to confirm everything's wired up.