Connect a payment provider
View as MarkdownConnect Stripe, Polar or Dodo Payments and pass the visitor id at checkout.
On this page
Open your website’s Settings → Payments and connect Stripe, Polar or Dodo Payments. Reveata then receives new payments through webhooks and imports recent history. Provider credentials are stored encrypted.
To link a payment to the visit that led to it, the checkout needs to carry the visitor id. The tracking script provides it:
window.reveata.metadata();
// → { reveata_visitor_id: "…", reveata_session_id: "…" }Without it, Reveata still matches payments by user id or email for visitors you identified. In cookieless mode there is no visitor id in the browser, so identify is the way to link payments.
Step-by-step guides
Each setup option also has its own guide:
- Stripe: restricted key, Connect with Stripe, Stripe Checkout, Payment Links and buy buttons, Elements and mobile apps.
- Polar
- Dodo Payments
- Platforms without an integration: Ghost, Kajabi, Podia, Easytools, and apps built with AI.
Every payment is stored once, however many times it arrives: see Why payments are never counted twice.
Stripe
Payment Links, Buy Buttons and Pricing Tables need no code: the script adds a client_reference_id to buy.stripe.com links and to <stripe-buy-button> and <stripe-pricing-table> elements on your pages.
Checkout Sessions created on your server: send the metadata from the browser to your server, then add it to the session:
// browser: include the ids in the request that creates the checkout
await fetch('/api/checkout', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ priceId, ...window.reveata.metadata() }),
});// server (Node.js)
const session = await stripe.checkout.sessions.create({
mode: 'subscription',
line_items: [{ price: priceId, quantity: 1 }],
success_url: 'https://example.com/thanks',
metadata: {
reveata_visitor_id: body.reveata_visitor_id,
reveata_session_id: body.reveata_session_id,
},
});Disputes. A dispute that closes lost takes its amount out of revenue like a refund. Give the restricted key read access to Disputes (the Create the key in Stripe button in Reveata ticks it) so past disputes are imported too.
Polar
Add the ids to the checkout metadata when you create it. Polar copies checkout metadata onto orders and subscriptions:
const checkout = await polar.checkouts.create({
products: [productId],
successUrl: 'https://example.com/thanks',
metadata: { reveata_visitor_id: visitorId, reveata_session_id: sessionId },
});When you connect Polar, create a webhook endpoint in Polar (Settings → Webhooks, format Raw) with the URL shown in Reveata and paste its secret. Disconnecting removes that endpoint from Polar when the token has the webhooks:write scope.
Dodo Payments
Add the ids to the checkout session or payment metadata:
metadata: { reveata_visitor_id: visitorId, reveata_session_id: sessionId }When you connect Dodo Payments, add a webhook in Dodo (Developer → Webhooks) with the URL shown in Reveata, paste its signing secret (whsec_…), and send these events:
payment.succeeded, refund.succeeded, subscription.active, subscription.renewed, subscription.on_hold, subscription.cancelled, subscription.failed, subscription.expired, subscription.plan_changed, subscription.updated, dispute.lost, dispute.accepted
Subscription events that arrive late never overwrite a newer state. A lost or accepted dispute takes its amount out of revenue like a refund. Disconnecting removes that webhook from Dodo.
Anything else
Send payments from your server with the Payments API.
Links opened outside your site
Payment links sent by email, put in a social bio or printed as a QR code are opened without the tracking script, so they carry no visitor id. Point their success URL at your own thank-you page with the provider's checkout id (for example ?session_id={CHECKOUT_SESSION_ID} for Stripe) and Reveata links the payment when the customer lands there. See thank-you page payments for every provider and for reveata('payment', { email }).
Check it works
- Open your site in a private window from a link ending in
?ref=test. - Buy something in your provider’s test mode, or make a small real purchase and refund it afterwards. A free, fully discounted checkout is not a payment, so it does not show up.
- The payment appears under Revenue with the source
testonce the provider’s webhook arrives.
If nothing arrives, Settings → Payments shows each provider’s last webhook delivery and the latest error. From there you can register the webhook again or replace its signing secret.