Stripe
Attribute every Stripe payment to the visit that brought it.
Updated 21 Oct 2026
Connect
- In the Stripe dashboard, open Developers → Webhooks → Add endpoint. After you save it, reveal the Signing secret; it starts with
whsec_. - In atrby, open Revenue → Payment processors → Connect, choose Stripe and paste the secret.
- atrby shows your webhook URL. It looks like
https://app.atrby.site/api/webhooks/stripe/…. Add it in Stripe and send these events:checkout.session.completed,invoice.paid,charge.refunded.
The connection shows as active once the first webhook arrives. Webhooks with a wrong signature are rejected.
Pass the visit ids
Where they go: Checkout Session metadata. For subscriptions, also subscription_data.metadata, which Stripe copies to every renewal invoice. Read them in the browser with atrby.ids() and send them to your server with the checkout request.
const ids = window.atrby?.ids(); // { atrby_sid, atrby_site }await stripe.checkout.sessions.create({
mode: "subscription",
line_items: [{ price: "price_growth_monthly", quantity: 1 }],
success_url: "https://acme.io/welcome",
metadata: { ...ids, atrby_uid: user.id },
subscription_data: { metadata: { ...ids, atrby_uid: user.id } },
});atrby_uid is your user id, from identify. It's optional, but it credits payments made long after the first visit.
What gets recorded
- Each payment once, however often Stripe retries the webhook.
- Full and partial refunds are subtracted from the source of the original payment.
- The first payment comes from
checkout.session.completedonce it's paid;invoice.paidis only used for renewals, so nothing is counted twice.
Not covered
Payments made outside Checkout and invoices, such as a bare PaymentIntent, aren't read. Use the Payment API for those.