Skip to main content

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

AspectTest modeLive mode
API keyspk_test_*, sk_test_*pk_live_*, sk_live_*
DataCompletely isolated — test data never appears in live reportsProduction data
StripeConnects to your Stripe test environmentConnects to your Stripe live environment
EmailsSuppressed — no emails are sent to partners or merchantsEmails are delivered normally
WebhooksDelivered to test-mode endpoints (HTTPS required)Delivered to live-mode endpoints (HTTPS required)
Rate limitsIdentical limits in both modesIdentical limits in both modes
Fraud detectionActive — same rules as live modeActive
GDPR erasureFully functionalFully functional
Data isolation

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

  1. Log in to the Selgeo merchant dashboard.
  2. Navigate to Settings > API Keys.
  3. Your test public key (pk_test_*) is shown alongside the live one. Click Generate secret key under Test mode to issue sk_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:

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.

Step 5 — Verify the conversion and commission

  1. Go to the Analytics page in the dashboard. You should see the conversion recorded.
  2. Navigate to Commissions. A commission should have been calculated based on your programme's commission rules.
  3. If your commission rules include a hold period, the commission will be in a pending state. 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 4242 for a successful charge)
  • Test refunds trigger commission.refunded events
  • 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 numberBehaviour
4242 4242 4242 4242Succeeds
4000 0000 0000 3220Requires 3D Secure authentication
4000 0000 0000 0002Declines (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"
warning

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.