Skip to main content

Webhooks

The MLM Platform uses Stripe webhooks to receive real-time notifications about subscription and payment events.

Overview

When events occur in Stripe (e.g., subscription created, payment succeeded), Stripe sends webhook events to the MLM Platform, which then processes them to:
  • Create commission entries for purchases
  • Update subscription statuses
  • Track payment lifecycle events

Setting Up Webhooks

Step 1: Get Your Webhook Endpoint

Your Stripe webhook endpoint is:
For sandbox environments:
Your Wise webhook endpoint is:
For sandbox environments:
If you use Sumsub for KYC, the Sumsub webhook endpoint is:

Step 2: Configure in Stripe Dashboard

  1. Go to Stripe Dashboard
  2. Click Add endpoint
  3. Enter your webhook URL
  4. Select events to listen for (see below)
  5. Click Add endpoint
  6. Copy the Signing secret

Step 3: Save the Webhook Secret

In the MLM Platform Admin Dashboard:
  1. Navigate to Settings > Integrations > Stripe
  2. Enter the webhook signing secret
  3. Click Save

Supported Events

Webhook Signature Verification

All webhook requests are verified using Stripe’s signature verification:
Always verify webhook signatures to prevent spoofed requests.

Idempotent Handling

Stripe may send the same event multiple times. Handle this by:
  1. Storing processed event IDs
  2. Checking before processing

Retry Behavior

Stripe retries failed webhook deliveries:
Return a 2xx status code quickly to acknowledge receipt. Process events asynchronously if needed.

Testing Webhooks

Using Stripe CLI

Using Sandbox Environment

  1. Use Stripe test mode
  2. Use sandbox API keys
  3. Create test subscriptions with test cards
Test card numbers:
  • 4242 4242 4242 4242 - Succeeds
  • 4000 0000 0000 0002 - Declines

Troubleshooting

Webhook Not Received

  1. Check endpoint URL is correct
  2. Verify webhook is enabled in Stripe
  3. Check Stripe webhook logs for errors
  4. Ensure firewall allows Stripe IPs

Signature Verification Failed

  1. Verify webhook secret is correct
  2. Ensure raw request body is used (not parsed JSON)
  3. Check for proxy modifications to headers

Event Processing Failed

  1. Check MLM Platform logs
  2. Verify user exists for the customer
  3. Check commission rules are configured