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

# Payment links

> Send a customer to a Payra page that takes the payment, for an invoice that already exists or for an amount your server sets.

A **payment link** sends your customer to a page on Payra's domain that takes the payment by card or bank account,
so card and bank details never reach your systems. There are two:

* An **invoice link** pays an invoice already in Payra. Every open invoice carries one as `payment_url`: you read it
  from [Invoices](https://docs.payra.com/invoices.md), you do not create it.
* A **checkout link** pays an amount your server sets, such as an order or a deposit with no invoice yet. You create
  it with `POST /checkout-sessions`; see [Hosted checkout](https://docs.payra.com/hosted-checkout.md).

Only an invoice link pays a specific invoice. A checkout session has no invoice field, so its payment is not applied
to one.

## What the customer sees

An invoice link opens the invoice, with what is left to pay:

![An invoice's payment page: the invoice's dates and lines on the left, the balance due and the Pay button on the right](https://mintlify.s3.us-west-1.amazonaws.com/payra/images/payment-links-invoice.png)

A checkout link opens the order your server sent, with its lines and the ways to pay the page offers:

![A checkout page: the order summary and total on the left; Apple Pay, Google Pay, card and bank account on the right](https://mintlify.s3.us-west-1.amazonaws.com/payra/images/payment-links-checkout.png)

## Which one to use

| | Invoice link | Checkout link |
| - | - | - |
| Use it for | An invoice that already exists | An order, a deposit or any amount with no invoice yet |
| Who makes the link | Payra, when the invoice arrives from your ERP or is sent from the dashboard | Your server, with `POST /checkout-sessions` |
| Amount | What is left to pay on the invoice | The `amount` you set |
| How long it works | While the invoice is open and its link has not expired ([details](https://docs.payra.com/invoices.md#the-payment-link)) | One payment; 24 hours unless you set `expires_at`, up to 7 days |
| Where the payment lands | On the invoice and, for an ERP invoice, back in your ERP through Payra Connect | On a payment you read through the API, filed on the customer when you pass `customer` |
| How you learn it was paid | Read the invoice: `amount_paid` and `status` change. No webhook is sent | The `checkout_session.completed` or `payment.succeeded` [webhook](https://docs.payra.com/webhooks.md), or read the session |
| After paying, the customer | Stays on Payra's page | Goes back to your `success_url` |
| Scope | `invoices:read` | `payments:write` to create, `payments:read` to read |


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