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 (HTTPS required) | Delivered to live-mode endpoints (HTTPS required) |
| Rate limits | Identical limits in both modes | Identical limits in both modes |
| 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 public key (
pk_test_*) is shown alongside the live one. Click Generate secret key under Test mode to issuesk_test_*— secret keys are created on demand, not up front.
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 programme (or use an existing one) and approve a test partner. Referral links are created by partners in the partner portal — sign in as the test partner, open Links, and create a link. Copy its 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://app.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 programme'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.
Webhook endpoints must use HTTPS and be publicly reachable — test mode included. For local development, expose your local server through a tunnel such as ngrok and register the tunnel's HTTPS URL (e.g., https://your-tunnel.ngrok.app/webhooks/selgeo).
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
When you connect your Stripe test-mode restricted key under Settings > Stripe, Selgeo automatically registers the test webhook endpoint — you do not need to copy a webhook URL into Stripe manually. Ensure the restricted key includes the webhook_endpoints:write permission.
Stripe test card numbers
| Card number | Behaviour |
|---|---|
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://app.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 which notifications would have been sent, check the in-app test notification log (the Test inbox) in the dashboard.
- When you are ready, follow the Go-Live Checklist to switch to production.