Skip to main content
Save a customer’s payment method once and charge it later for on-demand or variable-amount payments, without creating a recurring subscription. Unlike the subscription flow, the setup flow does not couple enrollment with recurring billing, so you decide when and how much to charge. Set up a payment method and charge it later in four steps:
  1. On your backend, create a Checkout Session with flow: setup.
  2. Redirect your customer to complete the enrollment at the Fintoc-hosted checkout page.
  3. Handle post-session events to save the payment_method and customer.
  4. Charge the saved payment method on demand, by creating an invoice or a Payment Intent.
The following diagram shows how the setup flow works:

Create a Checkout Session

The Checkout Session with the setup flow represents your intent to save a payment method for future charges, without creating a recurring subscription. Using your Secret Key, create a Checkout Session on your backend with flow set to setup: Server
Node
After creating the Checkout Session, Fintoc responds with the session details and a redirect_url:
Difference from the subscription flowWhen you create a Checkout Session with flow: setup, Fintoc enrolls the customer’s payment method and creates a PaymentMethod, but does not create a subscription or schedule any recurring charges. You control when and how much to charge by creating future payment intents.

Include customer data

When creating a Checkout Session for setup, you must include customer information.

Redirect the customer to complete the enrollment

Next, redirect the customer to the redirect_url from the response. The customer sees the Fintoc-hosted checkout page where they complete the enrollment. After the customer completes the enrollment, Fintoc automatically redirects them to your success_url or cancel_url, depending on the outcome. Client

Handle post-session events

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

Checkout Session events

When the enrollment completes, Fintoc sends a checkout_session.finished event with the customer and payment_method information:

Payment Method events

Fintoc also sends a payment_method.activated event. The event’s data field contains a PaymentMethod like this:
Store both the customer ID and the payment_method ID. You need them to create charges later.

Events summary

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

Create a charge against the saved payment method

Once the payment method is active, you can charge it in two ways:
  • Create an invoice and let Fintoc collect it. The invoice records what your customer owes, keeps the history of every charge attempt, and gives you a payment link to fall back on. Use it when the charge settles a debt, including recurring collection.
  • Create a Payment Intent directly. Use it for a one-off charge that you don’t need to track as a debt.
Both paths end in a payment_intent. The difference is where the payment_intent lives: a charge made through an invoice stays anchored to the invoice, so you can retry it, switch payment methods, and reconcile it against the amount owed.

Charge the payment method through an invoice

Collecting an invoice takes two calls: you create the invoice, and then you finalize it. Fintoc never finalizes an invoice you create yourself.
fintoc-invoice-creation-diagram

1) Create the invoice

Create the Invoice for the customer, with default_payment_method set to the payment method you saved: Server
Node
Fintoc responds with the invoice in draft status:
A draft invoice charges nothing. Use the draft status to review the amount or change the items with Add lines and Update a line item before you collect.

2) Finalize the invoice to charge it

Finalize the invoice to move it to open. Because collection_method is charge_automatically, Fintoc charges default_payment_method after finalization: Server
The charge is asynchronous: the invoice stays open with a pending payment until the payment resolves. Track the outcome with invoice.payment_succeeded or invoice.payment_failed; Fintoc sends those invoice events alongside payment_intent.succeeded or payment_intent.failed.

3) Retry a failed charge

A failed charge leaves the invoice open, so the amount your customer owes stays open on the invoice. Retry the charge with Pay an invoice, against the same payment method or against another active payment method of the same customer: Server
Omit payment_method to charge the invoice’s default_payment_method. Fintoc appends every attempt to the invoice’s payments array with its own payment_intent and status, so the invoice holds the full history of how you tried to collect it. To settle an invoice you collected outside Fintoc, by bank transfer or in cash, call the same endpoint with external_payment set to true. Fintoc moves the invoice to paid without charging anything, and reports external_payment as true.

Collect the invoice without charging the saved method

To let your customer pay instead of charging them, create the invoice with collection_method set to send_invoice. Fintoc then leaves the invoice open when you finalize it, instead of charging it, and default_payment_method becomes optional: Server
Call Finalize an invoice to move it to open. Once the invoice reaches open, its hosted_invoice_url points to a Fintoc-hosted payment page. Your customer can pay there with the payment methods enabled on your organization’s account, without needing a saved payment method. Send that link to your customer through your own channel, such as email or WhatsApp. Fintoc does not contact your customer through any channel.

Handle invoice events

Subscribe to the following events to track the invoice:

Charge the payment method with a Payment Intent

Charge the saved payment_method directly by creating a Payment Intent with the payment_method and customer IDs: Server
Node
Fintoc responds with the created Payment Intent:

Handle payment events

Fintoc sends these events for every charge, whether you created the charge through an invoice or as a standalone Payment Intent. Subscribe to them to track the payment outcome:

Test your integration

Using your test mode API Secret Key, create Checkout Sessions that simulate the full setup and payment flow without moving any money.

1) Create a setup Checkout Session using test credentials

Create a Checkout Session with flow: setup using your test mode Secret Key. Complete the enrollment flow on the Fintoc-hosted page using the following credentials: Test credentials:

PAC

  • Username (RUT): 11.111.111-1
  • Password: jonsnow
Select the account based on the final outcome you want to test:

Card

Use these test cards for card setup flows in Chile:

2) Verify the saved payment method

After completing the test enrollment, you should receive the checkout_session.finished and payment_method.activated webhook events. Verify that:
  • The payment_method ID is present in the event payload.
  • The customer ID matches the customer you enrolled.

3) Create a test charge against the saved method

Using the customer and payment_method IDs from step 2, create a Payment Intent against the saved method. Verify that:
  • You receive the payment_intent.succeeded event.
  • The amount matches what you sent.
  • The payment method used is the saved PAC or card.
Then test the invoice path with the same IDs: create an invoice with default_payment_method set to the saved method, finalize it, and verify that:
  • You receive invoice.created, invoice.finalized, invoice.payment_created, invoice.payment_succeeded, and invoice.paid, along with payment_intent.succeeded.
  • The invoice ends in paid status, with the attempt recorded in payments and your metadata persisted.
Test mode does not yet support saving a Payment Method in Mexico.