Institution Codes
Major Mexican financial institutions and their corresponding codes for SPEI transactions:Code | Bank Name | CLABE Prefix | Type |
---|---|---|---|
40012 | BBVA México | 012 | Commercial Bank |
40014 | Santander | 014 | Commercial Bank |
40021 | HSBC | 021 | Commercial Bank |
40072 | Banorte | 072 | Commercial Bank |
40646 | STP | 646 | Payment Institution |
40137 | Banregio | 137 | Commercial Bank |
40058 | Banco Azteca | 058 | Commercial Bank |
40030 | Bajío | 030 | Commercial Bank |
40036 | Inbursa | 036 | Commercial Bank |
40042 | Mifel | 042 | Commercial Bank |
40060 | Bansi | 060 | Commercial Bank |
40102 | The Royal Bank | 102 | Foreign Bank |
40103 | American Express | 103 | Credit Card Company |
40106 | Bank of America | 106 | Foreign Bank |
40108 | JP Morgan | 108 | Foreign Bank |
40110 | Credit Suisse | 110 | Foreign Bank |
40124 | Deutsche Bank | 124 | Foreign Bank |
40126 | Credit Agricole | 126 | Foreign Bank |
40127 | Azteca | 127 | Commercial Bank |
40128 | Autofin | 128 | Development Bank |
40129 | Barclays | 129 | Foreign Bank |
40130 | Compartamos | 130 | Development Bank |
40131 | Banco Famsa | 131 | Commercial Bank |
40132 | BMULTIVA | 132 | Brokerage |
40133 | ACTINVER | 133 | Brokerage |
40135 | NAF | 135 | Development Bank |
40136 | Intercam Banco | 136 | Commercial Bank |
40138 | Intercam | 138 | Brokerage |
40139 | Bancoppel | 139 | Commercial Bank |
40140 | ABC Capital | 140 | Brokerage |
40141 | UBS Bank | 141 | Foreign Bank |
40143 | CIBanco | 143 | Commercial Bank |
40145 | Bbase | 145 | Commercial Bank |
40147 | Bankaool | 147 | Commercial Bank |
40148 | Pagatodo | 148 | Payment Institution |
40150 | Inmobiliario | 150 | Development Bank |
40151 | Donde | 151 | Payment Institution |
40152 | Bancrea | 152 | Commercial Bank |
CLABE Validation
CLABE (Clave Bancaria Estandarizada) is Mexico’s standardized bank account number format used for SPEI transfers.CLABE Format Structure
- Total length: 18 digits
- Bank code: 3 digits (positions 1-3)
- Branch code: 3 digits (positions 4-6)
- Account number: 11 digits (positions 7-17)
- Check digit: 1 digit (position 18)
- 012: BBVA México bank code
- 345: Branch code (specific branch)
- 67890123456: Account number (11 digits)
- 7: Check digit (calculated using algorithm)
CLABE Validation Algorithm
The check digit is calculated using a weighted sum algorithm:CLABE Components Extraction
The code block below shows how to parse the CLABE into its components.Python Implementation
Python Implementation
RFC (Tax ID) Format
RFC (Registro Federal de Contribuyentes) is Mexico’s tax identification system.RFC Format Types
Type | Length | Structure | Pattern | Example |
---|---|---|---|---|
Individual | 13 | 4 letters + 6 digits + 3 alphanumeric characters | ^[A-Z&Ñ]{4}\\d{6}[A-Z\\d]{3}$ | MAGR850920XY1 |
Business | 12 | 3 letters + 6 digits + 3 alphanumeric characters | ^[A-Z&Ñ]{3}\\d{6}[A-Z\\d]{3}$ | ABC850920123 |
RFC Format Breakdown
Type | Letters Part | Digits Part | Verification Part | Description |
---|---|---|---|---|
Individual | MAGR | 850920 | XY1 | Name-derived letters + birth date + verification code |
Business | ABC | 850920 | 123 | Business name-derived letters + registration date + verification code |
RFC Validation
Here is an example of how to validate the RFC format.Python Implementation
Python Implementation
RFC Type Detection
The code block below shows how to determine the type of RFC.Python Implementation
Python Implementation
SPEI Timing and Operational Constraints
SPEI operates with specific timing considerations that affect when transfers can be processed and completed. Understanding these constraints helps ensure reliable payment processing.Operating Hours
Operating Hours
Day/Period | Processing Hours | Notes |
---|---|---|
Monday to Friday | 6:00 AM – 6:00 PM (CDMX time) | Same-day processing if before 5:00 PM |
Saturday | 9:00 AM – 2:00 PM | Limited processing |
Sunday | No processing | |
Bank holidays | No processing |
Processing Times for SPEISPEI generally operates 24/7, but individual institutions may apply maintenance windows or additional validations that can introduce delays. Some banks or payment providers may apply their own internal processing schedules or restrictions.Possible delays may occur due to:
- Scheduled maintenance windows
- Anti-fraud validations
- Institutional batch processing policies
Processing Time Examples
Processing Time Examples
Submission Time | Day | Expected Processing Time |
---|---|---|
10:00 AM | Monday | Same day (within minutes) |
4:30 PM | Tuesday | Same day (within minutes) |
5:30 PM | Wednesday | Same day (within minutes) |
11:00 AM | Saturday | Same day (within minutes) |
2:30 PM | Saturday | Same day (within minutes) |
10:00 AM | Sunday | Same day (within minutes) |
- All times are shown in local Mexico City time.
- Actual processing times can vary depending on:
- Your bank or fintech provider’s policies
- Internal fraud or compliance checks
- Scheduled maintenance windows
Holiday Calendar
Holiday Calendar
Major Mexican Holidays Affecting SPEI:
- New Year’s Day (January 1)
- Constitution Day (February 5)
- Benito Juárez’s Birthday (March 21)
- Easter (varies)
- Labor Day (May 1)
- Independence Day (September 16)
- Revolution Day (November 20)
- Christmas Day (December 25)
Time Zone Considerations
Time Zone Considerations
Mexico City Time (Central Time):
- UTC Offset: UTC-6 (Standard Time)
- UTC Offset: UTC-5 (Daylight Time)
- Daylight Saving: First Sunday in April to last Sunday in October
Python Implementation
Python Implementation
Bank Account Types
The table below shows the different account types in Mexico.Code | Type | Description |
---|---|---|
1 | Checking Account | Cuenta de cheques |
2 | Savings Account | Cuenta de ahorros |
3 | Credit Account | Cuenta de crédito |
40 | CLABE Account | Cuenta CLABE (for SPEI) |
10 | Investment Account | Cuenta de inversión |
Usage in WithdrawalsFor SPEI withdrawals, the account type is usually picked up automatically from the CLABE format. However, for some operations, you might need to specify it yourself:
Complete Validation Function
The code block below shows a complete validation function for Mexican banking data.Python Implementation
Python Implementation
Common Implementation Patterns
Expand the items below to see the code for some common implementation patterns.CLABE Formatting for Display
CLABE Formatting for Display
Account Masking for Security
Account Masking for Security
Error Messages
The table below shows the error messages for Mexican banking data.Error Code | English Message |
---|---|
invalid_clabe | CLABE must be exactly 18 digits with valid checksum |
invalid_clabe_checksum | CLABE checksum is invalid |
invalid_rfc | RFC format is invalid (must be 12-13 alphanumeric characters) |
invalid_institution | Institution code not found in Mexican banking system |
clabe_institution_mismatch | CLABE bank code does not match institution code |
spei_not_operating | SPEI transfers are not processed outside business hours |
invalid_account_type | Account type must be valid for SPEI transfers |
Next Steps
- Payment Methods – Details on implementing SPEI and other payment options
- Withdrawals – How to process withdrawals with Mexican banks
- Error Handling – Common banking validation errors and solutions
- Production Readiness – Compliance and operational requirements for going live