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

# Payment links

> Accept payments without writing code by creating shareable Fintoc Payment Links from the dashboard, ideal for one-off charges and no-code checkout flows.

With Payment Links you can accept payments without building a website or application. Create a Payment Link using our API and share it with your customers through email or WhatsApp.

## Requirements

Organizations registered through Shopify can't create Payment Links. Fintoc also locks Payment Link creation for some other organizations. If your organization is locked:

* The **Create payment link** button in the [Dashboard](https://dashboard.fintoc.com/) stays disabled, even if your user has permission to manage payment links. The tooltip shows **You don't have permission to create payment links**.
* The API rejects requests to create payments and Payment Links with `403 Forbidden` and the message `This organization is not allowed to create payments through the API.`

To request Payment Links for your organization, contact [soporte@fintoc.com](mailto:soporte@fintoc.com) or [sales@fintoc.com](mailto:sales@fintoc.com). Fintoc reviews each request.

## Create a Payment Link

Using your [Secret Key](https://docs.fintoc.com/guides/home/api-keys.md), create a payment link from your backend with the `amount` and `currency`:

```bash theme={null}
curl --request POST "https://api.fintoc.com/v1/payment_links" \
--header 'Authorization: sk_test_0000000000000000' \
--header 'Content-Type: application/json' \
--data-raw '{
  "amount": 120900,
  "currency": "CLP",
  "expires_after_seconds": 86400,
  "customer_email": "customer@example.com",
  "checkout": {
    "description": "Use this field to add a custom description of the product the customer is buying"
  },
  "metadata": {
    "your_order_id": "10000"
  },
  "recipient_account": {
    "holder_id": "111111111",
    "number": "0000000000",
    "type": "checking_account",
    "institution_id": "cl_banco_de_chile"
  },
  "business_profile": {
    "name": "Merchant Name",
    "category": "009613",
    "tax_id": "222222222"
  }
}'
```

> [!NOTE]
>
> **Currencies represented as integers**
>
> The Fintoc API represents currencies in its smallest possible units with no decimals (as an integer). That means that an amount of MXN 247.50 gets represented by Fintoc as 24750. You can read more about currencies [here](https://docs.fintoc.com/guides/home/currencies.md).

The parameters `customer_email`, `checkout`, `metadata` and `business_profile` are optional. Some of the optional parameters you can use to create your payment link are:

| Optional parameters | Type | Description |
| :- | :- | :- |
| `expires_after_seconds` | `integer` | The number of seconds after which the payment link will expire. By default, a payment link will not expire. |
| `max_completed_sessions` | `integer` or `null` | Maximum number of completed checkout sessions. The only non-null value is `1`, which creates a single-use link that closes after its first successful payment. If you omit this parameter or send `null`, the payment link is reusable. |
| `customer_email` | `string` | If a customer email is set, Fintoc will send the customer an email in case of a refund. |
| `checkout` | `dictionary` | Customize the checkout for your customers. For now, you can only add a custom description alongside the buy button. |
| `metadata` | `hash` | Set of key-value pairs that you can attach to the payment link. This can be useful for storing additional information that you can use to reconcile the payment with your internal systems. |
| `recipient_account` | `object` | The recipient account object must be included if your organization uses [Direct Payments](https://docs.fintoc.com/guides/payments/direct-payments.md). |
| `business_profile` | `object` | Object to identify enrolled merchants for category-based pricing. |

The recipient account object is defined by 4 attributes:

| Parameter | Example | Explanation |
| :- | :- | :- |
| `holder_id` | 111111111 | Account holder's [RUT](https://es.wikipedia.org/wiki/Rol_%C3%9Anico_Tributario) |
| `number` | 0000000000 | Account number |
| `type` | checking\_account | Type of account. Supported types are `checking_account` and `sight_account`. |
| `institution_id` | cl\_banco\_de\_chile | Fintoc institution id for the bank receiving the bank transfer. You can see the code for each bank [here](https://docs.fintoc.com/guides/payments/direct-payments/setup-direct-payment.md#available-recipient-banks) |

For a complete list of parameters, check the Payment Link API.

## Share your Payment Link

Each payment link contains a `url` that you can share with your customers through email, WhatsApp, or through other channels.

```json theme={null}
{
  "id": "plink_K2zwNNSxPyx8w3GZ",
  "object": "payment_link",
  "amount": 120900,
  "currency": "CLP",
  "status": "active",
  "created_at": "2024-08-02T20:28:13Z",
  "expires_at": "2024-08-02T21:28:13Z",
  "max_completed_sessions": null,
  "mode": "test",
  "url": "https://pay.fintoc.com/plink_K2zwNNSxPyx8w3GZ",
  "customer_email": "customer@example.com",
  "checkout": {
    "description": "Use this field to add a custom description of the product the customer is buying"
  },
  "metadata": {
    "your_order_id": "10000"
  },
  "recipient_account": {
    "holder_id": "111111111",
    "number": "0000000000",
    "type": "checking_account",
    "institution_id": "cl_banco_de_chile"
  }
}
```

## Offer cash payments in Mexico

If your organization has [cash payments](https://docs.fintoc.com/guides/payments/cash-payment-direct-api.md) enabled, your `MXN` Payment Links offer cash automatically. You don't need to send any extra parameter when you create the link.

Your customer sees a **Paga en efectivo** option next to the other payment methods, with the logos of the stores that accept the link's amount. After choosing it, your customer generates a voucher with the reference to pay at the store.

Fintoc hides the cash option when:

* No store accepts the Payment Link's amount.
* Your organization's checkout session lasts less than the time your customer needs to pay in cash.

## Track payments

When customers use a payment link to complete a payment, Fintoc [sends a `payment_intent.succeeded` webhook](https://docs.fintoc.com/api/main-resources/events-reference/types-of-events) that you can use for fulfillment and reconciliation. **This webhook will contain the `metadata` keys you used to create the payment link**.

For more information, see our guide on [how to complete the payment on your backend](https://docs.fintoc.com/guides/payments/accept-a-payment.md#complete-the-payment-on-your-backend). For payment links, we recommend that you only listen for `payment_intent.succeeded` events.

You can also see a Payment Link's successful payments in the [Dashboard](https://dashboard.fintoc.com/):

* **From the Payment Links table:** Click the count in the **Payments received** column. If the link has one successful payment, the Dashboard opens that payment's detail. If the link has more than one successful payment, the Dashboard opens your payment history filtered by that link and the **Succeeded** status. Links without successful payments show `--`.
* **From the payment history:** Use the **Payment Link** filter and enter the exact Payment Link ID. The filter appears when your organization has at least one Payment Link in the current mode.
* **From a payment's detail:** If the payment came from a Payment Link, the **Payment Link** row shows the link's ID. Click it to open the Payment Links table filtered by that ID.

To see all of a Payment Link's details in one place, click its row in the Payment Links table. The detail page shows the link amount, the number of payments received, the total received, the link's details, and the link's metadata. It also includes a **Payments** table with every payment made through the link. The **Total received** amount doesn't deduct refunds or chargebacks.

## Cancel a Payment Link

You can cancel an active payment link from the Dashboard or through the API. You can only cancel active links. You can't cancel expired links, canceled links, or single-use links with a **Completed** status.

### From the Dashboard

1. Go to the Payment Links table in the [Dashboard](https://dashboard.fintoc.com/).
2. Click the three-dot menu on the row of the payment link you want to cancel. You can also open the payment link's detail page and click the three-dot menu at the top.
3. Select **Deactivate**.
4. In the confirmation modal, click **Deactivate**.

The three-dot menu also has **Copy URL** and **Open link**. The Dashboard only shows **Deactivate** to users with permission to manage payment links, and only enables it for active links.

> [!NOTE]
>
> You can't undo the deactivation of a payment link. Payments that are already in progress when you deactivate the link can still complete.

### Through the API

Cancel a payment link using the cancel endpoint:

```bash theme={null}
curl --request PATCH \
     --url https://api.fintoc.com/v1/payment_links/plink_K2zwNNSxPyx8w3GZ/cancel \
     --header 'Authorization: sk_test_0000000000000000' \
     --header 'accept: application/json'
```

After you cancel a payment link, customers can’t finalize purchases using the link anymore and are redirected to an expiration page.
