SANDBOX — TEST MODE

ChaopaoPay Sandbox

Behaves exactly like the live API — same endpoints, same signed callbacks — but no real money moves. Payins return a hosted checkout page that auto-completes the payment and fires your webhook.

Demo Credentials

Base URLhttps://sandbox.chaopaopay.site/api/v1
Merchant IDM-SANDBOX
API Keypk_test_demo1234567890ab
Secret Keysk_test_demo1234567890ab
Sandbox keys always start with pk_test_. Live keys are rejected here and vice versa — test traffic can never touch production data.

How it works

1
Call payin/create with the demo credentials — you get back a payment_url.
2
Open the payment_url — a checkout page shows a processing animation, then auto-completes the payment.
3
Your callback_url receives a signed POST. Verify with sha256(transaction_id + trx_id + status + secret_key) — identical to live.
4
The payer is redirected to your return_url with trx_id, transaction_id and status.

Create a test payin

curl -X POST https://sandbox.chaopaopay.site/api/v1/payin/create.php \
  -H "Content-Type: application/json" \
  -H "X-API-Key: pk_test_demo1234567890ab" \
  -H "X-Merchant-ID: M-SANDBOX" \
  -d '{
    "trx_id": "ORDER-1001",
    "amount": 500,
    "method_code": 101,
    "customer_name": "Test User",
    "callback_url": "https://yourdomain.com/webhook.php",
    "return_url": "https://yourdomain.com/return.php"
  }'

Endpoints

POST/api/v1/payin/create.phpCreate test payment
POST/api/v1/payout/create.phpCreate test payout — returns simulate_url to auto-approve
POST/api/v1/transaction/status.phpCheck transaction status