> ## 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 code.

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.

## Create a Payment Link

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

```curl 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"
  }
}'
```

<br />

<Info>
  **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](/guides/home/currencies).
</Info>

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.                                                                                 |
| `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](/guides/payments/direct-payments) .                                                               |
| `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](/guides/payments/direct-payments/setup-direct-payment#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",
  "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"
  },
	"business_profile": {
  	"name":"Merchant Name",
    "category": "009613",
    "tax_id": "222222222"
  }
}
```

## Track payments

When customers use a payment link to complete a payment, Fintoc [sends a `payment_intent.succeeded` webhook](/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](/guides/payments/accept-a-payment#complete-the-payment-on-your-backend). In the case of payment links, we recommend you to only listen for `payment_intent.succeeded` events.

You can also see successful payments using our [Dashboard](https://dashboard.fintoc.com/).

## Cancel a Payment Link

You can cancel a payment link using the cancel endpoint:

```curl 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.
