Skip to main content
There are three steps to accept payments using Fintoc:
  1. On your backend, create a Checkout Session using your Secret Key
  2. Redirect your user to complete the payment on the Fintoc-hosted checkout page
  3. Handle post-payments events
The following diagram shows how Fintoc interacts with both your backend and your frontend

Optional: install our backend SDK

If you’re using Python, you can install our Python SDK to make it easier to interact with our API. The SDK automatically handles pagination, lets you easily verify Fintoc’s webhooks, and offers many other helpful features.

Create a session

The Checkout Session object represents your intent to collect a payment from a customer and tracks state changes throughout the payment process. Using your Secret Key, create a Checkout Session from your backend with the required parameters: amount, currency, success_url, and cancel_url, like the example below:
Node
Send the Business Profile object if you are processing payments for a submerchantYou can also add the business_profile object when creating a session to customize the name displayed as the “Recipient” on the payment flow.Read here to learn more.

Include Customer Data (Optional)

When creating a Checkout Session, you can include customer information. This allows Fintoc to display only the available payment methods for that specific customer, such as verifying if the amount exceeds the transaction limit for a selected bank in the payment initiation method.

Pre select a Payment Methods (Optional)

You can create a Checkout Session without specifying payment methods. In this case, users can select from all available options on the Fintoc-hosted checkout page, based on the session parameters (amount, customer, currency) and the payment methods you have enabled in Fintoc. Alternatively, you can explicitly define the payment method(s) for the session. For example, in the request below, the payment_initiation method is set, combined with payment_method_options, where the institution cl_banco_estado is pre-selected for the user. In this scenario, the payment flow presented to the user will be limited to this specific method and bank.
Node

Left: Default view showing all available methods (bank transfer and cards) when no payment_method parameter is set. Right: Pre-selected bank transfer flow for Banco Estado, displaying the institution-specific payment form directly.

Using your own Checkout PageWhen you have your own checkout page, you should set the payment_method to redirect users to the Fintoc Checkout after they’ve already selected their preferred payment method.This skips Fintoc’s payment method selection screen and directs users straight to the specific payment flow, instead of letting Fintoc manage the full checkout experience.

Response when creating a Checkout Session

After making the request to create the Checkout Session, Fintoc should respond with something like this:
In the response, you should receive the redirect_url attribute. In the following step, you’ll use this attribute to redirect the user to complete the payment.

Choose how to open Fintoc’s widget

The Fintoc Widget is the client-side component your customers will interact with to make payments using Fintoc. It handles credential validation, multi-factor authentication, and error management for all supported financial institutions. You have two options for opening the widget:

Option 1: Open the widget on your frontend

If you want to display the Fintoc Widget directly on your checkout page (without redirecting the user), use the session_token returned in the API response when creating a Checkout Session. Use your Public Key and the Session Token to configure the widget.
If you’re receiving payments in Mexico, set the country parameter to mx. For more configuration options and advanced usage, refer to the Widget guide .
Use our Widget Webview if you are building a mobile appIf you are integrating Fintoc into an iOS or Android application, you can use our Webview integration.

Option 2: Open the widget via a Redirect Page

Alternatively, you can redirect users to a Fintoc-hosted payment page. After completing the payment, they’ll be automatically redirected back to your site. To use this method, include both success_url and cancel_url parameters when creating the Checkout Session. The API response will include a redirect_url that you can use to send the user to the payment page. Based on the payment result, the user will be redirected to either the success or cancel URL. For more details, check out the Redirect Page integration guide.

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 widget callback, and for your backend you will use the events sent by webhooks.
Use webhooks events to complete paymentsYour customer could close the browser window or quit the app before the onSuccess widget callback executes. For this reason, you should always use the checkout_session.finished event to handle post-payments actions like sending an order confirmation email to your customer, logging the sale in a database, or starting a shipping workflow.

Handle the payment result on your frontend

Once a Payment associated to the Checkout Session finishes successfully, the widget executes the onSuccess callback. You need to pass this function to the widget upon creation. With this callback, you can decide what to do with your user’s frontend once the payment is complete, for example:
  • Redirect the user to a post-sale or post-payment view
  • Show the user a success screen.
Don’t use this callback as a payment confirmationYou shouldn’t trust on the onSuccess callback as a confirmation for a successful payment, as the frontend is an insecure realm and a malicious third party may execute a JavaScript function that simulates that the transfer was executed successfully.For a more comprehensive validation mechanism, we strongly encourage integrating webhooks and subscribing to the checkout_session.finished event. By implementing webhooks, you can ensure timely and accurate updates on payment statuses, enhancing the overall security and reliability of your payment confirmation process.

Handle errors

You don’t only need to handle succeeded payments because payments can also fail. For example, your customer doesn’t have funds in their bank account to complete the payment. When a payment fails or is rejected by your customer, the widget executes the onExit callback. With this callback, you can handle errors on your frontend. For example, you can invite your customer to use another payment method.

Complete the payment on your backend

Fintoc sends a checkout_session.finished event when the payment completes. Use the follow the webhook guide 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. The checkout_session.finished event includes information about the related payment, and looks like this:
You should handle the following events when using our Payment Initiation product:

Redirect the user to complete the payment

Next, you will redirect users to the Fintoc-hosted checkout page. After completing the payment, they’ll be automatically redirected back to your site. Based on the payment result, the user will be redirected to either the success or cancel URL.

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 backend, you will use the events sent by webhooks.

Complete the payment on your backend

Fintoc sends a checkout_session.finished and a payment_intent.succeeded event when the session completes and the payment is successful. Use the follow the webhook guide 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. The checkout_session.finished event includes information about the session and the id and status of the payment_intent:
You should handle the following post-payment events :
Handling async payments after the Checkout Session endsIn some cases, the Checkout Session may finish with a payment that does not yet have a final status, such as requires_action. This can happen, for example, when a bank transfer from a business account requires approval from more than one representative.In these cases, you should inform the user that the payment is pending approval. Once you receive either the payment_intent.succeeded or payment_intent.failed event, you should notify the user of the final payment status as soon as it is confirmed.