FauryaFaurya
Revenue Attribution

Payment API

Track and attribute revenue from any payment provider using Faurya's Payment API. Perfect for custom payment solutions or unsupported providers.

If you're using Stripe, LemonSqueezy, or dodo, you don't need to use this endpoint. We automatically track payments if you have connected your payment provider.

Attribute revenue with custom payment providers

Use Faurya's Payment API to create payments and attribute revenue to your traffic sources.

How it works

When you receive a successful payment, make an API call to Faurya's Payment API. That's it!

// Send payment data to Faurya's API
await fetch("https://faurya.com/api/v1/payments", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${Faurya_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    amount: 29.99,
    currency: "USD",
    transaction_id: "txn_98hj",
    faurya_visitor_id: "3cff4252-fa96-4gec-8b1b-bs695e763b65", // available in the cookie, like request.cookies.faurya_visitor_id
  }),
});

You'll need an API key for your website.

Here's a recommended flow:

  1. Capture Faurya's visitor ID, a unique identifier for each visitor, from the cookie Faurya_visitor_id. Store it in your database or pass it to your payment provider when creating checkout sessions (metadata).
  2. Send payment data to Faurya using our Payment API when you receive a successful payment (your webhook handler, a success page, etc.)

For more details, see the Payment API documentation.

On this page