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 (HTTP allowed)Delivered to live-mode endpoints (HTTPS required)
Rate limitsSame limits as live modeSame limits as test mode
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 keys (pk_test_* and sk_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:

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 program'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.

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 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

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 numberBehavior
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://api.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 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.