Skip to content

Payment Flow

This guide shows the complete journey from partner link click to commission payout.


Payment Flow


Partner promotes your product with their unique link:

https://yoursite.com?ref=PARTNER123

Customer clicks the link and lands on your site.

What happens:

  • Affitor tracker detects ?ref=PARTNER123
  • Generates unique customer_code and stores in cookie
  • Creates customer-partner relationship in database
  • Click event recorded

Customer explores your site. Cookies persist for 60 days.

Attribution window: 60 days from first click.

Customer creates an account.

Your code calls:

window.affitorQueue = window.affitorQueue || [];
window.affitorQueue.push(['trackLead', {
email: 'customer@example.com',
user_id: 'user_123' // Your internal user ID - REQUIRED
}]);

What happens:

  • Lead event linked to partner via cookies
  • user_id saved to customer-partner relationship
  • Partner sees: 1 click → 1 signup

Customer completes payment via Stripe.

Your checkout includes metadata:

metadata: {
program_id: 'YOUR_PROGRAM_ID',
customer_code: 'cust_xyz',
user_id: currentUser.id // Your internal user ID (same as trackLead)
}

Stripe sends checkout.session.completed to Affitor.

What happens:

  • Affitor receives payment confirmation
  • Reads user_id from metadata
  • Reads program_id from metadata
  • Reads customer_code from metadata
  • Looks up customer-partner relationship using user_id, program_id and customer_code
  • Verifies attribution is within 60-day window
  • Creates commission record

Based on your program settings:

SettingExample
Commission rate30%
Sale amount$100
Commission$30

Affitor checks:

CheckValidation
No duplicateCustomer not already attributed
Matching programProgram ID is valid

Commission enters hold period (7-21 days, configurable).

During hold:

  • Commission shows as “Pending”
  • If customer refunds → commission cancelled
  • If no refund → commission clears

After hold period clears:

  • Commission moves to “Withdrawable”
  • Bi-weekly payout cycle processes
  • Partner receives funds via Bank/Wise/Stripe

Customer → Affitor checkout → Affitor collects $100
Stripe fees: -$3.20
Commission (30%): -$30
Platform fee (3.5%): -$3.50
You receive: $63.30
Hold period (14 days)
Partner receives: $30
Customer → Your checkout → You collect $100
Stripe fees: -$3.20
You keep: $96.80
Affitor tracks conversion
Weekly invoice: $33.50
(Commission $30 + Fee $3.50)
You pay invoice
Hold period (14 days)
Partner receives: $30

For recurring payments, the flow repeats each billing cycle:

Click → Signup → Subscribe $100/mo
Commission: $30
Hold: 14 days
Partner paid: $30
Subscription renews $100
Commission: $30 (if within duration)
Hold: 14 days
Partner paid: $30
Duration SettingPartner Earns On
One-timeFirst payment only
3 monthsMonths 1-3
12 monthsMonths 1-12
LifetimeAll future payments

Example (12-month duration):

  • Month 1: ✅ Commission paid
  • Month 6: ✅ Commission paid
  • Month 12: ✅ Commission paid
  • Month 13: ❌ No commission (outside duration)

When Refund HappensCommission Status
During hold periodCancelled automatically
After hold, before payoutReversed from balance
After payoutDeducted from next payout

Scenario: 30% commission, Bill Flow, 14-day hold, bi-weekly payout

DayEvent
0Customer clicks partner link
3Customer signs up (lead tracked)
7Customer purchases $100
7Conversion tracked, commission: $30
8You approve transaction
14Weekly invoice: $33.50
15You pay invoice
8-22Hold period (14 days)
22No refund → commission clears
28Bi-weekly payout cycle
30Partner receives $30

Verify your integration works end-to-end: