Soporte/Revenue Attribution
Revenue Attribution

Attribute revenue with custom payment providers

If you already use a connected provider such as Stripe, Paddle, LemonSqueezy, or Polar, prefer that built-in integration first.

Send payments with the current API contract

When a payment succeeds, call the Flowsery Payment API:

JavaScript
await fetch('https://analytics.flowsery.com/api/v1/payments', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${FLOWSERY_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    amount: 29.99,
    currency: 'USD',
    transactionId: 'txn_98hj',
    visitorUid: request.cookies._fs_vid,
    sessionUid: request.cookies._fs_sid,
    email: 'buyer@example.com',
    name: 'Buyer Name',
    customerId: 'cus_123',
  }),
});

Notes

  • Use the backend field names exactly: visitorUid, sessionUid, and transactionId.
  • amount should always be sent.
  • Deduplication is based on transactionId.
  • Refunds should reuse the original transactionId and set isRefund: true.

For the endpoint details, see Create Payment.