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

# Products & Payment Links

> Create products and share customer-facing Anyway payment links.

Each product can have one or more payment links. Customers only need the public Anyway URL returned as `paymentLinkUrl`.

## Create a payment link

<Steps>
  <Step title="Create or open a product">
    Go to **Business → Products** and enter the product name, description, price, and currency.

    <Frame>
      <img src="https://mintcdn.com/anyway/2VVTFU_BTPgbm7OY/images/mor/create-product.png?fit=max&auto=format&n=2VVTFU_BTPgbm7OY&q=85&s=eead1452f314eeb634b05ac11c428648" alt="Create Product — name, description, and one-time or subscription pricing" width="3780" height="1812" data-path="images/mor/create-product.png" />
    </Frame>
  </Step>

  <Step title="Select the payment method">
    Choose the payment method and complete the requested setup. You can add more payment links to the same product later — each link inherits the product and only sets its own pricing.

    <Frame>
      <img src="https://mintcdn.com/anyway/2VVTFU_BTPgbm7OY/images/mor/create-payment-link.png?fit=max&auto=format&n=2VVTFU_BTPgbm7OY&q=85&s=4dd970635431e60907a741fec55dd12d" alt="Create Payment Link — pricing inherited from the product" width="3780" height="1812" data-path="images/mor/create-payment-link.png" />
    </Frame>
  </Step>

  <Step title="Create and copy the Anyway URL">
    Select **Create Product**. The app creates the product as published and opens a success dialog. Select **Copy payment link** from that dialog. There is no separate publish step.
  </Step>
</Steps>

```json Selected payment-link response fields theme={null}
{
  "productId": "PRD_EXAMPLE",
  "paymentLinkUrl": "https://pay.anyway.sh/pay/PL_EXAMPLE"
}
```

Use the returned `paymentLinkUrl` as the checkout base URL. Do not parse or reconstruct
its path. You may append URL-encoded query parameters when you need to carry correlation
data through checkout.

## Attach correlation data

Append string-valued query parameters to the payment link you send to a buyer:

```text theme={null}
https://pay.anyway.sh/pay/PL_EXAMPLE?merchant_reference=PUR_456&user_id=USR_123&source=web
```

Anyway preserves the first string value for each query parameter in the order's
`merchantMetadata`. The `merchant_reference` parameter has an additional role: Anyway
also promotes it to the top-level `merchantReference` field, while retaining it in
`merchantMetadata`.

<Note>
  A checkout URL may contain at most 20 distinct query parameter names, and its complete
  raw query string may be at most 4,096 bytes. `merchantReference` may be at most 255
  UTF-8 bytes. If a parameter name is repeated, Anyway keeps only its first value.
  Checkout rejects a URL that exceeds these limits.
</Note>

| Field | Intended use | Query behavior |
| - | - | - |
| `merchantReference` | One stable business correlation value, such as a purchase or cart ID | The orders list supports the `merchant_reference` filter |
| `merchantMetadata` | Additional string key-value context, such as an internal user ID or acquisition source | Returned with the order; arbitrary metadata keys are not filters |

For the example above, order payloads contain:

```json theme={null}
{
  "merchantReference": "PUR_456",
  "merchantMetadata": {
    "merchant_reference": "PUR_456",
    "user_id": "USR_123",
    "source": "web"
  }
}
```

Use a URL builder so names and values are encoded correctly. Do not put secrets or raw
personal data in these parameters: they are visible to the buyer and may appear in browser
history and request logs.

## What happens at checkout

The hosted checkout shows only methods available for the buyer's device, country, currency, and provider eligibility. It may offer cards, Apple Pay or Google Pay, Link, Klarna, Cash App Pay, and bank payment. The page follows the buyer's own language. See [supported payment methods](/mor/payment-methods) for details.

<Frame>
  <img src="https://mintcdn.com/anyway/2VVTFU_BTPgbm7OY/images/mor/checkout.png?fit=max&auto=format&n=2VVTFU_BTPgbm7OY&q=85&s=e34602a565a37c3cde8d8bc3f312ad8a" alt="Anyway hosted checkout with card and wallet payment options" width="3024" height="1450" data-path="images/mor/checkout.png" />
</Frame>

<Steps>
  <Step title="The buyer opens the link">
    The buyer opens the Anyway payment link.
  </Step>

  <Step title="Anyway starts checkout">
    Anyway creates a checkout attempt and keeps your order reference and metadata attached.
  </Step>

  <Step title="The buyer pays">
    The buyer completes the selected payment flow.
  </Step>

  <Step title="Anyway confirms the order">
    Anyway confirms the payment and creates or updates the corresponding order.
  </Step>

  <Step title="The sales record appears in Finance">
    For platform-collected Card / USD payments, the sale is added to your Finance ledger asynchronously.
  </Step>
</Steps>

If you configure the optional success URL, it must be a valid HTTPS URL. Anyway returns
the buyer to it after confirmation and echoes the custom query parameters together with
`anyway_order_id`, `status`, and the signed callback proof when available. The same
correlation fields are available in order webhooks and Merchant API order responses.
Verify the order status on your server before delivering high-value goods.

<Warning>
  Query parameters and `merchantMetadata` are buyer-visible input. Use them for
  correlation and context, not as the sole authorization or pricing decision.
</Warning>

## Manage products and links

The Products list can filter `PUBLISHED`, `DRAFT`, and `ARCHIVED` items. Open a published product to archive it or an archived product to republish it. From the product overview, you can also edit its name or description, review existing payment links, create another link for a supported payment method, and copy a public URL.

After creating a product, the app opens a success dialog with **Copy payment link**, **Preview checkout**, and **Done**. **Done** returns to Products. Adding a link to an existing product opens the same dialog; closing it returns to the product overview. You can also copy a link from the overview.

## Safe sharing checklist

* Share `paymentLinkUrl` or a derived URL that changes only its encoded query parameters.
* Keep `merchantReference` stable and unique in your system.
* Use webhooks as the server-side payment signal.
* Make fulfillment idempotent so the same paid event cannot deliver twice.
* Compare the order amount and currency with your own product record.


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