Overview

Tonder’s withdrawal functionality enables businesses to send payouts to beneficiaries through the same unified /process/ endpoint. Withdrawals support SPEI bank transfers and direct debit card deposits, providing flexible payout options across Mexico. These are the withdrawal methods supported by Tonder:
MethodIDDescriptionProcessing Time
SPEISPEIBank account transfersSame day
Debit CardDEBIT_CARDDirect card depositsInstant

Withdrawal Request Structure

All withdrawal requests use operation_type: "withdrawal" and must include beneficiary information. The following fields are required for withdrawal requests:
FieldTypeRequiredDescription
operation_typestringYesMust be "withdrawal"
amountdecimalYesWithdrawal amount
currencystringNoCurrency code (default: "MXN")
transfer_methodstringYesTransfer method ("SPEI" or "DEBIT_CARD")
beneficiaryobjectYesBeneficiary information
referencestringNoYour withdrawal reference
descriptionstringNoWithdrawal description
The beneficiary object includes the following fields:
FieldTypeRequiredDescription
beneficiary.accountstringYesAccount number or CLABE
beneficiary.namestringYesBeneficiary full name
beneficiary.rfcstringYesMexican tax ID (RFC)
beneficiary.institutionstringYesBank institution code
beneficiary.emailstringYesBeneficiary email

SPEI Withdrawals

SPEI withdrawals transfer funds directly to Mexican bank accounts using the SPEI interbank system. Processing typically completes on the same business day.

SPEI Account Validation

SPEI validates accounts using the CLABE format, which is a 18-digit bank account number format used in Mexico. It consists of the following components:
  • 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)
Example CLABE Breakdown:
CLABE: 012345678901234567
│││└─────────────────── Account number (11 digits)
││└─────────────────────── Branch code (3 digits)
│└──────────────────────── Bank code (3 digits)
└───────────────────────── Check digit (1 digit)

Institution Codes

Major Mexican financial institutions and their corresponding codes for SPEI transactions:
CodeBank NameCLABE Prefix
40012BBVA México012
40014Santander014
40021HSBC021
40072Banorte072
40646STP646
40137Banregio137
40058Banco Azteca058

Debit Card Withdrawals

Debit card withdrawals enable instant deposits directly to debit cards, providing immediate fund availability to beneficiaries.

Withdrawal Status Flow

Withdrawals have their own status flow, which is different from payments.
StatusDescriptionNext Steps
pendingWithdrawal request receivedMonitor for processing
processingTransfer being processedWait for completion
successTransfer completed successfullyTransaction complete
failedTransfer failedCheck error details
declinedTransfer declined by bankTry different account

Status Check

Use the transaction status endpoint to monitor withdrawal progress:
GET /transactions/{withdrawal_id}/

Implementation Examples

Below you’ll find examples of how to implement withdrawals in different programming languages.
def process_spei_withdrawal():
    """Process SPEI withdrawal to bank account"""
    
    withdrawal_data = {
        "operation_type": "withdrawal",
        "amount": 750.00,
        "currency": "MXN",
        "reference": "payout-001",
        "transfer_method": "SPEI",
        "description": "Commission payment",
        "beneficiary": {
            "account": "012345678901234567",
            "name": "Roberto Martínez García",
            "rfc": "MAGR850920XY1",
            "institution": "40012",
            "email": "roberto.martinez@email.com"
        }
    }
    
    try:
        response = tonder_api.process_withdrawal(withdrawal_data)
        print(f"Withdrawal initiated: {response['id']}")
        return response
        
    except Exception as e:
        print(f"Withdrawal failed: {e}")
        return None

def process_card_withdrawal():
    """Process withdrawal to debit card"""
    
    withdrawal_data = {
        "operation_type": "withdrawal",
        "amount": 500.00,
        "currency": "MXN",
        "reference": "card-payout-002",
        "transfer_method": "DEBIT_CARD",
        "description": "Instant payout to debit card",
        "beneficiary": {
            "account": "4111111111111111",
            "name": "Ana María González",
            "rfc": "GOAN850315AB2",
            "institution": "40012",
            "email": "ana.gonzalez@email.com"
        }
    }
    
    try:
        response = tonder_api.process_withdrawal(withdrawal_data)
        print(f"Card withdrawal initiated: {response['id']}")
        return response
        
    except Exception as e:
        print(f"Card withdrawal failed: {e}")
        return None

Validation Requirements

Withdrawals can go through a validation process to ensure the data is correct.

RFC Validation

RFC is used to validate the beneficiary’s tax identification number. This is a 12-13 alphanumeric characters format and can be either an individual or business RFC.
TypeStructureExample
Individual4 letters from the name
6 digits for date of birth (YYMMDD)
3 alphanumeric characters
MAGR850920XY1
Business3 letters from the business name
6 digits for registration date (YYMMDD)
3 alphanumeric characters
ABC9901011A2
For individuals, the RFC is generated from the person’s name and date of birth. For businesses, it’s based on the business name and registration date.

Account Number Validation

Account number is used to validate the beneficiary’s bank account number. This is a 18 digits number and can be either a SPEI/CLABE or a debit card number.
TypeValidation Criteria
SPEI/CLABE- Exactly 18 digits
- Valid checksum digit
- Recognised bank code
Debit Card- 13–19 digits
- Valid card number format
- Must be a debit card (not a credit card)

Error Handling

Here you’ll find the common errors that can happen when processing withdrawals.
Error CodeDescriptionSolution
invalid_clabeCLABE number invalidVerify CLABE format
institution_not_foundBank code not foundUse valid institution code
insufficient_balanceNot enough balanceCheck account balance
beneficiary_blockedBeneficiary account blockedContact bank
invalid_rfcRFC format invalidUse valid RFC format
amount_too_highExceeds withdrawal limitsReduce amount

SPEI Operating Schedule

Here are some information about the operating hours for SPEI transactions.
Day/PeriodProcessing HoursNotes
Monday to Friday6:00 AM – 6:00 PM (CDMX time)Same-day processing if before 5:00 PM
Saturday9:00 AM – 2:00 PMLimited processing
SundayNo processing
Bank holidaysNo processing
Processing Times for WithdrawalsWithdrawals are processed according to the method and the time you submit your request:
  • Same business day: Requests before 5:00 PM (CDMX) on business days are processed the same day.
  • Next business day: Requests after 5:00 PM or on weekends are processed the next business day.
  • Instant: Debit card withdrawals are instant, 24/7.

Best Practices

Here you’ll find some best practices to follow when processing withdrawals.

Testing

Here you’ll find some information about the test bank accounts and cards that you can use to test your withdrawals.

Test Bank Accounts

CLABEScenarioExpected Result
646180157000000004Successful transferprocessing status
012345678901234567Invalid checksumValidation error
999999999999999999Non-existent bankinstitution_not_found error

Test Cards

Card NumberScenarioExpected Result
4111111111111111Successful withdrawalprocessing status
4000000000000002Declined carddeclined status
5555555555554444Processing errorfailed status

Next Steps