🇲🇽Mexico

Check the requirements and validations made over the cashouts on Mexico

Required fields

Bank Account Validations

CLABE validation algorithm

Click here for more information about CLABE format.

Since the first three digits of the CLABE are the bank code, it is not mandatory to send the bank_code field.

Mexico CLABE validation algorithm in Java
public final class Validations {
    static int CLABE_LENGTH = 18;
    
    private static boolean validateClabeLength(String bankAcount) {
        return bankAcount.length() == CLABE_LENGTH;
    }
    
    private static boolean validateClabe(String clabe) {
        if (!validateClabeLength(clabe)) {
            return false;
        } else {
            int sum = 0;
            String clabeWithoutCd = clabe.substring(0, 17);
            Integer[] array = new Integer[]{3, 7, 1};
    
            int checkDigitToVerify;
            for(checkDigitToVerify = 0; checkDigitToVerify < clabeWithoutCd.length(); ++checkDigitToVerify) {
                int digit = clabeWithoutCd.charAt(checkDigitToVerify);
                sum += digit * array[checkDigitToVerify % 3] % 10;
            }
    
            checkDigitToVerify = (10 - sum % 10) % 10;
            int checkDigit = Integer.parseInt(clabe.substring(17));
            return checkDigitToVerify == checkDigit;
        }
    }
}

Document Validations

Click here to check document types and validations.

Example Request

{
    "login": "xxxxxxxx",
    "pass": "xxxxxxxx",
    "external_id": "30000000001",
    "country": "MX",
    "currency": "MXN",
    "amount": 100,
    "document_id": "848392783",
    "bank_account": "021790064060296642",
    "beneficiary_name": "User",
    "beneficiary_lastname": "Test",
    "notification_url": "https://webhook.site/url",
    "type": "json"
}

Bank codes

Notice that the bank_code for Mexico is only mandatory if the bank_account length is between 15 and 16 (Debit Card). In that case, use the Credit Cards endpoint: https://cc-api-stg.directa24.com/v3/cashout

For the full and most up-to-date list of banks and its codes, please check the Cashout Bank Code endpoint.

Last updated