Documentation
Stripe Payment Links and embeds

Stripe Payment Links

Track affiliate sales through an ordinary link or a button styled as a link to Stripe.

View as Markdown

Add the Payment Link to your page

Complete Connect the Stripe account and Install the browser script on the Stripe Payment Links and embeds overview. Keep the same workspace ID on the referred landing page and on the page containing the checkout control.

  1. In the Stripe Dashboard, open Payment Links and create or select the link for your product. Copy its payment URL.
  2. Use that URL as the href of an anchor on your page. You can style the anchor as a button.
  3. For a one-time payment, configure the Payment Link to create a Stripe customer.
HTML
<a href="https://buy.stripe.com/YOUR_PAYMENT_LINK">Buy now</a>

See what gets passed to Stripe

Monok adds client_reference_id to eligible HTTPS links when a referral is active. It keeps existing query parameters and fragments. If Stripe uses a custom checkout domain, add its exact HTTPS origin to the Monok script tag. Keep the payment link’s full URL in the anchor.

HTML
<script defer src="https://cdn.monok.com/monok.js"
  data-workspace-id="WORKSPACE_ID"
  data-stripe-hosted-checkout="true"
  data-stripe-checkout-origin="https://pay.example.com"></script>
A Payment Link carries the referral into Stripe Checkout as a URL parameter.

For a JavaScript redirect to a Payment Link, await getReferral and add the reference before navigating. Use your own trusted Stripe payment URL. If your backend creates Checkout Sessions, follow Stripe Checkout from your server.

JavaScript
const url = new URL("https://buy.stripe.com/YOUR_PAYMENT_LINK");
const referral = await window.Monok?.getReferral();
if (referral && !url.searchParams.get("client_reference_id")) {
  url.searchParams.set("client_reference_id", referral);
}
window.location.assign(url);

Verify the link and payment

In the offer’s Affiliate integration setup, run Test browser script. This verifies that the page can capture attribution without creating an affiliate click or referral. Then open a valid affiliate link in a fresh browser session and complete the method-specific checks below. A Stripe sandbox payment does not earn a commission.

  1. After visiting through an affiliate link, inspect the rendered anchor in DevTools. Its href should contain client_reference_id with an mk2_ value. Check that your other query parameters are still present.
  2. Open the link and complete checkout. Check the completed Stripe session’s client_reference_id, then confirm the referral and successful eligible payment in Monok.
  3. If the reference is missing, check the exact origin, the hosted tracking attribute, and whether the link already carries a non-empty client_reference_id.

Related guides