Test mode
Try every part of your program with fake data and a test clock.
Test mode has its own keys, data, and dashboard. Nothing in test mode affects live balances or sends emails to real customers.
| Test mode | Live mode | |
|---|---|---|
| Secret key | sk_test_... | sk_live_... |
| Base URL | sandbox.referralapi.example | api.referralapi.example |
| Test clock | Available | Not available |
| Webhooks | Sent to test endpoints | Sent to live endpoints |
The test clock
Rewards often depend on time: hold periods, commission months, and expiry. The test clock lets you move forward without waiting.
await client.testClock.advance({ days: 30 });Advancing the clock processes everything that would have happened in that time, in order, and sends the matching webhooks.
Simulating payments
Use these payment IDs to trigger specific outcomes:
| Payment ID | Result |
|---|---|
pay_test_success | Succeeds normally. |
pay_test_refund_half | Succeeds, then refunds 50% a day later. |
pay_test_dispute | Succeeds, then opens a dispute after 3 days. |
Payout file preview
Export a payout file in test mode to check its format before you connect your bank. The download contains:
Yes. Open the program in test mode and click Copy to live. Referrers and rewards stay behind.
Yes, the same limits as live mode, so you find problems before launch.
How is this guide?