Copy of Save a PaymentMethod of a customer for future payments

Learn how to use Fintoc's Checkout Session API to allow your customers to save a payment method for faster future payments

For high frequency payment flows, like ride sharing or delivery apps, you can allow your user to save a Payment Method (a card o a bank account), so their next payments will have less steps.

There are three steps to save a user's payment method using Fintoc:

  1. On your backend, create a Checkout Session using your Secret Key with the flow of each use case:
    1. Setup: save a payment method (with no instant payment)
    2. Payment: pay now and save method for future payments
  2. Redirect your user to complete the flow on the Fintoc-hosted page
  3. Handle post-payments events to save the payment_method of your customer
  4. Create the next Checkout Session for that customer with the id of the saved payment_method

Create a session

The Checkout Session object represents your intent to save a payment method and/or collect a payment.

Using your Secret Key, create a Checkout Session from your backend defining the flow based on your use case:

Setup: Save a payment method (with no instant payment)

Use this flow when you want to save a payment method for future charges without making

curl --request POST "https://api.fintoc.com/v2/checkout_sessions" \
  --header "Authorization: YOUR_SECRET_API_KEY" \
  --header "Content-Type: application/json" \
  --data-raw '{
    "flow": "setup",
    "success_url": "https://merchant.com/success",
    "cancel_url": "https://merchant.com/cancel",
    "customer": "cus_123",
    "metadata": {},
    "setup_future_usage": "on_session",
  }'

Payment: Pay now and save method for future payments

Use this flow when you want to collect a payment now and (if the user opts in) also save the payment method for future charges.

curl --request POST "https://api.fintoc.com/v2/checkout_sessions" \
  --header "Authorization: YOUR_SECRET_API_KEY" \
  --header "Content-Type: application/json" \
  --data-raw '{
    "flow": "payment",
    "amount": 100000,
    "currency": "CLP",
    "success_url": "https://merchant.com/success",
    "cancel_url": "https://merchant.com/cancel",
    "customer": "cus_123",
    "metadata": {},
    "payment_method_save": "enabled",
  }'

Parameter

Example

Description

flow

payment, setup

Type of flow of the session.
setup: suscribe a new method without making an instant payment.

payment: make an instant payment with or without saving the method for later payments

amount

2476

Required amount of money that needs to be paid. It's represented as integer with no decimals in the smallest possible unit of the currency you are using.

If your payment uses Chilean peso, an amount of CLP 2476 is represented as 2476.

If your payment uses Mexican peso, an amount of MXN 24.76 is represented as 2476.

Read here to learn more*

currency

CLP

Required currency that is being used for the payment.

We currently support CLP and MXN for flow payment and only CLP for setup

success_url

https://merchant.com/success

Required URL to redirect the user in case of payment succeeded.

cancel_url

https://merchant.com/987654321

Required URL to redirect the user in case they decide to cancel the payment and return to your website.

customer

{”email”: “[email protected]”}

Required information about the customer. You should send the object with at least a email or a tax_id (RUT in Chile).

You can also use the API to create the customer before the session and just send the ID. (”cus_123…”)

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.

payment_method_types

bank_transfer, card, pac

Optional definition of the payment methods types available for the session. Send if your user already selected the method on your application/website

payment_method_options

bank_transfer: {“institution_id”: “banco_estado”}

Optional definition for an specific payment method type. Like pre selecting a specific bank, as in the example aside.

payment_method_save

enabled, disabled, confirmed

Definition about the option to save the payment method.

enabled: user has the option to save or not.

disabled: user does not have the option to save.

confirmed: user will save the method, without having to accept it on the payment flow. Only used when the user already decided to save it at the merchant’s flow.

setup_future_usage

on_session, off_session

Optional definition for the setup flow about how the payment_method could be used.

on_session: the user needs to make each payment of the method in a session of flow payment

off_session: you as a merchant can charge the method without the user being in a session

📘

Send the payment_method_options to pre select a bank for your user

You have the option create the Checkout Session in Fintoc with an specific bank, so your user will only be able to save a bank account of that specific institution. You can also send the RUT of the user as the holder_id, so it will be already filled on the flow.

It is recommended when you ask your user to decide the bank on your flow, before creating the session in Fintoc. So the user will not have to select bank twice.

Response when creating a Checkout Session

After creating a session, you receive a redirect_url that you must use to redirect your user.


Handle post-session events

Always use webhooks to determine the final outcome. Users may close the tab, lose connection, or never reach your success_url.

Checkout Session events

  • checkout_session.finished

    • Sent when a Checkout Session reaches a final successful state.
    • For flow: setup, this will must include customer and payment_method so you can store them for future charges.
    • For flow: payment, it must include the payment outcome, and if the user opted in, include the payment_method.id

    Example payload:

    {
      "id": "evt_a4xK32BanKWYn",
      "object": "event",
      "type": "checkout_session.finished",
      "data": {
        "id": "cs_li5531onlFDi235",
        "mode": "test",
        "amount": 350000,
        "object": "checkout_session",
        "flow": "payment",
        "status": "finished",
        "currency": "CLP",
        "metadata": {},
        "cancel_url": "https://merchant.com/987654321",
        "created_at": "2026-01-13T18:48:25Z",
        "expires_at": "2026-01-14T18:48:25Z",
        "success_url": "https://merchant.com/success",
        "redirect_url": "https://checkout.fintoc.com/checkout_session_01HXY3Z7X5YQ54V8G2E1KJQAVF",
        "session_token": null,
        "customer_email": null,
        "customer": {
          "name": "Felipe Castro",
          "email": "[email protected]",
          "metadata": {},
          "tax_id": {
            "type": "cl_rut",
            "value": "12088191"
          }
        },
        "setup_payment_method": "on_session" // setup of a method that can be used only during session, so the user needs to intiate the payment 
        "payment_method_types": [
          "bank_transfer", "card"
        ],
        "business_profile": {},
        "payment_resource": {
          "payment_intent": {
            "id": "pi_38DNJo3rbvGUzKFvCGZ6dxR1Kxx",
            "mode": "test",
            "amount": 350000,
            "object": "payment_intent",
            "status": "succeeded",
            "currency": "CLP",
            "metadata": {},
            "created_at": "2026-01-13T18:48:31Z",
            "expires_at": "2026-01-14T18:48:25Z",
            "error_reason": null,
            "payment_type": "bank_transfer",
            "payment_method": "pm_1NkL7QKs215JZ1LyW4c1m9Ut", //id of the saved payment method
            "reference_id": null,
            "widget_token": null,
            "customer_email": null,
            "sender_account": {
              "type": "checking_account",
              "number": "813990168",
              "holder_id": "415792638",
              "institution_id": "cl_banco_falabella"
            },
            "business_profile": {},
            "transaction_date": null,
            "recipient_account": null,
            "payment_type_options": {}
          }
        },
        "payment_method_options": {}
      }
    }

Payment Method events

You will also receive a payment_method.activated with the info of the new saved payment method:

{
  "id": "pm_1NkL7QKs215JZ1LyW4c1m9Ut",
  "object": "payment_method",
  "card": null, 
  "created_at": "2021-10-15T15:22:11.474Z",
  "customer": "cus_NffrFeUfNV2Hib",
  "mode": "live",
  "metadata": {},
  "bank_transfer": {
    "account_holder_id": "123456789",
    "account_number": "9530516286",
    "account_type": "checking_account",
    "institution_id": "cl_banco_santander",
    "status": "active",
  },
  "type": "bank_transfer"
}

You should suscribe to all the following post-session events:

EventDescriptionRecommended action
checkout_session.finishedSession successfully completed.Store customer + payment_method. Update your records based on the final status.
checkout_session.expiredSession expired before completion.Allow the user to retry.
payment_intent.succeededCharge succeeded.Fulfill the order.
payment_intent.failedCharge failed.Retry / ask for another method.
payment_method.activatedMethod becomes available for future charges.Enable “pay with saved method” experiences for that customer.

Create a payment session with a saved payment method (bank transfer)

If your customer has a bank_transfer saved payment_method , you can create a Checkout Session for a payment using it:

curl --request POST "https://api.fintoc.com/v2/checkout_sesison" \
  --header "Authorization: YOUR_SECRET_API_KEY" \
  --header "Content-Type: application/json" \
  --data-raw '{
    "amount": 100000,
    "currency": "CLP",
    "flow: "payment",
    "customer": "cus_123",
    "payment_method": "pm_1NkL7QKs215JZ1LyW4c1m9Ut"
    }
  }'
📘

Less fricción bank transfer payments with saved payment_method

When a user pays with bank_transfer and decides to save it for later payments, you can send the ID of the payment_method in the next Checkout Sessions of that customer.

So they will go directly to the authentication step, without needing to type RUT and password. It can make the payment 2x faster, improving the checkout conversion.

Test your integration

Using your test mode API Secret Key, you can create Checkout Sessions that simulate successful and failed outcomes without moving any money.

This lets you validate your full setup and payment flow end-to-end:

  • Your backend API requests (creating sessions and handling responses)
  • The redirect flow from your frontend to the redirect_url and back to the success_url or cancel_url after the setup or payment
  • Webhook for post-session events to save customer, payment_method and payment result
    • After a successful setup o payment saving a payment_method, test creating a payment session using the saved method of the customer

To learn how to trigger specific scenarios, use the test credentials and special test values described in our testing guide.