Demo docs: examples are illustrative.
Referral API

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 modeLive mode
Secret keysk_test_...sk_live_...
Base URLsandbox.referralapi.exampleapi.referralapi.example
Test clockAvailableNot available
WebhooksSent to test endpointsSent 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 IDResult
pay_test_successSucceeds normally.
pay_test_refund_halfSucceeds, then refunds 50% a day later.
pay_test_disputeSucceeds, 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:

payouts.csv
summary.json

How is this guide?