> ## Documentation Index
> Fetch the complete documentation index at: https://docs.macropay.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Checkout Links

> Share a URL, sell a product. Macropay handles tax, compliance, and the checkout — no code required.

A Checkout Link is the fastest way to start selling: paste one URL into a button, a bio, an email, or a DM, and every visitor who clicks it lands on a hosted checkout for the products you chose. Because Macropay is the Merchant of Record, that checkout already includes worldwide sales tax and VAT, fraud screening, and a PCI DSS Level 1 compliant payment form — you never write a line of payment code.

<Tip>
  Need to spin up checkouts programmatically — one per cart, per session, or per
  agent run? A static Checkout Link isn't the right primitive. Reach for the
  [Checkout Sessions API](/features/checkout/session) instead.
</Tip>

## How a Checkout Link works

Unlike a raw session URL, a Checkout Link is **durable**. Each click hits the Macropay API, which mints a fresh, short-lived checkout session and redirects the buyer to it.

<Warning>
  Always share the **Checkout Link URL**, never the URL of a session it
  redirects to. Session pages are temporary and expire if no purchase
  completes — so a copied session link will eventually 404 for your customers.
  The Checkout Link itself never expires.
</Warning>

## Create a Checkout Link

Open the **Products** section in your [dashboard](https://app.macropay.ai), switch to the **Checkout Links** tab, and click **New Link**.

<Frame>
  <img className="block dark:hidden" src="https://mintcdn.com/macrodeepinc/S4T0jM7ZWV5HVLft/assets/features/checkout/links/create.light.png?fit=max&auto=format&n=S4T0jM7ZWV5HVLft&q=85&s=b106df4e1849fffd5a0b66143477481c" width="1620" height="2304" data-path="assets/features/checkout/links/create.light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/macrodeepinc/S4T0jM7ZWV5HVLft/assets/features/checkout/links/create.dark.png?fit=max&auto=format&n=S4T0jM7ZWV5HVLft&q=85&s=7873f1bedc08da9e6fe50fb4cc9c8554" width="1620" height="2304" data-path="assets/features/checkout/links/create.dark.png" />
</Frame>

Each link has a few configurable fields:

#### Label

An internal name to help you tell links apart — for example `launch-week-discord` or `newsletter-footer`. Buyers never see it.

#### Products

Attach one product or several. When you add multiple, the checkout shows a switcher so the buyer can pick between them on the same page — handy for a "Standard vs. Pro" or "monthly vs. annual" choice.

<img className="block dark:hidden" src="https://mintcdn.com/macrodeepinc/S4T0jM7ZWV5HVLft/assets/features/checkout/links/checkout_multiple_products.light.png?fit=max&auto=format&n=S4T0jM7ZWV5HVLft&q=85&s=30284f0010582251d2e952d398ff574a" width="3840" height="2500" data-path="assets/features/checkout/links/checkout_multiple_products.light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/macrodeepinc/S4T0jM7ZWV5HVLft/assets/features/checkout/links/checkout_multiple_products.dark.png?fit=max&auto=format&n=S4T0jM7ZWV5HVLft&q=85&s=132b1aecdc251543a5ee642d72d426f7" width="3840" height="2500" data-path="assets/features/checkout/links/checkout_multiple_products.dark.png" />

#### Discount

Preset a discount and it's **applied automatically** the moment a buyer arrives — no code to type, no step to forget. This is the cleanest way to run a campaign-specific price: give your Black Friday link a 30% preset and the savings appear on the first page load.

Turn on **Allow discount codes** if you also want buyers to enter their own codes on top of (or instead of) the preset.

<Tip>
  Code-less discounts can only be delivered through a Checkout Link preset or the
  [Checkout Sessions API](/features/checkout/session). To create and manage the
  discounts themselves, see the [Discounts guide](/features/discounts).
</Tip>

#### Metadata

An optional key-value object for anything you'll want when the order lands — an affiliate ID, a campaign tag, an internal SKU. Macropay copies this metadata onto the generated Checkout object, and on success onto the resulting Order and/or Subscription, so it flows straight through to your webhooks and reporting.

## Sharing your link

Drop the link anywhere a URL can live: a website button, a Framer or Raycast landing page, a Slack announcement, an affiliate post via Affonso, or a one-to-one message to a customer.

<img className="block dark:hidden" src="https://mintcdn.com/macrodeepinc/S4T0jM7ZWV5HVLft/assets/features/checkout/links/checkout_link.light.png?fit=max&auto=format&n=S4T0jM7ZWV5HVLft&q=85&s=be079de556e101063d73572217109e6d" width="1320" height="1030" data-path="assets/features/checkout/links/checkout_link.light.png" />

<img className="hidden dark:block" src="https://mintcdn.com/macrodeepinc/S4T0jM7ZWV5HVLft/assets/features/checkout/links/checkout_link.dark.png?fit=max&auto=format&n=S4T0jM7ZWV5HVLft&q=85&s=8c7f25413c91db85a9f8b8546607bb22" width="1320" height="1030" data-path="assets/features/checkout/links/checkout_link.dark.png" />

## Query parameters

Append query parameters to tailor the checkout per click — prefill what you already know, and capture where the buyer came from.

### Prefill checkout fields

Pass any of these to pre-populate the form. Great for "you're already logged in, just confirm" flows.

<ParamField path="customer_email" type="string">
  Prefill the customer's email.
</ParamField>

<ParamField path="customer_name" type="string">
  Prefill the customer's name.
</ParamField>

<ParamField path="discount_code" type="string">
  Pre-populate the discount-code input so the buyer can see it filled in. Works
  only with discounts that have a code set — see [Discounts](/features/discounts).

  This differs from a preset discount: a preset is applied silently and
  automatically, whereas `discount_code` simply fills the visible input field.
</ParamField>

<ParamField path="amount" type="string">
  Prefill the amount for Pay What You Want pricing.
</ParamField>

<ParamField path="custom_field_data.{slug}" type="string">
  Prefill a custom field's value, where `{slug}` is the field's slug.
</ParamField>

### Capture attribution

These parameters are written automatically onto the Checkout's [`metadata`](/api-reference/checkouts/get-session#response-metadata), so attribution travels with the order all the way to your webhooks and ledger.

<ParamField path="reference_id" type="string">
  Your own reference ID for the checkout session.
</ParamField>

<ParamField path="utm_source" type="string">
  UTM source of the checkout session.
</ParamField>

<ParamField path="utm_medium" type="string">
  UTM medium of the checkout session.
</ParamField>

<ParamField path="utm_campaign" type="string">
  UTM campaign of the checkout session.
</ParamField>

<ParamField path="utm_content" type="string">
  UTM content of the checkout session.
</ParamField>

<ParamField path="utm_term" type="string">
  UTM term of the checkout session.
</ParamField>

#### Example

A link that arrives pre-filled, pre-discounted, and fully attributed:

```text theme={null}
https://buy.macropay.ai/c/your-link
  ?customer_email=ada@example.com
  &discount_code=LAUNCH30
  &utm_source=newsletter
  &utm_campaign=launch_week
  &reference_id=sub_8842
```

<Note>
  Because Macropay is the Merchant of Record, every order through a Checkout
  Link is sold under our entity: we calculate and remit the right sales tax or
  VAT for the buyer's location, keep that liability off your books, and handle
  any disputes on your behalf.
</Note>
