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

# Checkout links

> Send buyers to your store's checkout from a link, email, or ad.

Use a checkout link when you want a **Buy now** link without an API key, a script on your site, or a pre-created session. A link is reusable. Opening it does not create a payment or reserve stock.

```html theme={null}
<a href="https://your-store.mypaysum.io/checkout-link?item=PRODUCT_ID">Buy now</a>
```

Replace `your-store` and `PRODUCT_ID`. Use the address of your live store, including its custom domain if it has one. Copy the product ID from the product's **Embed checkout** code in the dashboard.

## Build the cart

Repeat `item` once per line. Each value uses `PRODUCT_ID:QUANTITY:VARIANT_ID`.

| Example | Meaning |
| - | - |
| `item=shirt` | One shirt. If it has variants, the buyer chooses one in checkout. |
| `item=shirt:2:blue` | Two shirts, with the blue variant already selected. Use its ID, not its display name. |
| `item=shirt:2:blue&item=hat:1` | Two blue shirts and one hat in the same checkout. |

Quantity defaults to `1` when you omit both quantity and variant. Use quantities from `1` to `99` and up to 20 lines per link. All products must belong to the store in the URL. For carts with multiple lines, include a variant ID for each product that requires a variant. You can omit it when the base option is available.

```js theme={null}
const url = new URL('/checkout-link', 'https://your-store.mypaysum.io')
url.searchParams.append('item', 'SHIRT_ID:2:BLUE_VARIANT_ID')
url.searchParams.append('item', 'HAT_ID:1')
url.searchParams.set('utm_source', 'newsletter')
url.searchParams.set('utm_campaign', 'summer')
console.log(url.href)
```

## Attribution and pricing

* Use `ref` for a store referral code. You can also pass `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, and `utm_content`. Checkout uses the store's existing attribution rules.
* PaySum reads prices and options from the store. The link cannot set prices or override the store currency.
* Do not put buyer details or secrets in the link. Use the [Checkout API](https://docs.paysum.io/hosted-checkout.md) to prefill buyer details on a specific session.
* Use an [embed](https://docs.paysum.io/embed.md) if you want checkout to open inside your site.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.