All docs pages

Billing

Dodo Payments

Connect Dodo Payments: what to pass at checkout, which webhook events, and where the signing secret is.

1. Pass the referral at checkout

const ref = window.referralmeter?.ref() ?? null;

// Server, when creating the payment, subscription or checkout session:
metadata: { referralmeter_ref: ref ?? "" },

Referralmeter reads referralmeter_ref from that field on the payment Dodo Payments sends back. To mark a purchase as credits or a top-up (so your credits rule applies), also set kind: "credits" in the same metadata.

2. Connect the webhook

Dodo Payments → Developer → Webhooks → Add endpoint. URL: the Dodo webhook URL from Billing connections. Copy the signing secret (whsec_…) into Billing connections.

Dodo signs with Standard Webhooks; the secret starts with whsec_.

Events Referralmeter uses:

  • payment.succeeded
  • refund.succeeded
  • dispute.opened
  • subscription.cancelled
  • subscription.expired

Test mode

Dodo's test mode uses separate endpoints and secrets, and its events carry no test flag, so Referralmeter can't tell test from live on its own. In Billing connections, tick This is a sandbox / test-mode connection on the Dodo Payments card while the test endpoint's secret is connected. Every event from that connection is then recorded as test (livemode: false): shown on your dashboard, never counted toward stats or plan limits, never paid out. Untick it when you switch to the live endpoint's secret.