Skip to main content
The autopay management view lets your end user manage their autopay enrollment embedded in your site, without entering the full portal. From there they can:

View

The methods they have enrolled: card or CLABE account.

Enroll

A new method, when they do not have one yet.

Remove

An existing method.
It uses the same SDK as the payment methods widget: same installation, same company identification options and same destroy(). The two differences are that it mounts with view: "autopay" and that it emits its own events.
Installation, entrypoints, loadTapipay() and the staging environment are identical. They are covered in Payment methods SDK.

Quick start

Just like the payment widget, you can identify your company with organization (the slug) or with companyCode. Replace organization: "acme-corp" with companyCode: "MX-S-12345" in any of the examples.

The view option

Every other option (container, organization / companyCode, identifier, environment) is the same as in the payments view. externalRequestId and selectionStrategy do not apply here: they belong to the payments view. The URL the SDK mounts is the payments view URL with /autopay appended:

Events

Privacy. Autopay events expose only the minimum: the method type (mediaType) and the last 4 digits (lastFour). The id is an opaque hash, not the internal identifier. The holder name, the full number or CLABE, the brand, the bank and tokens are never exposed.

Payloads

mediaType tells the enrolled method apart: card is a credit card, bank_account is a CLABE account and debit_card is a debit card.

In React

autopayLoaded fires again every time the list changes, so you can use it as the single source for your enrolled methods counter: no need to add and subtract by hand with autopayActivated and autopayRemoved.

Enrollment flow events

When the user does not have an enrolled method yet, the autopay view opens the enrollment flow inside the same iframe. That flow emits its own events, one per step the user completes, so you can follow their progress from your site.
These are interface milestones: they tell you what the user completed in the widget, not what the backend confirmed. The enrollment is processed asynchronously, so the confirmation that it became active arrives through autopayActivated.
The first four form a sequence. They fire once each, in this order:
1

domiciliationBankSelected

The user picked their bank.
2

domiciliationFormCompleted

The account details passed backend validation.
3

domiciliationVerificationCompleted

Account verification finished.
4

domiciliationConfirmed

The user confirmed the enrollment.
The fifth one, domiciliationAccountCheckFailed, is not part of that sequence: it is an error event that can fire zero, one or many times while the user types their CLABE or card number. It is the equivalent of autopayError for this flow.
Underneath, these events are postMessage messages the iframe emits. If you embed it by hand, without the SDK, you can listen to them directly: see postMessage events.
Privacy. Unlike the autopay events, these events do carry the bank identity (bankId, speiCode, name), because you embed the widget for your own customers. What never travels is the holder data or the full account: not the name, the email, the RFC, the full CLABE or card number, or tokens. From the account, only the type (accountType) and the last 4 digits (lastFour) are exposed.

Payloads

domiciliationAccountCheckFailed reasons

The CLABE or card the user typed never travels, and neither does the error message they see on screen (that text belongs to the interface and can change without notice). Only the selected bank and the categorized reason.

In React

To measure where your users drop off, track the four milestones in order and compare how many reach each one. domiciliationAccountCheckFailed also tells you which detail blocks them from moving forward.

How it relates to the API

A subscription created with autopay: true is charged through autopay, without the user picking a method on every charge. In direct debit (POST /v2/debts) the debt does not carry autopay: it is debited automatically if it references a product and the user has an enrolled default method. For that charge to work, the user needs an enrolled method: this screen is where they enroll it.

Payment methods and autopay

How autopay works on debts and subscriptions, and how it relates to paymentMethods.