Test Mode
Selgeo provides a complete test environment so you can verify your integration end-to-end without processing real payments or sending emails to real partners. All test-mode features use API version v1.
Test vs. live comparison
| Aspect | Test mode | Live mode |
|---|---|---|
| API keys | pk_test_*, sk_test_* | pk_live_*, sk_live_* |
| Data | Completely isolated — test data never appears in live reports | Production data |
| Stripe | Connects to your Stripe test environment | Connects to your Stripe live environment |
| Emails | Suppressed — no emails are sent to partners or merchants | Emails are delivered normally |
| Webhooks | Delivered to test-mode endpoints (HTTP allowed) | Delivered to live-mode endpoints (HTTPS required) |
| Rate limits | Same limits as live mode | Same limits as test mode |
| Fraud detection | Active — same rules as live mode | Active |
| GDPR erasure | Fully functional | Fully functional |
Test and live modes are fully separated. Partners, clicks, conversions, commissions, and webhook endpoints created in test mode are invisible in live mode, and vice versa. You can run test scenarios freely without affecting production data.
Getting your test keys
- Log in to the Selgeo merchant dashboard.
- Navigate to Settings > API Keys.
- Your test keys (
pk_test_*andsk_test_*) are displayed alongside your live keys.
Step-by-step test cycle
Follow this walkthrough to verify the full attribution flow: click, attribution, conversion, and commission.
Step 1 — Install the snippet with your test public key
Add the Selgeo tracking snippet to a test page on your site (or a local development environment). Use your test public key:
<script
src="https://cdn.selgeo.com/v1/selgeo.js"
data-merchant="pk_test_YOUR_KEY"
async
></script>
Step 2 — Create a test partner
In the dashboard, create a test program (or use an existing one) and add a test partner. Note the partner's referral link or tracking link URL. It will look something like:
https://yoursite.com/?ref=abc123
Step 3 — Simulate a click
Open the referral link in your browser. The Selgeo snippet captures the click and creates a pending attribution. You can verify this in the dashboard under Analytics > Clicks.
The snippet stores a click_id that links this visitor to the referring partner.
Step 4 — Report a test conversion
After the simulated click, trigger a conversion. The method depends on your integration:
- Stripe Checkout
- Conversion API
Complete a Stripe test checkout using a Stripe test card (e.g., 4242 4242 4242 4242). Selgeo receives the Stripe webhook and automatically creates the conversion.
Send a conversion directly via the API using your test secret key:
curl -X POST https://api.selgeo.com/api/v1/conversions \
-H "Authorization: Bearer sk_test_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"click_id": "THE_CLICK_ID_FROM_STEP_3",
"event_type": "purchase",
"external_transaction_id": "test_txn_001",
"amount_cents": 9900,
"currency": "EUR"
}'
Step 5 — Verify the conversion and commission
- Go to the Analytics page in the dashboard. You should see the conversion recorded.
- Navigate to Commissions. A commission should have been calculated based on your program's commission rules.
- If your commission rules include a hold period, the commission will be in a
pendingstate. It will auto-approve once the hold period elapses.
Step 6 — Test webhooks
If you have webhook endpoints registered in test mode, check the delivery log in Settings > Webhooks. You should see deliveries for conversion.created and commission.created events.
For local development, you can register an HTTP endpoint (e.g., http://localhost:3000/webhooks/selgeo). Use a tool like ngrok to expose your local server if you are not running on a publicly accessible URL.
Stripe test environment
Selgeo connects to your Stripe test environment when operating in test mode. This means:
- Test card numbers work as expected (e.g.,
4242 4242 4242 4242for a successful charge) - Test refunds trigger
commission.refundedevents - Test subscriptions generate recurring conversion events
- Stripe webhooks from your test environment are processed and attributed normally
Make sure your Stripe test-mode webhook endpoint is configured in Stripe to send events to Selgeo. The Selgeo dashboard shows the exact Stripe webhook URL to use under Settings > Stripe.
Stripe test card numbers
| Card number | Behavior |
|---|---|
4242 4242 4242 4242 | Succeeds |
4000 0000 0000 3220 | Requires 3D Secure authentication |
4000 0000 0000 0002 | Declines (card_declined) |
See the Stripe testing documentation for the full list.
Resetting test data
When you want a clean slate, use the Reset test data button in the Selgeo dashboard (Settings page, test mode). This deletes all test-mode data for your workspace in one action:
- Partners and participants
- Clicks and attribution events
- Conversions and commissions
- Webhook delivery logs
- Notification logs
You can also reset programmatically via the API:
curl -X DELETE https://api.selgeo.com/api/v1/workspace/test-data \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
This action is irreversible. All test-mode data will be permanently deleted.
Tips
- Reset test data regularly. Use the reset button or API endpoint above to start fresh instead of manually cleaning up individual records.
- Test webhooks early. Set up webhook endpoints in test mode before going live. Verify that your server handles all the event types you need.
- Test edge cases. Try scenarios like expired attribution windows, duplicate conversions, refunds, and suspended partners to make sure your integration handles them gracefully.
- Check email suppression. Remember that no emails are sent in test mode. If you need to verify email templates, check the BullMQ queue dashboard (if available in your environment) to see queued notification jobs.
- When you are ready, follow the Go-Live Checklist to switch to production.