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 three steps to save a user's payment method using Fintoc:
- On your backend, create a
Checkout Sessionusing your Secret Key with theflow: setup - Redirect your user to complete the flow on the Fintoc-hosted page
- Handle post-payments events to save the
payment_methodof yourcustomer - Create a Checkout Session of
flow: paymentfor thatcustomerwith the id of the savedpayment_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 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 |
|---|---|---|
|
| Type of flow of the session. |
| CLP | Required currency that is being used for the payment. We currently support only CLP for |
|
| Required URL to redirect the user in case of setup succeeded. |
|
| Required URL to redirect the user in case they decide to cancel the setup and return to your website. |
|
| 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. |
|
| 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. |
|
| Optional definition of the payment methods types available for the session. Send if your user already selected the method on your application/website |
| Object | 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 userYou have the option create the Checkout Session in Fintoc with an specific bank sending its
institution_idinside thesender_accountof thepayment_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 theholder_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 includecustomerandpayment_methodso you can store them for future charges. - For
flow: payment, it must include the payment outcome, and if the user opted in, include thepayment_method.id
Example payload:
{ "id": "evt_a4xK32BanKWYn", "object": "event", "type": "checkout_session.finished", "data": { "id": "cs_li5531onlFDi235", "object": "checkout_session", "mode": "test", "flow": "setup", "status": "finished", "amount": 350000, "currency": "CLP", "metadata": {}, "cancel_url": "https://merchant.com/987654321", "success_url": "https://merchant.com/success", "redirect_url": "https://checkout.fintoc.com/checkout_session_01HXY3Z7X5YQ54V8G2E1KJQAVF", "created_at": "2026-01-13T18:48:25Z", "expires_at": "2026-01-14T18:48:25Z", "session_token": null, "customer_email": null, "customer": { "name": "Felipe Castro", "email": "[email protected]", "metadata": {}, "tax_id": { "type": "cl_rut", "value": "12088191" } }, "payment_method_types": [ "bank_transfer" ], "business_profile": {}, "payment_resource": {}, "setup_intent": "seti_3AUiBT4dia35S27G7mK8RnQg2SK" } }
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:
| Event | Description | Recommended action |
|---|---|---|
checkout_session.finished | Session successfully completed. | Store customer + payment_method. Update your records based on the final status. |
checkout_session.expired | Session expired before completion. | Allow the user to retry. |
payment_method.activated | Method 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",
"success_url": "https://merchant.com/success",
"cancel_url": "https://merchant.com/cancel",
"customer": "cus_123",
"payment_method": "pm_1NkL7QKs215JZ1LyW4c1m9Ut",
"payment_method_types": [
"bank_transfer"
]
}'| Event | Description | Recommended action |
|---|---|---|
checkout_session.finished | Session successfully completed. | Store customer + payment_method. Update your records based on the final status. |
checkout_session.expired | Session expired before completion. | Allow the user to retry. |
payment_intent.succeeded | Payment succeeded. | Fulfill the order. |
payment_intent.failed | Payment failled. | Retry / ask for another method. |
Test your integration (Sandbox available soon)
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_urland back to thesuccess_urlorcancel_urlafter the setup or payment - Webhook for post-session events to save
customer,payment_methodand 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.
Updated about 3 hours ago