Skip to main content
Connecting your payment provider is the fastest path to fully automated commission triggering. Instead of adding event calls to your backend code, you configure your payment provider to forward transaction events directly to Refairn. When a payment succeeds, a subscription renews, or a charge is refunded, your provider notifies Refairn in real time—and Refairn matches the payment to the right agent and queues the commission automatically. This method requires no code changes to your SaaS application. All configuration happens in your payment provider’s dashboard.
Payment provider webhooks handle payment events. They do not capture customer signups. To attribute customers at the moment they register—before they pay—add the customer-created API call to your signup flow as well. See API Integration for details.

How it works

  1. You add Refairn’s webhook URL as an endpoint in your payment provider dashboard.
  2. You select the events Refairn needs to receive.
  3. Your payment provider sends those events to Refairn whenever they occur.
  4. Refairn verifies the event signature, looks up the customer’s agent attribution by email, and triggers commission logic.
Your Refairn webhook URL follows this format:
https://app.refairn.com/webhooks/{provider}/{businessId}
Replace {provider} with your payment provider’s name (lowercase) and {businessId} with your Refairn business ID, found in Settings → Integrations in your dashboard.

Provider setup

Stripe is the most common payment provider for SaaS businesses. Refairn supports the full Stripe webhook event set for subscription lifecycle management.Your webhook URL:
https://app.refairn.com/webhooks/stripe/YOUR_BUSINESS_ID
Events to enable:
EventWhat it triggers in Refairn
checkout.session.completedCustomer subscribed — triggers initial commission
invoice.payment_succeededSubscription renewed — triggers recurring commission
customer.subscription.deletedSubscription cancelled — stops future recurring commission
charge.refundedPayment refunded — voids or reduces the associated commission
charge.dispute.createdDispute opened — holds the associated commission pending resolution
Setup steps:
1

Open your Stripe Dashboard

Log in to dashboard.stripe.com and navigate to Developers → Webhooks.
2

Add an endpoint

Click Add endpoint. Paste your Refairn webhook URL:
https://app.refairn.com/webhooks/stripe/YOUR_BUSINESS_ID
3

Select events

Under Events to send, add the following events:
  • checkout.session.completed
  • invoice.payment_succeeded
  • customer.subscription.deleted
  • charge.refunded
  • charge.dispute.created
4

Save and verify

Click Add endpoint. Stripe will show a signing secret—Refairn uses this automatically to verify that events are genuinely from Stripe. You do not need to configure this secret in Refairn.
5

Send a test event

Use Stripe’s Send test webhook button to fire a checkout.session.completed event. Check your Refairn dashboard under Customers to confirm the event was received and processed.

What happens after a webhook arrives

When Refairn receives a webhook from your payment provider, it:
  1. Verifies the signature using the provider’s signing mechanism to confirm the event is authentic.
  2. Extracts the customer email from the event payload.
  3. Looks up the agent attribution for that email in your Refairn program.
  4. Creates or updates a commission record based on your program’s commission rules.
  5. Applies the hold period before the commission is eligible for approval and payout.
If no agent attribution exists for a customer email when a payment event arrives, Refairn records the payment in your transaction log but does not create a commission. You can manually assign attribution later from the Customers section of your dashboard.
Automated payout disbursement—where Refairn initiates transfers directly to agent bank or mobile money accounts after commissions are approved—is planned for a future release. Today, approved commissions appear in your payout ledger and you initiate disbursements manually from the dashboard.