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

# Payment links

> Set up payment links to accept payments from your customers.

Payment links allows you to generate a link, send it to a customer via email/sms/etc,
and then have the customer pay without the need for you to host your own checkout.

## Creating a payment link

You can use the payment links endpoint to create a payment link with the data that will be
displayed on the mattilda Pay hosted page. The [payment links API endpoint](/reference/payment-links/new-payment-link) makes it
easy to get create a new payment link.

<CodeGroup>
  ```json Request theme={"dark"}
  {
    "currency":"MXN",
    "country":"MX",
    "amount":1000,
    "metadata":{
      "TypeOfPayment":"purchase",
      "Carbon_FootPrint":"10"
    },
    "cart_items":[
      {
        "name":"Aloe",
        "unit_amount":1000,
        "quantity":1,
        "sku":"aloe"
      }
    ],
    "merchant_banner_url":"https://susies.store/logo.svg",
    "merchant_color":"#cf6b6b",
    "merchant_name":"Susie's Store",
    "merchant_message":"Thanks for your purchase at Susie's Store!",
    "merchant_terms_and_conditions_url":"https://susies.store/terms-and-conditions",
    "return_url":"https://susies.store/success"
  }
  ```
</CodeGroup>

The payment link will include the `expires_at`, `status`, and other useful information
that will be used by the mattilda Pay hosted page. Make note of the returned `id` as it will be used in the next step.

<CodeGroup>
  ```json Response theme={"dark"}
  {
      "id": "09e90ace-a746-41f5-88d2-8b16335ded97",
      "type": "payment-link",
      "expires_at": "2025-01-28T14:45:45.929102+00:00",
      "amount": 1000,
      "currency": "MXN",
      "country": "MX",
      "status": "active",
      ...
  }
  ```
</CodeGroup>

On top of the `merchant_*` specific values, this API supports values that are going to be displayed by the mattilda Pay hosted page
and also passed to [Embed](/guides/payments/embed/options#options) to process the transaction.

* `amount`
* `currency`
* `country`
* `metadata`
* `cart_items`
* `buyer`
* `externalIdentifier`
* `intent`
* `paymentSource`

By creating a payment link you're ready to send it to your customer to complete the payment.
