Payout Validations

Bank Account Validation Reference

This document provides a comprehensive reference for all bank account field validations in the Mural API, organized by currency and payment method type.

About This Document

This validation reference is designed to help you integrate with the Mural API's payout capabilities. The validations documented here apply when:

  • Creating Payout Requests: Use the Payouts API to send funds to recipients via bank transfers or blockchain wallets
  • Creating Payment Methods: Use the Payment Methods API to store bank account details for counterparties

Bank Name Validation

Many currencies require the bank name to match a specific list of supported banks. To retrieve these lists programmatically, use the Bank Details API. This endpoint returns the list of valid bank names for each currency and rail combination, which you can use to validate user input before submitting payout requests.

Table of Contents

  1. Overview
  2. USD - United States Dollar (Domestic)
  3. USD - Peru
  4. USD - Panama
  5. USD - China
  6. ARS - Argentine Peso
  7. BRL - Brazilian Real
  8. COP - Colombian Peso
  9. EUR - Euro (SEPA)
  10. MXN - Mexican Peso
  11. CLP - Chilean Peso
  12. PEN - Peruvian Sol
  13. BOB - Bolivian Boliviano
  14. CRC - Costa Rican Colón
  15. ZAR - South African Rand
  16. Validation Algorithms

Overview

The Mural API enforces strict validations on bank account information to ensure successful payouts across different currencies and payment methods. All validations are applied when creating or updating payout methods.

Validation Levels

Validations are enforced at multiple levels:

  • Format Validation: Regex patterns, character sets, and length requirements
  • Checksum Validation: Mathematical algorithms to verify account numbers and identification documents
  • Business Rule Validation: Geographic restrictions, supported bank lists, and field dependencies

USD - United States Dollar (Domestic)

Payout method type: usdDomestic

Required Fields

FieldTypeDescription
symbolstringMust be "USD"
accountTypeenumCHECKING or SAVINGS
bankAccountNumberstringBank account number
bankRoutingNumberstringACH routing number
transferTypeenumACH or WIRE
bankNamestringName of the bank

Field Validations

bankAccountNumber

  • Format: Numeric only
  • Length: 6-17 digits
  • Pattern: Must contain only digits (0-9)

bankRoutingNumber

  • Format: Numeric only
  • Length: Exactly 9 digits
  • Checksum: MOD 10 algorithm (see US Routing Number Checksum)
  • The routing number must pass checksum validation to ensure it's valid

accountType

  • Allowed values: CHECKING, SAVINGS

transferType

  • Allowed values: ACH, WIRE

bankName

  • Length: 2-255 characters
  • Format: Free text

USD - Peru

Payout method type: usdPeru

Required Fields

FieldTypeDescription
symbolstringMust be "USD"
accountTypeenumCHECKING or SAVINGS
bankAccountNumberstringBank account number
documentNumberstringTax/identity document number
documentTypeenumType of identification document
bankNamestringName of the bank

Field Validations

bankAccountNumber

  • Format: Numeric only
  • Length: Exactly 20 digits
  • Must contain only digits

documentNumber

  • Validation depends on documentType
  • See document type validations for Peru

documentType

  • Allowed values: NATIONAL_ID, RUC, PASSPORT, RESIDENT_ID

bankName

  • Must match one of the supported banks for Peru
  • See Bank Name Validation for how to retrieve the list of supported banks
  • Length: 2-255 characters

accountType

  • Allowed values: CHECKING, SAVINGS

USD - Panama

Payout method type: usdPanama

Required Fields

FieldTypeDescription
symbolstringMust be "USD"
accountTypeenumCHECKING or SAVINGS
bankAccountNumberstringBank account number
documentNumberstringTax/identity document number
documentTypeenumType of identification document
bankNamestringName of the bank

Field Validations

bankAccountNumber

  • Format: Numeric only
  • Length: 1-45 digits
  • Panama allows longer account numbers than most countries

documentNumber

  • Validation depends on documentType:
Document TypeFormatDescription
NATIONAL_IDExactly 8 digitsCédula de Identidad
RUC7-15 alphanumeric charactersRUC - uppercase letters and numbers
PASSPORT7-12 alphanumeric charactersPassport number
RESIDENT_ID7-12 alphanumeric charactersResident ID

documentType

  • Allowed values: NATIONAL_ID, RUC, PASSPORT, RESIDENT_ID
  • TAX_ID is not supported for Panama

bankName

  • Must match one of the supported banks for Panama
  • See Bank Name Validation for how to retrieve the list of supported banks
  • Length: 2-255 characters

accountType

  • Allowed values: CHECKING, SAVINGS

USD - China

Payout method type: usdChina

Required Fields

FieldTypeDescription
symbolstringMust be "USD"
accountTypeenumCHECKING or SAVINGS
bankAccountNumberstringBank account number
documentNumberstringTax/identity document number
documentTypeenumType of identification document
phoneNumberstringContact phone number
addressstringBeneficiary address
swiftBicstringSWIFT/BIC code
bankNamestringName of the bank

Field Validations

bankAccountNumber

  • Format: Numeric only
  • Length: 9-25 digits

phoneNumber

  • Format: Valid international phone number
  • E.164 format recommended

address

  • Format: Free text string
  • Required field

swiftBic

  • Format: Valid SWIFT/BIC code (8 or 11 characters)
  • Validated using the ibantools library

documentNumber

  • Validation depends on documentType:
Document TypeFormatValidationDescription
PASSPORTSpecific patternPattern match"G" + 8 digits OR "E" + letter (not I/O) + 7 digits
TAX_ID15 or 18 charactersChecksumLegacy (15 digits) or USCC (18 alphanumeric)
RESIDENT_ID18 charactersChecksum + date17 digits + check character (0-9 or X)

documentType

  • Allowed values: PASSPORT, TAX_ID, RESIDENT_ID

Document Type Details:

PASSPORT:

  • Must match: G######## (G followed by 8 digits) OR E[A-HJ-NP-Z]####### (E, letter except I/O, then 7 digits)

TAX_ID (Business Tax ID):

  • Legacy format (15 digits): Exactly 15 numeric digits with MOD 11 checksum
  • USCC format (18 alphanumeric): 18 uppercase characters using restricted alphabet (excludes I, O, S, V, Z)

RESIDENT_ID (Individual ID):

  • Format: 17 digits + 1 check character (0-9 or X)
  • Positions 7-14 contain birthdate (YYYYMMDD) which must be a valid date
  • Birthdate must be between 1900 and current year
  • Check character calculated using MOD 11-2 algorithm
  • See Chinese Resident ID Validation

bankName

  • Must match one of the supported banks for China
  • See Bank Name Validation for how to retrieve the list of supported banks
  • Length: 2-255 characters

accountType

  • Allowed values: CHECKING, SAVINGS

ARS - Argentine Peso

ARS supports two variants based on how the account is identified.

ARS Alias

Payout method type: arsAlias

Required Fields

FieldTypeDescription
symbolstringMust be "ARS"
aliasstringBank account alias
documentNumberstringCUIT/CUIL number

Field Validations

alias

  • Format: Free text string
  • This is the bank account alias registered with the Argentine banking system

documentNumber

  • Format: CUIT/CUIL (Código Único de Identificación Tributaria/Laboral) of the account holder
  • Pattern: XX-XXXXXXXX-X (hyphens optional)
  • Length: 11 digits (excluding hyphens)
  • Example: 20-12345678-9

ARS Account Number (CBU/CVU)

Payout method type: arsAccountNumber

Required Fields

FieldTypeDescription
symbolstringMust be "ARS"
bankAccountNumberstringCBU or CVU number
documentNumberstringCUIT/CUIL number

Field Validations

bankAccountNumber

  • Format: Numeric only
  • Length: 6-22 digits
  • Whether it is a CBU or a CVU is read from the number itself (CVUs start with 000)

documentNumber

  • Same format as ARS Alias (CUIT/CUIL)

ARS bank in responses

ARS payout methods don't need a bank. When none was given, responses return bankId: "bank_ars_000".


ARS in payout requests

To pay an ARS account once without creating a payout method, send it inline in the payout request with fiatAndRailDetails.type: "ars". It takes symbol, bankAccountNumber, and documentNumber, with the validations above. bankAccountNumber holds the CBU, CVU, or alias: a value made only of digits is read as a CBU/CVU, and anything else as an alias. The payout's top-level bankName isn't needed for ARS.


BRL - Brazilian Real

BRL supports five variants: four PIX variants (different key types) and one traditional wire transfer.

BRL PIX Phone

Payout method type: pixPhone

Required Fields

FieldTypeDescription
symbolstringMust be "BRL"
phoneNumberstringPIX phone number key
documentNumberstringCPF or CNPJ
bankNamestringName of the bank

Field Validations

phoneNumber

  • Format: Valid international phone number
  • E.164 format recommended (e.g., +5511987654321)
  • This is the PIX key registered with the phone number

documentNumber

  • Format: CPF (individual, 11 digits) or CNPJ (business, 14 digits)
  • Validation: Both CPF and CNPJ check digits are verified using MOD 11 algorithm
  • At least one format (CPF or CNPJ) must pass validation
  • Examples: 123.456.789-09 (CPF) or 11.222.333/0001-81 (CNPJ)
  • See Brazilian CPF Validation and Brazilian CNPJ Validation

bankName

  • Must match one of the supported banks for Brazil
  • See Bank Name Validation for how to retrieve the list of supported banks
  • Length: 2-255 characters

BRL PIX Email

Payout method type: pixEmail

Required Fields

FieldTypeDescription
symbolstringMust be "BRL"
emailstringPIX email key
documentNumberstringCPF or CNPJ
bankNamestringName of the bank

Field Validations

email

  • Format: Valid email address
  • This is the PIX key registered with the email address

documentNumber

  • Format: CPF (individual, 11 digits) or CNPJ (business, 14 digits)
  • Validation: Both CPF and CNPJ check digits are verified using MOD 11 algorithm
  • At least one format (CPF or CNPJ) must pass validation
  • Examples: 123.456.789-09 (CPF) or 11.222.333/0001-81 (CNPJ)
  • See Brazilian CPF Validation and Brazilian CNPJ Validation

bankName

  • Must match one of the supported banks for Brazil
  • See Bank Name Validation for how to retrieve the list of supported banks
  • Length: 2-255 characters

BRL PIX Document

Payout method type: pixDocument

Required Fields

FieldTypeDescription
symbolstringMust be "BRL"
documentNumberstringPIX document key (CPF or CNPJ)
bankNamestringName of the bank

Field Validations

documentNumber

  • Format: CPF (11 digits) or CNPJ (14 digits)
  • Validation: Both CPF and CNPJ check digits are verified using MOD 11 algorithm
  • At least one format (CPF or CNPJ) must pass validation
  • This field serves dual purpose: it is both the identity document AND the PIX key
  • Examples: 123.456.789-09 (CPF) or 11.222.333/0001-81 (CNPJ)
  • See Brazilian CPF Validation and Brazilian CNPJ Validation

bankName

  • Must match one of the supported banks for Brazil
  • See Bank Name Validation for how to retrieve the list of supported banks
  • Length: 2-255 characters

BRL PIX Bank Account

Payout method type: pixBankAccount

Required Fields

FieldTypeDescription
symbolstringMust be "BRL"
bankAccountNumberstringPIX bank account key (EVP key)
documentNumberstringCPF or CNPJ
bankNamestringName of the bank

Field Validations

bankAccountNumber

  • Format: EVP (Endereço Virtual de Pagamento) key - UUID format
  • Must be a valid UUID (e.g., 123e4567-e89b-12d3-a456-426614174000)

documentNumber

  • Format: CPF (individual, 11 digits) or CNPJ (business, 14 digits)
  • Validation: Both CPF and CNPJ check digits are verified using MOD 11 algorithm
  • At least one format (CPF or CNPJ) must pass validation
  • Examples: 123.456.789-09 (CPF) or 11.222.333/0001-81 (CNPJ)
  • See Brazilian CPF Validation and Brazilian CNPJ Validation

bankName

  • Must match one of the supported banks for Brazil
  • See Bank Name Validation for how to retrieve the list of supported banks
  • Length: 2-255 characters

BRL Wire Transfer

Payout method type: wire

Required Fields

FieldTypeDescription
symbolstringMust be "BRL"
bankBranchstringBranch code (agência)
accountTypeenumAccount type
accountNumberstringAccount number
documentNumberstringCPF or CNPJ
bankNamestringName of the bank

Field Validations

bankBranch

  • Format: Branch code (agência) - numeric only
  • Length: Minimum 4 digits
  • Supports leading zeros (e.g., 0167 is valid)
  • Pattern: Must contain only digits (0-9)
  • Examples: 0167, 1234, 12345

accountType

  • Allowed values: CHECKING, SAVINGS

accountNumber

  • Format: Bank account number
  • Free text string

documentNumber

  • Format: CPF (individual, 11 digits) or CNPJ (business, 14 digits)
  • Validation: Both CPF and CNPJ check digits are verified using MOD 11 algorithm
  • At least one format (CPF or CNPJ) must pass validation
  • Examples: 123.456.789-09 (CPF) or 11.222.333/0001-81 (CNPJ)
  • See Brazilian CPF Validation and Brazilian CNPJ Validation

bankName

  • Must match one of the supported banks for Brazil
  • See Bank Name Validation for how to retrieve the list of supported banks
  • Length: 2-255 characters

COP - Colombian Peso

Payout method type: copDomestic

Required Fields

FieldTypeDescription
symbolstringMust be "COP"
phoneNumberstringContact phone number
accountTypeenumAccount type
bankAccountNumberstringBank account number
documentNumberstringIdentity/tax document number
documentTypeenumType of document
bankNamestringName of the bank

Field Validations

phoneNumber

  • Format: Valid international phone number

accountType

  • Allowed values: CHECKING, SAVINGS

bankAccountNumber

  • Format: Numeric only
  • Length: 6-18 digits
  • First 3 digits must each be 1–9 (no zero); digits 4–18 can be 0–9

documentNumber

  • Validation depends on documentType:
Document TypeFormatValidationDescription
NATIONAL_ID (CC)6-10 digitsLength + no leading zeroCédula de Ciudadanía
RUC (NIT)10-11 digitsMOD 11 checksumNúmero de Identificación Tributaria
PASSPORT8-12 charsUppercase A–Z and/or 0-9 onlyPassport number (ICAO 9303 MRZ)
RESIDENT_ID (CE)9 digitsExactly 9 digitsCédula de Extranjería (Migración Colombia)

documentType

  • Allowed values: NATIONAL_ID, RUC, PASSPORT, RESIDENT_ID
  • TAX_ID is not supported for Colombia

NIT Validation:

  • Colombian NIT requires checksum validation using MOD 11 algorithm
  • Format: 8-10 digits + 1 check digit
  • See Colombian NIT Validation for algorithm details

bankName

  • Must match one of the supported banks for Colombia
  • See Bank Name Validation for how to retrieve the list of supported banks
  • Length: 2-255 characters

EUR - Euro (SEPA)

Payout method type: eurSepa

Required Fields

FieldTypeDescription
symbolstringMust be "EUR"
ibanstringInternational Bank Account Number
swiftBicstringSWIFT/BIC code
countrystringISO 3166-1 alpha-2 country code
bankNamestringName of the bank

Field Validations

iban

  • Format: Valid IBAN with proper country code and checksum
  • Must be a properly formatted IBAN
  • Validated using the ibantools library

swiftBic

  • Format: Valid SWIFT/BIC code (8 or 11 characters)
  • Validated using the ibantools library

country

  • Format: ISO 3166-1 alpha-2 country code (e.g., "DE", "FR", "ES")
  • Important: Country must be a valid SEPA country

bankName

  • Format: Free text
  • Length: 2-255 characters

MXN - Mexican Peso

MXN supports two payout methods: a bank transfer to a CLABE, and a transfer to a 16-digit Mexican debit card.

MXN CLABE

Payout method type: mxnDomestic

Required Fields

FieldTypeDescription
symbolstringMust be "MXN"
bankAccountNumberstringCLABE number
bankNamestringName of the bank (Payout Requests only)

Field Validations

bankAccountNumber (CLABE)

  • Format: Exactly 18 numeric digits
  • Checksum: Weighted checksum algorithm
  • Must pass CLABE checksum validation
  • See CLABE Validation Algorithm

CLABE Structure:

  • Digits 1-3: Bank code
  • Digits 4-6: Branch code
  • Digits 7-17: Account number (11 digits)
  • Digit 18: Check digit

bankName (Payout Requests)

  • Format: Free text
  • Length: 2-255 characters

Bank (Payout Methods)

  • You don't send a bank. Mural identifies it from the CLABE's first 3 digits and returns it as bankId on the Payout Method
  • If Mural doesn't recognize those 3 digits, the request fails with a 400

MXN Debit Card

Payout method type: mxnDebitCard

Required Fields

FieldTypeDescription
symbolstringMust be "MXN"
cardNumberstring16-digit debit card number
bankIdstringID of the bank that issued the card

Field Validations

cardNumber

  • Format: Exactly 16 numeric digits, with no spaces or dashes
  • Checksum: Must pass the Luhn check
  • See Luhn Validation Algorithm

bankId

  • Must be the id of the bank that issued the card, as returned for mxnDebitCard by the Supported Banks API (payoutMethodTypes=mxnDebitCard)
  • A CLABE encodes its bank, but a card number does not, so the payout is routed to the bank in bankId. Always send the card's actual issuer.
  • An unknown or non-MXN bankId, or a bank that card payouts aren't supported for, is rejected with a 400 when the card is saved or the payout is created
  • If a card payout fails with ACCOUNT_NUMBER_INCORRECT, common causes are a wrong card number or a bankId that isn't the card's issuer. The same code covers both, so check both before retrying.

Sending a card without saving it

To pay a card once without creating a payout method, send it inline in the payout request with fiatAndRailDetails.type: "mxn-debit-card", using the same symbol, cardNumber, and bankId fields and validations. The payout's top-level bankName is still required (2-255 characters), but its value is not used for card payouts: the bank comes from bankId.


CLP - Chilean Peso

Payout method type: clpDomestic

Required Fields

FieldTypeDescription
symbolstringMust be "CLP"
accountTypeenumAccount type
bankAccountNumberstringBank account number
documentTypeenumType of document
documentNumberstringChilean RUT number
bankNamestringName of the bank

Field Validations

accountType

  • Allowed values: CHECKING, SAVINGS

bankAccountNumber

  • Format: Numeric only
  • Length: 6-25 digits

documentType

  • Allowed values: NATIONAL_ID, PASSPORT, RESIDENT_ID, RUC, TAX_ID
  • Note: RUT (Rol Único Tributario) is the standard document type for Chile

documentNumber (Chilean RUT)

  • Format: 7-8 digits + 1 check digit (0-9 or K)
  • Can include formatting: dots and hyphens (e.g., "12.345.678-5")
  • Checksum: MOD 11 algorithm
  • Examples: "12.345.678-5", "11111111-1", "7775777-K"
  • See Chilean RUT Validation Algorithm

bankName

  • Must match one of the supported banks for Chile
  • See Bank Name Validation for how to retrieve the list of supported banks
  • Length: 2-255 characters

PEN - Peruvian Sol

Payout method type: penDomestic

Required Fields

FieldTypeDescription
symbolstringMust be "PEN"
documentNumberstringIdentity/tax document number
documentTypeenumType of document
bankAccountNumberstringBank account number
accountTypeenumAccount type
bankNamestringName of the bank

Field Validations

bankAccountNumber

  • Format: Exactly 20 numeric digits
  • Important: First 3 digits must match the bank code for the specified bankName
  • Each bank has a specific 3-digit code that must appear at the start of the account number

accountType

  • Allowed values: CHECKING, SAVINGS

documentNumber

  • Validation depends on documentType

documentType

  • Allowed values: NATIONAL_ID, RUC, PASSPORT, RESIDENT_ID, TAX_ID

bankName

  • Must match one of the supported banks for Peru
  • See Bank Name Validation for how to retrieve the list of supported banks
  • First 3 digits of account number must match the bank's code
  • Length: 2-255 characters

Bank Code Validation Example

If you select "Banco de Crédito del Perú" (bank code: 002):

  • ✅ Valid account: 00212345678901234567 (starts with "002")
  • ❌ Invalid account: 00112345678901234567 (starts with "001", wrong bank)

BOB - Bolivian Boliviano

Payout method type: bobDomestic

Required Fields

FieldTypeDescription
symbolstringMust be "BOB"
bankAccountNumberstringBank account number
documentNumberstringIdentity/tax document number
documentTypeenumType of document
bankNamestringName of the bank

Field Validations

bankAccountNumber

  • Format: Numeric only
  • Length: 10-15 digits

documentNumber

  • Validation depends on documentType:
Document TypeFormatDescription
NATIONAL_ID (CI)1-8 digitsCédula de Identidad
RUC (NIT)1-15 digitsNúmero de Identificación Tributaria
RESIDENT_ID (CE)1-8 digitsCédula de Extranjería

documentType

  • Allowed values: NATIONAL_ID, RUC, RESIDENT_ID
  • PASSPORT and TAX_ID are not supported for Bolivia

bankName

  • Must match one of the supported banks for Bolivia
  • See Bank Name Validation for how to retrieve the list of supported banks
  • Length: 2-255 characters

CRC - Costa Rican Colón

Payout method type: crcDomestic

Required Fields

FieldTypeDescription
symbolstringMust be "CRC"
ibanstringInternational Bank Account Number
documentNumberstringIdentity/tax document number
documentTypeenumType of document
bankNamestringName of the bank

Field Validations

iban

  • Format: Valid IBAN with proper country code and checksum
  • Validated using the ibantools library

documentNumber

  • Format: Depends on documentType

documentType

  • Allowed values: NATIONAL_ID, RUC, PASSPORT, RESIDENT_ID, TAX_ID

bankName

  • Format: Free text
  • Length: 2-255 characters

ZAR - South African Rand

Payout method type: zarDomestic

Required Fields

FieldTypeDescription
symbolstringMust be "ZAR"
accountTypeenumAccount type
bankAccountNumberstringBank account number
bankNamestringName of the bank

Field Validations

accountType

  • Allowed values: CHECKING, SAVINGS

bankAccountNumber

  • Format: Numeric string
  • Length: 6-25 digits

bankName

  • Must match one of the supported banks for South Africa
  • See Bank Name Validation for how to retrieve the list of supported banks
  • Length: 2-255 characters

Validation Algorithms

This section provides detailed explanations of the checksum and validation algorithms used across different currencies.

US Routing Number Checksum

The US routing number uses a MOD 10 checksum algorithm to validate the 9-digit routing number.

Algorithm:

Given routing number: d1 d2 d3 d4 d5 d6 d7 d8 d9

checksum = 3 × (d1 + d4 + d7) + 7 × (d2 + d5 + d8) + (d3 + d6 + d9)

Valid if: checksum % 10 === 0

Example:

  • Routing number: 026009593
  • Calculation:
    • 3 × (0 + 0 + 9) = 27
    • 7 × (2 + 0 + 5) = 49
    • (6 + 9 + 3) = 18
    • Sum = 27 + 49 + 18 = 94
    • 94 % 10 = 4 (would fail validation)

Mexican CLABE Validation

The CLABE (Clave Bancaria Estandarizada) is Mexico's standardized 18-digit bank account number with a checksum.

Structure:

  • Positions 1-3: Bank code
  • Positions 4-6: Branch code
  • Positions 7-17: Account number (11 digits)
  • Position 18: Check digit

Checksum Algorithm:

Weights: [3, 7, 1] (repeating pattern)

For each digit i from 0 to 16:
  weighted_sum += digit[i] × weight[i % 3]

check_digit = (10 - (weighted_sum % 10)) % 10

Valid if: digit[17] === check_digit

Example:

  • CLABE: 012180000123456782
  • First 17 digits: 01218000012345678
  • Apply weights cyclically to calculate check digit
  • Final digit must match calculated value

Debit Card Luhn Validation

MXN debit card numbers are 16 digits and must pass the Luhn (MOD 10) check.

Algorithm:

Moving left from the rightmost digit (the check digit):
  keep the check digit as is, double the next digit, and keep alternating
  if a doubled value is greater than 9, subtract 9

sum = total of all 16 resulting digits

Valid if: sum % 10 === 0

Example:

  • Card number: 4111111111111111
  • Doubled digits (every second digit from the right, which is positions 1, 3, …, 15 from the left): the 4 becomes 8 and seven 1s become 2 each, so 8 + 14 = 22
  • Other digits: eight 1s = 8
  • Sum = 22 + 8 = 30
  • 30 % 10 = 0 (passes validation)

Chilean RUT Validation

The Chilean RUT (Rol Único Tributario) uses a MOD 11 algorithm with a special check digit that can be 'K'.

Format: 7-8 digits + check digit (0-9 or K)

Algorithm:

Multipliers: [2, 3, 4, 5, 6, 7] (repeating)

sum = 0
for each digit (right to left):
  multiplier = multipliers[position % 6]
  sum += digit × multiplier

remainder = sum % 11

check_digit =
  if remainder === 0: '0'
  else if remainder === 1: 'K'
  else: (11 - remainder)

Example:

  • RUT: 12.345.678-5
  • Clean format: 123456785
  • Extract body: 12345678
  • Calculate check digit using MOD 11
  • Compare with provided check digit

Colombian NIT Validation

The Colombian NIT uses the MOD 11 algorithm with specific multipliers.

Format: 8-10 digits + check digit (total 10-11 digits)

Multipliers: [41, 37, 29, 23, 19, 17, 13, 7, 3]

Algorithm:

1. Extract body (first 9 digits, pad with zeros if needed)
2. Extract check digit (last digit)

sum = 0
for i from 0 to 8:
  sum += digit[i] × multipliers[i]

remainder = sum % 11

check_digit =
  if remainder < 2: remainder
  else: 11 - remainder

Valid if: extracted check digit === calculated check digit

Example:

  • NIT: 860007738-7
  • Clean format: 8600077387
  • Apply multipliers to first 9 digits
  • Calculate and verify check digit

Chinese USCC Validation

The Chinese Unified Social Credit Code (USCC) uses the ISO 7064 MOD 31-2 algorithm.

Format: 18 alphanumeric characters

Restricted Character Set: 0123456789ABCDEFGHJKLMNPQRTUWXY (excludes I, O, S, V, Z)

Structure:

  • Positions 1-2: Organization type
  • Positions 3-8: Date/region code (must be digits)
  • Positions 9-17: Organization code
  • Position 18: Check character

Algorithm:

Weights: [1, 3, 9, 27, 19, 26, 16, 17, 20, 29, 25, 13, 8, 24, 10, 30, 28]

1. Convert each character to numeric value (0-30) based on position in character set
2. Calculate weighted sum using the weights above
3. Calculate check value using MOD 31-2 algorithm
4. Convert back to character and verify

Chinese Resident ID Validation

The Chinese Resident ID uses a MOD 11-2 algorithm with birthdate validation.

Format: 17 digits + check character (0-9 or X)

Structure:

  • Positions 1-6: Region code
  • Positions 7-14: Birthdate (YYYYMMDD) - must be valid date
  • Positions 15-17: Sequence code
  • Position 18: Check character

Weights: [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]

Check Character Map: ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2']

Algorithm:

1. Validate format: 17 digits + [0-9 or X]
2. Extract and validate birthdate (must be real calendar date, year 1900-current)
3. Calculate weighted sum
4. Check character = CHECK_MAP[sum % 11]
5. Verify against provided character

Brazilian CPF Validation

The CPF (Cadastro de Pessoas Físicas) is Brazil's individual taxpayer ID, consisting of 11 digits with 2 verification digits calculated using the MOD 11 algorithm.

Format:

  • Unformatted: 11 consecutive digits (e.g., 12345678909)
  • Formatted: XXX.XXX.XXX-YY (e.g., 123.456.789-09)
  • Last 2 digits (YY) are check digits

Checksum Algorithm (MOD 11):

Given CPF: d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11

First check digit (d10):
  multipliers = [10, 9, 8, 7, 6, 5, 4, 3, 2]
  sum = d1×10 + d2×9 + d3×8 + d4×7 + d5×6 + d6×5 + d7×4 + d8×3 + d9×2
  remainder = sum % 11
  check_digit_1 = (remainder < 2) ? 0 : (11 - remainder)

Second check digit (d11):
  multipliers = [11, 10, 9, 8, 7, 6, 5, 4, 3, 2]
  sum = d1×11 + d2×10 + d3×9 + d4×8 + d5×7 + d6×6 + d7×5 + d8×4 + d9×3 + d10×2
  remainder = sum % 11
  check_digit_2 = (remainder < 2) ? 0 : (11 - remainder)

Valid if: calculated check digits match d10 and d11

Example:

  • CPF: 123.456.789-09
  • Digits: 1 2 3 4 5 6 7 8 9 0 9
  • First check digit calculation:
    • Sum = 1×10 + 2×9 + 3×8 + 4×7 + 5×6 + 6×5 + 7×4 + 8×3 + 9×2 = 210
    • Remainder = 210 % 11 = 1
    • Check digit = (1 < 2) ? 0 : (11 - 1) = 0 ✓
  • Second check digit calculation:
    • Sum = 1×11 + 2×10 + 3×9 + 4×8 + 5×7 + 6×6 + 7×5 + 8×4 + 9×3 + 0×2 = 255
    • Remainder = 255 % 11 = 2
    • Check digit = (2 < 2) ? 0 : (11 - 2) = 9 ✓

Invalid Patterns:

  • All same digits (e.g., 111.111.111-11) are always invalid
  • Common test values like 000.000.000-00 are rejected

Brazilian CNPJ Validation

The CNPJ (Cadastro Nacional da Pessoa Jurídica) is Brazil's business taxpayer ID, consisting of 14 digits with 2 verification digits calculated using the MOD 11 algorithm.

Format:

  • Unformatted: 14 consecutive digits (e.g., 11222333000181)
  • Formatted: XX.XXX.XXX/XXXX-YY (e.g., 11.222.333/0001-81)
  • Last 2 digits (YY) are check digits

Checksum Algorithm (MOD 11):

Given CNPJ: d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14

First check digit (d13):
  multipliers = [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2]
  sum = d1×5 + d2×4 + d3×3 + d4×2 + d5×9 + d6×8 + d7×7 + d8×6 + d9×5 + d10×4 + d11×3 + d12×2
  remainder = sum % 11
  check_digit_1 = (remainder < 2) ? 0 : (11 - remainder)

Second check digit (d14):
  multipliers = [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2]
  sum = d1×6 + d2×5 + d3×4 + d4×3 + d5×2 + d6×9 + d7×8 + d8×7 + d9×6 + d10×5 + d11×4 + d12×3 + d13×2
  remainder = sum % 11
  check_digit_2 = (remainder < 2) ? 0 : (11 - remainder)

Valid if: calculated check digits match d13 and d14

Example:

  • CNPJ: 11.222.333/0001-81
  • Digits: 1 1 2 2 2 3 3 3 0 0 0 1 8 1
  • First check digit calculation:
    • Sum = 1×5 + 1×4 + 2×3 + 2×2 + 2×9 + 3×8 + 3×7 + 3×6 + 0×5 + 0×4 + 0×3 + 1×2 = 97
    • Remainder = 97 % 11 = 9
    • Check digit = (9 < 2) ? 0 : (11 - 9) = 2 (Note: This example demonstrates the calculation, but is not a real valid CNPJ)

Invalid Patterns:

  • All same digits (e.g., 11.111.111/1111-11) are always invalid
  • Common test values like 00.000.000/0000-00 are rejected

BRL Document Validation Behavior:

For all BRL bank account types, the system:

  1. Accepts both CPF and CNPJ formats
  2. Validates the check digits for the appropriate format based on length
  3. Passes validation if either CPF or CNPJ validation succeeds
  4. Provides clear error messages indicating which format failed and why

Support

For questions about bank account validations or to report issues with this documentation, please contact the Mural API support team.


Did this page help you?