A partner program is a simple promise: bring us a customer and you get a commission. Keeping that promise is not simple, because it lives in two places.
The affiliate platform knows who the partners are, which codes they share and what they earn. Your billing knows who actually paid, how much, and who asked for a refund. Every commission depends on those two systems agreeing.
Without an integration, someone keeps them in sync by hand:
Each new partner code is created again as a promo code in billing, with the same discount and the same restrictions.
Each sale is reported back to the affiliate platform so the partner gets credit for it.
Each refund is reported too, or the partner keeps a commission for a customer who left.
Miss a step and a partner is underpaid or overpaid. Both cost you the program: underpaid partners stop promoting, and overpaid commissions are hard to claw back.
Commet keeps Dub in sync
Commet now connects to Dub, the affiliate platform. Once connected, Dub stays the source of truth for partners and terms, and Commet does the rest:
Dub's partner discounts become Offers in Commet, and partner codes become promo codes.
Every invoice Commet charges is sent to Dub as a sale, attributed to the partner who brought the customer.
Refunds mark the sale as refunded. Cancellations, trial starts and customer updates reach Dub as well.
Nobody copies codes between dashboards and nobody exports a CSV of sales at the end of the month.
How to set it up
You need a Dub workspace on the Business plan or higher and a Dub API key with all permissions.
1. Connect Dub. In Commet, open Settings → Integrations and choose Connect on the Dub card. Paste the API key. Commet validates it by reading your Dub catalog and stores it encrypted. Only owners and admins can connect or manage Dub.
2. Sync new codes. On the Dub card, choose Manage and copy the code sync URL. In Dub, go to Settings → Webhooks and create a webhook with that URL and the discount_code.created and discount_code.deleted events. Without this webhook, codes created later don't reach Commet.
3. Use the same customer ID in both places. Commet matches sales to Dub customers by the customer's externalId, the same ID you use when you track leads in Dub. Create your Commet customers with it:
await commet.customers.create({
externalId: user.id,
email: user.email,
});That is the whole integration. From here on, partner codes show up in Commet and sales show up in Dub.
How Dub records appear in Commet
| In Dub | In Commet |
|---|---|
| Partner discount | Offer with managedBy: "dub" |
| Partner code | Promo code with firstPurchaseOnly: true and managedBy: "dub" |
Terms are edited in Dub. Editing them in Commet returns 409 managed_by_integration, so the two systems can't drift apart. You can still rename an Offer and turn a code on or off from Commet.
Examples
A developer tool with creator partners. A YouTuber who reviews dev tools gets the code MAYA20 for 20% off the first year. The code is created once, in Dub. A viewer subscribes with it in Commet's checkout, the first invoice is charged, and the invoice reaches Dub as a sale under Maya's name.
A refund after the commission. A customer who came through a partner asks for a refund two weeks later. You refund the payment in Commet and Dub marks the sale as refunded, so the commission is adjusted without anyone remembering to do it.
A code that should only bring new customers. Partner codes are first-purchase only. A customer who already pays and tries a partner's code is refused with first_purchase_only, so partners are paid for customers they brought, not for existing ones who found a coupon.
A send that fails. If Dub is unreachable, Commet retries for up to three days. Billing is never affected. Sends that still fail appear under Not reaching Dub in Manage, with a Resend button.
What to know
Invoices first charged before Dub was connected are not sent.
Changes to terms in Dub reach Commet on the next code sync event.
A Dub code whose text already exists as a Commet promo code is not imported. Manage lists it under Codes not imported.
Disconnecting Dub stops the sync. The Offers and promo codes it created keep working as regular ones.
Start
If you already run partners on Dub, connecting takes an API key and one webhook. If you are thinking about starting a partner program, you can now do it without building the bookkeeping. Read Connect Dub Affiliates for the full reference.