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

# Getting paid with payment links

> Accept payments from your customers with secure, customizable payment links that integrate seamlessly with your business workflow.

Payment links enable you to accept payments from your customers through secure, shareable URLs. Whether you're invoicing clients, collecting donations, or selling products, payment links provide a simple and professional way to get paid.

Qonto supports two types of payment links:

* **Basket payment links**: Perfect for itemized payments with detailed breakdowns, VAT rates, and reusable options
* **Invoice payment links**: Designed specifically for invoice payments with customer information and invoice details

This guide outlines the available API endpoints for managing payment links and the steps to integrate them into your business operations.

## How payment links work

Payment links are unique URLs that you can share with your customers to collect payments. Each link is tied to a specific amount and can be customized with your branding and payment details.

### 1. Connect to the payment provider

Before you can create payment links, you need to connect your Qonto account to the payment links provider. This establishes the secure connection needed to process payments.

To connect, send a `POST` request to `/v2/payment_links/connections` (see [Connect to the payment links provider](/api-reference/business-api/payments-transfers/payment-links/connect)).

Once connected, you can check the connection status at any time by sending a `GET` request to `/v2/payment_links/connections` (see [Get the connection status](/api-reference/business-api/payments-transfers/payment-links/get-connection)).

You can also subscribe to webhooks to receive real-time updates about connection status changes (see [Payment links connection webhooks](/api-reference/business-api/webhooks/supported-webhooks/v1-payment-links-connections)).

*Note: only one connection can be active per Qonto user.*

### 2. Create a payment link

After establishing the connection, you can create payment links for your customers. Qonto supports two types of payment links:

#### Basket Payment Links

Basket payment links are ideal for collecting payments for multiple items or services. They include:

* **items**: A detailed breakdown of items that make up the total payment amount, including:
  * Item title, description, and type (good or service)
  * Quantity and unit price
  * VAT rate for each item

* **reusable**: A boolean value indicating whether the payment link can be used multiple times or is single-use

* **potential\_payment\_methods**: The list of payment methods available to your customers

#### Invoice Payment Links

Invoice payment links are designed specifically for collecting invoice payments. They include:

* **invoice\_id**: The unique identifier of the invoice
* **invoice\_number**: The invoice number for reference (e.g., "INV-12345")
* **debitor\_name**: The name of the customer/debitor
* **amount**: The total invoice amount with currency and value
* **potential\_payment\_methods**: The list of payment methods available to your customers

#### Supported Payment Methods

* `credit_card`: Credit card payments
* `apple_pay`: Apple Pay payments
* `paypal`: PayPal payments
* `ideal`: iDEAL payments

Note: The actual availability depends on which methods the customer has enabled from the provider. You can get the available payment methods with a `GET` request to `/v2/payment_links/payment_methods` (see [List available payment methods](/api-reference/business-api/payments-transfers/payment-links/index-payment-methods)).

To create a payment link (either basket or invoice), send a `POST` request to `/v2/payment_links` (see [Create a payment link](/api-reference/business-api/payments-transfers/payment-links/create)).

### 3. Share and track payments

Once created, you can share the payment link with your customers via email, messaging apps, or embed it in your website. The link will direct customers to a secure payment page where they can complete their transaction.

You can track the status of payments by listing all payments for a specific payment link using a `GET` request to `/v2/payment_links/{id}/payments` (see [List payments for a payment link](/api-reference/business-api/payments-transfers/payment-links/index-payments)).

You can also receive real-time updates about payment status changes by subscribing to payment link webhooks (see [Payment link webhooks](/api-reference/business-api/webhooks/supported-webhooks/v1-payment-links)).

### 4. Manage your payment links

You have full control over your payment links:

* **List all payment links**: Get an overview of all your payment links with a `GET` request to `/v2/payment_links` (see [List payment links](/api-reference/business-api/payments-transfers/payment-links/index))
* **View specific payment link**: Retrieve details of a specific payment link with a `GET` request to `/v2/payment_links/{id}` (see [Get a payment link](/api-reference/business-api/payments-transfers/payment-links/show))
* **Deactivate a payment link**: Stop accepting payments on a specific link with a `PATCH` request to `/v2/payment_links/{id}/deactivate` (see [Deactivate a payment link](/api-reference/business-api/payments-transfers/payment-links/deactivate))

## Payment link statuses

Payment links can have different statuses throughout their lifecycle:

* **open**: The payment link is active and ready to accept payments
* **expired**: The payment link has passed its expiration date
* **canceled**: The payment link has been manually deactivated
* **paid**: A payment has been successfully completed
* **processing**: A payment is being processed

## Payment statuses

Individual payments within a payment link can have these statuses:

* **open**: The payment is ready to be completed
* **pending**: The payment is being processed
* **authorized**: The payment has been authorized but not yet settled
* **paid**: The payment has been successfully completed
* **canceled**: The payment has been canceled
* **expired**: The payment has expired
* **failed**: The payment failed to process

## Summary

Here are the steps to follow when working with payment links:

1. **Connect to the payment provider**: Establish the connection by sending a `POST` request to `/v2/payment_links/connections`
2. **Check connection status**: Verify the connection is active with a `GET` request to `/v2/payment_links/connections`
3. **Create a payment link**: Generate a new payment link with a `POST` request to `/v2/payment_links`
4. **Share the link**: Send the payment link to your customers
5. **Track payments**: Monitor payment status with a `GET` request to `/v2/payment_links/{id}/payments`
6. **Manage links**: List, view, or deactivate payment links as needed

Payment links provide a professional, secure way to accept payments from your customers while maintaining full control over your payment collection process.

```mermaid theme={null}
sequenceDiagram
    actor user as User
    participant partner as Partner
    participant qonto as Qonto
    participant mollie as Mollie

    user->>partner: I want to use payment links
    partner->>qonto: Create connection to payment links provider
    qonto->>mollie: Kickoff connection
    mollie-->>qonto: Redirect URL
    qonto-->>partner: Redirect URL
    partner->>user: Redirect to payment links provider to finalize the connection
    user->>mollie: Finalize connection
    qonto->>partner: Webhook: connection established
    note over user,mollie: Connection established

    user->>mollie: Open payment link URL
    mollie-->>user: Display payment page
    user->>mollie: Complete payment
    mollie-->>user: Payment confirmation
    qonto->>partner: Webhook: payment is in processing state
```

## How to test payment links

In order to quickly test payment links without going through the full setup of a connection, you can use the Qonto organization named `Abacate Organization`, available in sandbox environment. You have the credentials for this organization in the developer portal.

Once you're redirected to Mollie to pay the payment link, you can use the following test card details:

* Card number: `4543 4740 0224 9996`
* Expiration date: any future date
* CVC: any 3 digits

After the payment, you are asked which payment status you want to simulate. You can choose `paid` to simulate a successful payment.

If you want to test the connection flow, you will have to create a new Qonto user account in the sandbox environment and use it to connect to Mollie.
