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

# Buy Now Pay Later (Chile Only)

> Learn how to use the Checkout Session API to create a Buy Now Pay Later payment

You can accept the method of Buy Now Pay Later (installments payments without a credit card) from customers in Chile by using the Checkout Session API. Customers will have an offer to pay in installments by subscribing for the automatic charge on their bank of each installment related to the payment.

Our Buy Now Pay Later product is in partnership with [Banca.me](https://www.banca.me/).

## Create a Buy Now Pay Later payment

Using your Secret Key, create a `Checkout Session` on your server with an `amount`, `currency`(only CLP for Installments Payments), `success_url`, `cancel_url` and `payment_methods: ["instalments_payment"]`:

```curl theme={null}
curl --request POST \
     --url https://api.fintoc.com/v1/checkout_sessions \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "amount": 100000,
  "currency": "CLP",
  "cancel_url": "https://merchant.com/987654321",
  "success_url": "https://merchant.com/success",
  "customer_email": "customer@example.com",
  "metadata": {
    "order": "123456"
  },
  "payment_methods": ["installments_payment"]
}'
```

| Parameter         | Example                          | Explanation                                                                                                                                                                                                                                                                                                                        |
| ----------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `amount`          | `100000`                         | Amount of money that needs to be paid. It's represented as an integer with no decimals in the smallest possible unit of the currency you are using.<br />**At the moment, the minimum amount is CLP 20,000 and the maximum is CLP 400,000.** However, we can evaluate your specific use case if you have a higher average ticket." |
| `currency`        | `CLP`                            | Currency that is being used for the payment. We currently only support CLP for installments payments.                                                                                                                                                                                                                              |
| `cancel_url`      | `https://merchant.com/987654321` | URL to redirect the user in case they decide to cancel the payment and return to your website.                                                                                                                                                                                                                                     |
| `success_url`     | `https://merchant.com/success`   | URL to redirect the user in case of payment succeeded.                                                                                                                                                                                                                                                                             |
| `customer_email`  | `customer@example.com`           | A customer email linked to the Checkout Session.<br />**It is a required field** for a `installments_payment` method.                                                                                                                                                                                                              |
| `payment_methods` | `["installments_payment"]`       | Payment methods available for the customer. `instalments_payment` represents the Buy Now Pay Later method and must be the only method set.<br />**It is not current available to include more than one payment method.**                                                                                                           |
| `metadata`        | `{ "order": "#987654321"   }`    | Optional set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.                                                                                                                                                                   |

<Info>
  **Installments Payment Only Available via the Redirect Page Flow**

  To accept installments payments you must use the integration via a [Redirect Page](/docs/payments/redirect-page) where you will redirect users to a Fintoc-hosted payment page.

  After completing the payment, they’ll be automatically redirected back to your site on the `success_url `or `cancel_url`, based on the outcome of the payment.
</Info>

## Response when creating a Checkout Session for a Installments Payment

After making the request, Fintoc will respond with the Checkout Session with the status `created` including the `redirect_url`you will use to redirect your user to complete the payment:

```json theme={null}
{
  id: "cs_li5531onlFDi235",
  created_at: "2025-02-15T15:22:11.474Z",
  object: "checkout_session",
  expires_at: "2025-02-15T15:37:11.474Z",
  mode: "live",
  status: "created",
  metadata: {
    "order": "123456"
  },
  payment_methods: ["installments_payment"],
  currency: "CLP",
  amount: 100000,
  cancel_url: "https://merchant.com/987654321",
  success_url: "https://merchant.com/success",
  redirect_url: "https://pay.fintoc.com/payment?checkout_sesion=cs_li5531onlFDi235"
}

```

| Parameter      | Example                                                              | Explanation                                      |
| :------------- | :------------------------------------------------------------------- | :----------------------------------------------- |
| `redirect_url` | `https://pay.fintoc.com/payment?checkout_session=cs_li5531onlFDi235` | URL to redirect the user to complete the payment |

## Handle post-payments events

Once a Checkout Session finishes, you handle the payment result in your frontend and complete the payment in your backend. For your frontend you will use the`success_url` and `cancel_url` , and for your backend you will use the events sent by webhooks.

Fintoc sends a `checkout_session.finished` event when the payment completes. [Follow the webhook guide](/docs/resources/webhooks-walkthrough) to receive these events and run actions, such as sending an order confirmation email to your customer, logging the sale in a database, or starting a shipping workflow.

You should handle the following events:

| Event                       | Description                                                                | Action                                                 |
| :-------------------------- | :------------------------------------------------------------------------- | :----------------------------------------------------- |
| `checkout_session.finished` | Sent when a payment associated to a Checkout Session reaches a final state | Complete the order based on the payment's final status |
| `checkout_session.expired`  | Sent when a session expires                                                | Offer the customer another attempt to pay.             |

<br />

## Test your integration

To simulate a successful or failed Buy Now Pay Later Payment, you can use one of the following RUT numbers during the payment process:

| **RUT number**                                          | **Final Result**                                 |
| ------------------------------------------------------- | ------------------------------------------------ |
| Any number, except 11111111-1, 44444444-4 or 22222222-2 | ✅ Succeeded                                      |
| 11111111-1                                              | ❌ Failed due to no available credit offer        |
| 44444444-4                                              | ❌ Failed due to an active credit                 |
| 22222222-2                                              | ❌ Failed during the credit contract signing step |

In test mode, the payment process does not include the PAC subscription step. So when accessing the `redirect_url`, the steps will be:

1. Input RUT number
2. View and select an installment plan offer: In test mode, only one installment option is available (a single payment of 103,103 CLP), regardless of the amount specified when creating the Checkout Session.
3. Confirm mobile number via SMS code. In test mode you can input any mobile number to proceed, since you can use the following codes:
   1. Any code except 123456 to proceed to the next step.
   2. 123456 to simulate a failure at this step.
4. Sign the credit contract: you will receive a code at the `customer_email` you set when creating the Checkout Session. Use this code to proceed to a successful payment.
5. Payment successful: you will be redirected to the `success_url` and receive the `checkout_session.finished` event.

## Checkout UX Guideline

To ensure a good experience and understanding for your users, add the Buy Now Pay Later button on your checkout using the images bellow depending on your configuration:

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Description                                                    | HTML                                                                                  |
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------- | :------------------------------------------------------------------------------------ |
| <img src="https://mintcdn.com/fintoc-49b8bee8/YQmOnq8Zegydl6oL/images/17bae8e8816db69bd877063cd00399f76f844e928122a56a9c004365ed5f77b1-bnpl_bancame_fintoc_combo_cl_light.svg?fit=max&auto=format&n=YQmOnq8Zegydl6oL&q=85&s=f47250edaaa7f5dbb9dad0233f338d63" alt="" width="389" height="40" data-path="images/17bae8e8816db69bd877063cd00399f76f844e928122a56a9c004365ed5f77b1-bnpl_bancame_fintoc_combo_cl_light.svg" /> | Light button to use with the text "Paga en cuotas sin Tarjeta" | `<img src="https://assets.fintoc.com/?img_name=bnpl_bancame_fintoc_combo_cl_light">`  |
| <img src="https://mintcdn.com/fintoc-49b8bee8/SkvJJ-DZ5D4yC6tQ/images/eef6f427a77ff194e937374d567ec5e1da3c21685251c5ae360772c9b631e17f-bnpl_banca.me_fintoc_combo_cl_dark.svg?fit=max&auto=format&n=SkvJJ-DZ5D4yC6tQ&q=85&s=843e52997e6e3657546a8c9edc4a4965" alt="" width="388" height="40" data-path="images/eef6f427a77ff194e937374d567ec5e1da3c21685251c5ae360772c9b631e17f-bnpl_banca.me_fintoc_combo_cl_dark.svg" /> | Dark button to use with the text "Paga en cuotas sin Tarjeta"  | `<img src="<https://assets.fintoc.com/?img_name=bnpl_bancame_fintoc_combo_cl_dark>">` |
| <img src="https://mintcdn.com/fintoc-49b8bee8/YQmOnq8Zegydl6oL/images/8d52ee81db5137549174d3bac6ff2e7a3af594531c9cb3f6b74d98625c73714b-bancame_fintoc_light.svg?fit=max&auto=format&n=YQmOnq8Zegydl6oL&q=85&s=13c1e2aa1a5b541a47a37171de1d7bd7" alt="" width="121" height="40" data-path="images/8d52ee81db5137549174d3bac6ff2e7a3af594531c9cb3f6b74d98625c73714b-bancame_fintoc_light.svg" />                                                                                                                 | Light logos to use with the text + bank logos image            | `<img src="https://assets.fintoc.com/?img_name=bancame_fintoc_light">`                |
| <img src="https://mintcdn.com/fintoc-49b8bee8/YQmOnq8Zegydl6oL/images/b169eac9b4e51b5e9ca676b2e3e0de0edd466da1934eea83dbde341b5ac64f19-bancame_fintoc_dark.svg?fit=max&auto=format&n=YQmOnq8Zegydl6oL&q=85&s=7aabafb0908543e7d707ad2026c44120" alt="" width="120" height="39" data-path="images/b169eac9b4e51b5e9ca676b2e3e0de0edd466da1934eea83dbde341b5ac64f19-bancame_fintoc_dark.svg" />                                                                                                                         | Dark logos to use with the text + bank logos image             | `<img src="https://assets.fintoc.com/?img_name=bancame_fintoc_dark">`                 |
| <img src="https://mintcdn.com/fintoc-49b8bee8/YQmOnq8Zegydl6oL/images/0b5270387120f15d40535dd93a832582ad73a08652f388737be1296515c5e179-bnpl_fintoc_combo_cl_light.svg?fit=max&auto=format&n=YQmOnq8Zegydl6oL&q=85&s=0bb797d662848bf6ff58ec443de3e576" alt="" width="249" height="87" data-path="images/0b5270387120f15d40535dd93a832582ad73a08652f388737be1296515c5e179-bnpl_fintoc_combo_cl_light.svg" />                                                                 | Light text + bank logos to use witht the logos                 | `<img src="https://assets.fintoc.com/?img_name=bnpl_fintoc_combo_cl_light">`          |
| <img src="https://mintcdn.com/fintoc-49b8bee8/YQmOnq8Zegydl6oL/images/368c60ba72d3fa0b09935231a3c6fc138ff9c5e4767897668425e88fdd985d09-bnpl_fintoc_combo_cl_dark1.svg?fit=max&auto=format&n=YQmOnq8Zegydl6oL&q=85&s=1b53c79227f1f2d898c0f41ca4c6b2bc" alt="" width="249" height="87" data-path="images/368c60ba72d3fa0b09935231a3c6fc138ff9c5e4767897668425e88fdd985d09-bnpl_fintoc_combo_cl_dark1.svg" />                                                                 | Dark text + bank logos to use with the logos                   | `<img src="https://assets.fintoc.com/?img_name=bnpl_fintoc_combo_cl_dark">`           |

<Info>
  **Make sure the Buy Now, Pay Later option is hidden for amounts below the minimum.**

  Since the minimum amount for installment payments is CLP 20,000, you should ensure that the Buy Now, Pay Later button is not displayed at checkout for orders below this threshold. This helps avoid a poor user experience and potential drop in conversion rates.
</Info>
