Billing provider integrations
Connect Paddle, Lemon Squeezy, Polar or Chargebee to OpenPromoter. Pass the click id as custom data and every sale goes to the right partner.
Besides Stripe, OpenPromoter has built-in webhook handlers for Paddle Billing, Lemon Squeezy, Polar and Chargebee. You can connect several providers to one workspace at the same time.
Each provider follows the same three steps:
- Create a webhook in the provider pointing at your OpenPromoter URL.
- Paste the webhook signing secret into Settings > Integrations.
- Pass
op_click(the visitor's click id fromwindow.openpromoter.clickId) as custom data at checkout.
Signatures are verified on every request and each event is processed once.
Paddle
Webhook URL: https://<APP_URL>/api/webhooks/paddle/<workspaceId>
In Paddle, add a notification destination with this URL and subscribe to customer.created, transaction.completed, adjustment.created, adjustment.updated, subscription.created, subscription.updated and subscription.canceled. Paste the destination's secret key into OpenPromoter.
Paddle.Checkout.open({
items: [{ priceId: "pri_123", quantity: 1 }],
customData: { op_click: window.openpromoter.clickId },
});
Paddle webhooks name a discount by its ID and leave out its code. To credit a partner for a Paddle discount, add the discount's ID (it starts with dsc_) as that partner's coupon code. Refunds count up across adjustments. Two partial refunds reduce the commission twice.
Lemon Squeezy
Webhook URL: https://<APP_URL>/api/webhooks/lemonsqueezy/<workspaceId>
In Lemon Squeezy go to Settings > Webhooks and add the URL with a signing secret. Select order_created, order_refunded, subscription_created, subscription_updated, subscription_cancelled, subscription_expired, subscription_payment_success and subscription_payment_refunded.
Pass the click id in the checkout URL:
https://acme.lemonsqueezy.com/buy/<variant>?checkout[custom][op_click]=<clickId>
Polar
Webhook URL: https://<APP_URL>/api/webhooks/polar/<workspaceId>
In Polar, add a webhook endpoint with the URL and subscribe to customer.created, order.paid, order.refunded, subscription.created, subscription.updated, subscription.canceled and subscription.revoked. Paste the endpoint secret into OpenPromoter.
const checkout = await polar.checkouts.create({
products: ["prod_123"],
metadata: { op_click: clickId },
});
Chargebee
Webhook URL: https://<APP_URL>/api/webhooks/chargebee/<workspaceId>
In Chargebee, add a webhook with this URL and turn on basic authentication with a user name and password of your choice. Paste the same user:password into OpenPromoter.
Chargebee has no signing secret. OpenPromoter checks the basic-auth credentials on every request instead.
Select customer_created, payment_succeeded, payment_refunded, subscription_created, subscription_changed and subscription_cancelled.
Attribute a customer by storing the click id on the Chargebee customer, either in meta_data or in a custom field named cf_op_click:
{ "meta_data": { "op_click": "clk_8f2k…" } }
Commissions are calculated on the invoice subtotal minus discounts. The coupon code the customer typed (or the coupon ID) counts as a partner coupon code.
Anything else
If your billing system is not listed, report payments and refunds yourself through the API. Both calls are idempotent:
curl https://app.openpromoter.com/api/v1/conversions \
-H "Authorization: Bearer $OPENPROMOTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"programId":"prg_123","paymentId":"inv_981","customerId":"cus_42","amount":4900,"currency":"usd","interval":"month","clickId":"clk_8f2k"}'
amount is in minor units (cents) and excludes tax. Send POST /api/v1/refunds with the same paymentId when you refund. See the API reference.