# Stripe Checkout from your server Pass a captured referral into the Stripe Checkout Session your application creates. ## Install referral capture Connect the Stripe account in Monok, choose Stripe Checkout from your server in the offer setup, and install the workspace snippet on your landing site and app. ```html ``` ## Pass the referral into Checkout Before making the checkout request, await the browser helper and include the referral with your usual request data. Keep your existing server-side authentication and price validation. ```javascript const checkoutData = window.Monok ? await window.Monok.getCheckoutData({ priceId: selectedPriceId }) : { priceId: selectedPriceId }; // Send checkoutData to your existing checkout endpoint. ``` ```javascript import { withMonokStripeCheckout } from "@monok/server/payments/stripe"; const session = await stripe.checkout.sessions.create( withMonokStripeCheckout(checkoutOptions, body.monok_referral), ); ``` The helper adds referral metadata to your existing session options and ensures attributed one-time payments can be linked to a Stripe customer. If customers sign up before paying, register the referral at signup while it is still valid. ## Verify capture and payment Run Test browser script on your offer, then check a referred Checkout flow. Confirm the payment is credited to the correct affiliate. Stripe test-mode events do not earn commissions. ## Related guides - [Stripe Payment Links and embeds](https://docs.monok.com/affiliate-program/stripe-payment-links) — Capture affiliate referrals for Stripe Payment Links, Pricing Tables, and Buy Buttons. - [Custom server integration](https://docs.monok.com/affiliate-program/server-integration) — Capture referrals on your server, register customers after signup, and report completed payments.