payment_method becomes chargeable only when the mandate is approved.
You can enroll a payment method in two ways:
- By API (merchant-hosted): you collect your customer’s account details and consent documents in your own UI and send them to Fintoc in a single request.
- Through the Fintoc-hosted checkout: you create a Checkout Session and redirect your customer, and Fintoc handles the full enrollment flow, including identity validation and the mandate document.
- Create a Customer, using your Secret Key
- Enroll the payment method, by API or through a Checkout Session
- Handle mandate approval events through webhooks
- Charge the enrolled account, with subscription invoices or on-demand charges
Before you begin
Direct Debit is available for organizations operating in Mexico. Before integrating, make sure you have:- A Fintoc account with Direct Debit Mexico enabled
- A Secret Key and Public Key
- A webhook endpoint to receive mandate and payment events
MXN.
How the mandate works
Every enrollment creates a mandate: the customer’s authorization for you to charge their account. The mandate defines:
Fintoc enforces the mandate limit on every charge. If a charge would exceed
max_amount for the current period, Fintoc rejects the charge with limit_exceeded before the charge reaches the customer’s bank.
Step 1: Create a Customer
Every direct debit payment method belongs to aCustomer. For direct debit, the customer needs a full name, an email, and a Mexican tax ID (mx_rfc).
Customer. Store the id to enroll a payment_method for it in the next step.
Step 2, Option 1: Enroll by API (merchant-hosted)
Use this option when you collect the account details and consent documents in your own UI. Send the account details, authorized mandate limit, and four consent documents as files in a singlemultipart/form-data request:
Fintoc returns the created
payment_method with the mandate already in review. See the Create a payment method reference for every parameter and error the endpoint returns.
The request is atomic. If a document is missing or a file has an invalid format or size, Fintoc returns 422 Unprocessable Entity and creates no payment_method.
Step 2, Option 2: Enroll through the Fintoc-hosted checkout
Use this option to let Fintoc handle the full enrollment flow. Your customer completes their personal data, enters their CLABE or debit card, authorizes the mandate, and completes identity validation on the Fintoc-hosted page. Fintoc generates the signed mandate document for you. The hosted checkout supports two flows:flow: subscriptionenrolls the payment method and starts a recurring subscription in one step. Fintoc schedules and charges the invoices of each billing cycle automatically.flow: setuponly enrolls the payment method, with no scheduled charges. Use it when you want to save the account and decide later when and how much to charge (on-demand invoices, see Step 4).
Checkout Session with flow: subscription to enroll and start a recurring subscription in one step:
Checkout Session. Use its redirect_url to send your customer to the hosted checkout.
With flow set to subscription, Fintoc derives the mandate’s max_amount and interval from line_items: unit_amount multiplied by quantity, and recurring.interval.
To create the payment method with no scheduled charges, set flow to setup. setup sessions have no line_items to define the maximum amount, but you can send the mandate limit in payment_method_options.
If you omit payment_method_options, Fintoc creates the mandate with a default limit of MXN 10,000 per month (max_amount: 1000000, interval: "month").
redirect_url. On the hosted page, the customer completes five steps:
- Personal data: name, Mexican Federal Taxpayer Registry number (RFC), and email, pre-filled from
customer_data. - Account enrollment: CLABE or debit card.
- Mandate authorization: full mandate document.
- Identity validation: selfie and INE.
- Confirmation.
After the checkout finishes, the enrollment is not complete: the mandate stays in review and
mx_direct_debit.status remains pending. Don’t activate your customer’s service until you receive payment_method.activated.Step 3: Handle mandate approval events
Fintoc reviews the mandate asynchronously and sends the approval about one business day after enrollment. Always use webhooks to track the outcome:
When the mandate is approved for a
subscription flow, the subscription becomes active and Fintoc generates and charges the first invoice automatically.
Step 4: Charge the enrolled account
Withmx_direct_debit.status in active, you can charge the payment_method in two ways:
- Subscription: Fintoc generates an
invoicefor each billing cycle and collects the invoice automatically against the enrolled account. Handle theinvoice.payment_succeededandinvoice.payment_failedevents. - On-demand: You create a one-off
invoiceassociated with the payment method.
invoice in its initial draft state. Once you finalize the invoice, Fintoc charges it automatically against default_payment_method. Track the outcome with invoice.payment_succeeded or invoice.payment_failed (sent along with payment_intent.succeeded or payment_intent.failed).
Mandate limit enforcement. Before Fintoc executes a charge, Fintoc sums the charge amount with any amount already charged or in flight in the current period. Fintoc then compares that total against the mandate’s
max_amount. Fintoc rejects charges over the limit with 422 limit_exceeded before the charge reaches the customer’s bank. Failed charges do not consume the limit. Usage resets at the start of each period.Rules and validations
Use these validation errors to handle direct debit-specific failures:Test your integration
Using yourtest mode secret key, you can simulate the full direct debit flow without moving money. In test mode, Fintoc approves or rejects the mandate in about 1 minute instead of one business day. A mandate created with a CLABE ending in 8888 never receives bank confirmation, and Fintoc expires the mandate after 7 days.
CLABE (18 digits). Only the last four digits act as the trigger. The examples use Santander, and any supported bank behaves the same way:
To get an approved mandate, use any CLABE that does not end in one of those triggers, such as
014180000000014821.
Debit card (16 digits). The card number controls the mandate outcome:
Charges. The amount controls the outcome, and the result arrives by webhook 5 to 15 minutes after the charge:
In
live mode the identity validation is real and can reject your customer. Make sure your integration handles the pending state and the payment_method.canceled event before going live.