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

# Payment links

> Create a Flow payment as a link, share it anywhere, and get paid in the token and chain you choose.

> [!NOTE]
>
> This is an enterprise-only feature. Please [contact us](https://www.dynamic.xyz/book-a-call) to enable.

A payment link is a Flow payment that your server creates and shares as a URL instead of wiring it into your own payment page. It suits invoices and requests sent by email, SMS, chat, or QR code.

1. **Create**: One request from your server sets the amount, settlement token, destination, and the page the link opens.
2. **Share**: Send the link to the payer.
3. **Get paid**: The payer pays from a wallet, through an exchange, or by sending funds to a deposit address. Funds convert and settle automatically.

## Amount and mode

A payment link always creates a flow in `payment` mode. You set the amount when you create the link, and the payer cannot change it. Each link is one flow, so it represents one payment, and the payer can use it until the payment is sent or the flow is cancelled or expires. [Expiry and cancellation](https://docs.dynamic.xyz/docs/flow/expiry-and-cancellation.md) explains how long a flow can stay open.

## Where the payer pays

When your server creates the link, it sets `baseUrl`, the page the link opens:

* **Hosted by Dynamic**: Set `baseUrl` to Dynamic's hosted payment page, `https://pay.dynamicauth.com`. There is no frontend to build. The hosted page works only with links created with the payment-link API.
* **Self-hosted**: Set `baseUrl` to your own page, and drive the payment with the [JavaScript SDK](https://docs.dynamic.xyz/docs/javascript/reference/flow-getting-started.md), the [Flutter SDK](https://docs.dynamic.xyz/docs/flow/flutter.md), or the [API](https://docs.dynamic.xyz/docs/flow/api.md).
* **Custom domain**: Put your own domain, for example `pay.yourcompany.com`, on Dynamic's hosted page. [Contact us](https://www.dynamic.xyz/book-a-call) to set this up.

The origin of `baseUrl` must be a registered [CORS origin](https://docs.dynamic.xyz/docs/platform/console/security.md#allowed-cors-origin) before you create the link, or the request is rejected.

The payer reviews the payment and pays from their wallet:

<video width="100%" autoPlay muted loop playsInline src="https://mintcdn.com/dynamic-docs/9iDbG-xSOxoJin7E/images/flow/payment-link-review.mp4?fit=max&auto=format&n=9iDbG-xSOxoJin7E&q=85&s=6a5d50fe8e7270951f63a64d4338b895" />

Funds convert and settle automatically:

<video width="100%" autoPlay muted loop playsInline src="https://mintcdn.com/dynamic-docs/9iDbG-xSOxoJin7E/images/flow/payment-link-processing.mp4?fit=max&auto=format&n=9iDbG-xSOxoJin7E&q=85&s=4b6659ba803e5542e6d68005c01af15c" />

## Share the link only with the payer

The link encodes your environment ID and the flow ID. It contains no secret, but anyone who has it can open the payment and, until the payment is sent, attach a payment source. Send each link only to the payer it is for. [Access and data](https://docs.dynamic.xyz/docs/flow/security.md#treat-the-flow-id-as-a-capability) explains why.

## Payment sources and chains

Payers can pay from a wallet, through an exchange, or by sending funds to a generated deposit address. See [Payment sources](https://docs.dynamic.xyz/docs/flow/payment-sources.md) for what each requires, and [Supported chains](https://docs.dynamic.xyz/docs/flow/supported-chains.md) for the chains per source.

## Create a link

Your server creates a link with the same fields as a `payment` flow, plus the required `baseUrl`, using its environment API token. The response includes the flow and a `paymentUrl` to send to the payer. The [API guide](https://docs.dynamic.xyz/docs/flow/api.md#payment-links) shows the request and response.

Track the payment like any other flow, with [webhooks](https://docs.dynamic.xyz/docs/flow/webhooks.md). The payment is done when settlement reaches `completed`.

## Continue building

> [card] [JavaScript SDK](https://docs.dynamic.xyz/docs/javascript/reference/flow-getting-started.md)

> [card] [Flutter SDK](https://docs.dynamic.xyz/docs/flow/flutter.md)

> [card] [API only](https://docs.dynamic.xyz/docs/flow/api.md)


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