Attribute revenue with Paddle Checkout API

Before proceeding, confirm that you have linked your Paddle account.

Include custom_data with _fs_vid and _fs_sid (cookies set by Flowsery Analytics) when creating a checkout transaction:

// app/api/create-checkout/route.js
import { cookies } from 'next/headers';

export async function POST() {
  const cookieStore = cookies();
  // If you're using Next.js 15+, use this instead:
  // const cookieStore = await cookies();

  const response = await fetch('https://api.paddle.com/transactions', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${PADDLE_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      items: [...],
      custom_data: {
        _fs_vid: cookieStore.get('_fs_vid')?.value,
        _fs_sid: cookieStore.get('_fs_sid')?.value
      }
    })
  });

  const data = await response.json();
  return Response.json(data);
}

Once connected and custom data is passed correctly, Flowsery Analytics will automatically attribute revenue to the appropriate marketing channels. No webhook configuration is needed.

Following a successful payment, revenue data should appear in your dashboard (referrer, country, browser, etc.).