Sandbox

Test Environment

Build and test your integration in a safe sandbox environment with test API keys and simulated payments.

Sandbox Base URL

https://sandbox.karatdollar.com/rapi/v2/

Test API Keys

Secret Key (Server-side)

sk_test_sandbox_abc123def456

Public Key (Client-side)

pk_test_sandbox_xyz789ghi012

Test Card Numbers

Card NumberBrandResult
4111 1111 1111 1111VisaSuccess
5500 0000 0000 0004MastercardSuccess
4000 0000 0000 0002VisaDeclined
4000 0000 0000 3220Visa3D Secure

Use any future expiry date and any 3-digit CVV. Test wallets are pre-funded with 10,000 KAD.

Example Request

1curl -X POST https://sandbox.karatdollar.com/rapi/v2/payments/initiate \
2 -H "Authorization: Bearer sk_test_sandbox_abc123" \
3 -H "Content-Type: application/json" \
4 --data-raw '{
5 "amount": 100.00,
6 "currency": "KAD",
7 "recipient": "wallet_test_buyer1",
8 "reference": "TEST-001"
9 }'
10
11# Response
12# {
13# "success": true,
14# "data": {
15# "payment_id": "pay_test_7xKj9mNpQ2",
16# "status": "completed",
17# "amount": 100.00
18# }
19# }

Switching to Production

  1. Replace sk_test_ with your sk_live_ key from the dashboard.
  2. Update the base URL to https://api.karatdollar.com/rapi/v2/.
  3. Ensure webhook endpoints are configured for production events.
  4. Complete merchant verification in the dashboard before processing live transactions.