Stripe Checkout Sessions
If you create Stripe Checkout Sessions on your server, you need to read the affiliate cookie and attach it to the session. The pixel alone isn't enough when checkout is server-generated.
When the pixel alone is sufficient
If you use Stripe Payment Links or Pricing Tables, the pixel handles everything automatically. No server code needed.
When you need to pass metadata
When your server creates a Checkout Session, read the psfy_partner cookie from the browser request and pass it to Stripe:
// The cookie value from the browser request
const partner = readCookieFromRequest('psfy_partner') ?? null;
await stripe.checkout.sessions.create({
// ... your line items, success_url, etc.
metadata: {
psfy_partner: partner,
},
});
Partnersify reads metadata.psfy_partner from the Stripe webhook when the customer pays.
For framework-specific cookie reading patterns (Next.js, Nuxt, SvelteKit, Remix), see the Integrations section for your platform.
client_reference_id fallback
Partnersify also checks client_reference_id on the Checkout Session if metadata is missing. Prefer metadata.psfy_partner. It is the primary path.
Updated