Revenue Attribution
Attribute revenue with Stripe PaymentIntent API
Before proceeding, confirm that you have linked your Stripe account.
Flowsery processes these Stripe webhook events:
checkout.session.completedinvoice.payment_succeededcharge.refunded
Routing to the correct website is automatic (Flowsery registers a dedicated webhook URL per site) — you don't need to pass websiteId. To attribute the payment to the visitor's traffic source, forward the Flowsery cookies (_fs_vid / _fs_sid) as metadata when you create the PaymentIntent:
JavaScript
const paymentIntent = await stripe.paymentIntents.create({
amount: 2000,
currency: 'usd',
metadata: {
fs_visitor_id: req.cookies['_fs_vid'],
fs_session_id: req.cookies['_fs_sid'],
},
});If you can't set metadata, call identify(email) so Flowsery can match the payment by email.