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 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 2 ways to save a user's payment method using Fintoc:

  1. Save during a payment: creating a Checkout Session of flow: payment, you can add the attribute save_payment_method: enabled. So your customer will have the option to save the method for future payments.
  2. Save without a current payment: You can create a Checkout Session with flow: setup to allow users to enroll a method without processing a payment.

Option 1 — Save during a payment (recommended)

The customer pays and their payment method is saved in a single step.

Create a Customer

Every saved payment method must belong to a Customer. Create one first if you don't have one already.

curl -X POST https://api.fintoc.com/v2/customers \
  -H "Authorization: sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Juan Pérez",
    "email": "[email protected]"
  }'

Save the returned id (e.g. cus_3B2bODrQFje7ZVkT69xyaTSDwXQ).

Create a Checkout Session with save_payment_method

Create a Checkout Session with the ID of thecustomer,flow: "payment" and save_payment_method: "enabled". So Fintoc will process the payment and store the customer's credentials for future use, if they choose to save it during the flow.

curl -X POST "https://api.fintoc.com/v2/checkout_sessions" \
  -H "Authorization: sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "flow": "payment",
    "customer": "cus_xxxxx",
    "amount": 5000,
    "currency": "CLP",
    "success_url": "https://yoursite.com/success",
    "cancel_url": "https://yoursite.com/cancel",
    "save_payment_method": "enabled"
  }'

Parameter

Example

Description

flow

payment

Type of flow of the session.

currency

CLP

Required currency that is being used for the payment.

We currently support only CLP to save a payment method

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_data or customer

customer_data: {”email”: “[email protected]”}
(to create a new customer) or customer: "cus_123" (of an existing customer)


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 its ID.

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

Required definition of the payment methods types available for the session.

bank_transfer is current the only available type to save a method while collecting a payment.

payment_method_options

Object bank_transfer with the sender_account information. Complete example here at the API Reference

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

save_payment_method

enabled

Optional definition if the customer will have the option to save the payment method. Default is disabled

Redirect the customer

Use the redirect_url to redirect the customer to the Fintoc-hosted page. Where they will have payment flow and the option to save credentials for future payments.

Handle post-payment 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. it must include the payment outcome, and if the user opted in, include the payment_method.id

    Example payload:

    {
        "id": "cs_VvO7kpUMWlq2N10B",
        "flow": "payment",
        "mode": "test",
        "amount": 5000,
        "object": "checkout_session",
        "status": "finished",
        "currency": "CLP",
        "customer": {
            "id": "cus_xxxxx",
            "mode": "live",
            "name": null,
            "email": "[email protected]",
            "phone": null,
            "object": "customer",
            "tax_id": {
                "type": "cl_rut",
                "value": "257932338"
            },
            "address": null,
            "metadata": {},
            "created_at": "2026-03-16T19:41:17Z"
        },
        "metadata": {},
        "cancel_url": "https://yoursite.com/cancel",
        "created_at": "2026-03-30T20:47:41Z",
        "expires_at": "2026-03-31T20:47:41Z",
        "line_items": null,
        "success_url": "https://yoursite.com/success",
        "redirect_url": "https://pay.fintoc.com/payment?checkout_session=cs_VvO7kpUMWlq2N10B",
        "setup_intent": null,
        "subscription": null,
        "session_token": "cs_VvO7kpUMWlq2N10B_sec_UuSuPYRuEQTcWKXT6ba9LDTh",
        "customer_email": null,
        "payment_method": "pm_3BgHP7aSqsqLiEcotFQfyx7Of8u",
        "business_profile": null,
        "payment_resource": {
            "payment_intent": {
                "id": "pi_3BgHFvey4Qj4QZvTTZwyLL9OfSA",
                "mode": "test",
                "amount": 5000,
                "object": "payment_intent",
                "status": "succeeded",
                "currency": "CLP",
                "metadata": {},
                "created_at": "2026-03-30T20:48:12Z",
                "expires_at": null,
                "next_action": null,
                "error_reason": null,
                "payment_type": "bank_transfer",
                "reference_id": "575930",
                "widget_token": null,
                "customer_email": null,
                "sender_account": {
                    "type": "checking_account",
                    "number": "19831940978",
                    "holder_id": "257932338",
                    "institution_id": "cl_banco_falabella"
                },
                "business_profile": null,
                "transaction_date": "2026-03-30T20:49:00Z",
                "recipient_account": {
                    "type": "checking_account",
                    "number": "922358017",
                    "holder_id": "771433855",
                    "institution_id": "cl_banco_security"
                },
                "payment_type_options": {}
            }
        },
        "save_payment_method": "enabled",
        "payment_method_types": [
            "bank_transfer",
            "card"
        ],
        "payment_method_options": {}
    }

Payment Method events

If the customer chose to save the method, you will also receive a payment_method.activated with the info of the new saved payment method:

{
  "id": "pm_3BgHP7aSqsqLiEcotFQfyx7Of8u",
  "object": "payment_method",
  "card": null, 
  "created_at": "2021-10-15T15:22:11.474Z",
  "customer": "cus_NffrFeUfNV2Hib",
  "mode": "live",
  "metadata": {},
  "bank_transfer": {
    "account_holder_id": "257932338",
    "account_number": "19831940978",
    "account_type": "checking_account",
    "institution_id": "cl_banco_falabella",
    "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_method.activatedMethod becomes available for future charges.Enable “pay with saved method” experiences for that customer.

Option 2 — Save a method without a current payment

Create a Setup 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 with the flow: setup:

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",
    "currency": "CLP",
    "success_url": "https://merchant.com/success",
    "cancel_url": "https://merchant.com/cancel",
    "customer_data": {
      "email": "[email protected]"
    },
    "metadata": {}
  }'

Parameter

Example

Description

flow

setup

Type of flow of the session.

currency

CLP

Required currency that is being used for the payment.

We currently support only CLP for setup

success_url

https://merchant.com/success

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

cancel_url

https://merchant.com/987654321

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

customer_data or customer

customer_data: {”email”: “[email protected]”}
(to create a new customer) or customer: "cus_123" (of an existing customer)


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.

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

Object bank_transfer with the sender_account information. Complete example here at the API Reference

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

📘

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 sending its institution_id inside the sender_account of the payment_method_options, 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.

Redirect the customer

After creating a session, you receive a redirect_url that you must use to redirect your user so they can enroll their bank account as a saved payment method.


Handle post-session events

You should suscribe to the same post-session events mentioned for the Payment flow


Create a payment session with a saved payment method

If your customer has a bank_transfer saved payment_method , you can create a Checkout Session for a payment using it. So they will be redirected direct to the step to approve the payment with their bank, without having to initiate session with their credentials.

curl --request POST "https://api.fintoc.com/v2/checkout_sesisons" \
  --header "Authorization: YOUR_SECRET_API_KEY" \
  --header "Content-Type: application/json" \
  --data-raw '{
    "amount": 100000,
    "currency": "CLP",
    "flow": "payment",
    "success_url": "https://merchant.com/success",
    "cancel_url": "https://merchant.com/cancel",
    "customer": "cus_123",
    "payment_method": "pm_1NkL7QKs215JZ1LyW4c1m9Ut",
    "payment_method_types": [
      "bank_transfer"
    ]
  }'

Redirect the customer

Use the redirect_url to redirect the customer to the Fintoc-hosted page. Where they will go direct to the bank approval step, without having to initiate session with their credentials.

Handle post-payment events

After the payment, you will receive the checkout_session and payment_intent webhook events, confirming the final status of the session and payment:

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.succeededPayment succeeded.Fulfill the order.
payment_intent.failedPayment failed.Retry / ask for another method.

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