Integrate any payment processor with our simple API. Paddle, Lemon Squeezy, Gumroad, Polar, Razorpay, or your own custom solution — if it has webhooks, it works with Revshare.
await fetch("/api/referral", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "YOUR_API_KEY",
},
body: JSON.stringify({
ref_code: "affiliate123",
program_id: "prog_xxx",
spent_amount: 4900,
currency: "USD",
transaction_id: "order_123",
customer_id: "cust_456",
}),
});
Stripe
Paddle
Lemon Squeezy
Gumroad
Polar
Dodo
RazorpayA simple 4-step process to track affiliate sales from any payment provider
Affiliate shares yoursite.com?ref=code
Our script stores the ref in cookies
Payment provider sends you a webhook
Your webhook handler calls Revshare
https://www.revshare.so/api/referralContent-Typeapplication/jsonx-api-keyYour API key from the dashboardref_codeThe affiliate's referral code
program_idYour program ID
spent_amountSale amount in cents (e.g., 4900 = $49.00)
transaction_idUnique transaction ID (prevents duplicates)
currencyCurrency code (defaults to USD)
customer_idCustomer ID for recurring revenue tracking
Here's how to integrate with Paddle. The same pattern works for Lemon Squeezy, Gumroad, or any provider with webhooks.
Pass ref_code to checkout via custom_data
Set up a webhook endpoint
When payment succeeds, call our API
We handle commission tracking
// Next.js example
export async function POST(req) {
const event = await req.json();
if (event.event_type ===
'transaction.completed') {
const { custom_data, details } =
event.data;
if (custom_data?.ref_code) {
await fetch(
'https://revshare.so/api/referral',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': process.env.API_KEY,
},
body: JSON.stringify({
ref_code: custom_data.ref_code,
program_id: custom_data.program_id,
spent_amount: details.totals.total,
transaction_id: event.data.id,
}),
}
);
}
}
return Response.json({ ok: true });
}Our API works with any payment processor. Get your API key and start tracking in minutes.