Mexico withdrawals (MXN)

Withdraw funds to a registered bank account in Mexico in Mexican pesos.

All endpoints require authentication with Authorization: Bearer [TOKEN] and x-api-key.


General flow

Check bank codes

Get available bank list with GET /bank-codes/mxn.

Create recipient

Register beneficiary bank account with POST /recipients/mxn.

Execute withdrawal

Create SPEI withdrawal with POST /withdrawals/mxn/.


Bank codes

Gets available bank code list for a country. Required to register recipient accounts.

Bank codes

Authorizations

Both x-api-key and Authorization: Bearer <token> headers are required.

Endpoint

GEThttps://dev.backend.colurs.co/bank-codes/mxn

Required Headers

Content-Type: application/jsonAccept: application/jsonx-api-key: [API_KEY]Authorization: Bearer [ACCESS_TOKEN]

Request Body

FieldTypeRequiredDescription
countrystringCountry code (e.g. 'mx', 'br', 'co')

cURL Example

curl -X GET "https://dev.backend.colurs.co/bank-codes/mxn?country=mx" \
-H "Authorization: Bearer [ACCESS_TOKEN]" \
-H "x-api-key: [API_KEY]"

Response

response.json
{
"code_transaction": "OK",
"data": [
  { "code": "40012", "name":  "BBVA México"},
  { "code": "40014", "name":  "Santander México"},
  { "code": "40021", "name":  "HSBC México"},
  { "code": "40072", "name":  "Banorte"},
  { "code": "40044", "name":  "Scotiabank México"}
]
}
💡
Save bank `code` to use when creating a recipient or withdrawal method.

Recipients

List recipients

Gets user’s registered recipient accounts. Can query from local DB or sync from external service.

List recipients

Authorizations

Both x-api-key and Authorization: Bearer <token> headers are required.

Endpoint

GEThttps://dev.backend.colurs.co/recipients/mxn

Required Headers

Content-Type: application/jsonAccept: application/jsonx-api-key: [API_KEY]Authorization: Bearer [ACCESS_TOKEN]

Request Body

FieldTypeRequiredDescription
currencystringCurrency (default: 'mxn')
networkstringNetwork (e.g. 'spei')
protocolstringProtocol (e.g. 'clabe')
sourcestring'db' (default) for local source, 'api' to sync with external service

cURL Example

curl -X GET "https://dev.backend.colurs.co/recipients/mxn?currency=mxn" \
-H "Authorization: Bearer [ACCESS_TOKEN]" \
-H "x-api-key: [API_KEY]"

Response

response.json
{
"code_transaction": "OK",
"data": [
  {
    "recipient_id": "rec_abc123",
    "beneficiary_name": "María López",
    "account_number": "646180157000000099",
    "bank_code": 
  "40012"}
]
}

Create recipient

Register a new bank account as recipient for MXN withdrawals.

Create recipient

Authorizations

Both x-api-key and Authorization: Bearer <token> headers are required.

Endpoint

POSThttps://dev.backend.colurs.co/recipients/mxn

Required Headers

Content-Type: application/jsonAccept: application/jsonx-api-key: [API_KEY]Authorization: Bearer [ACCESS_TOKEN]

Request Body

FieldTypeRequiredDescription
beneficiary_namestringBeneficiary full name
account_numberstringCLABE account number (18 digits)
bank_codestringBank code (from /bank-codes/mxn)
currencystringCurrency (e.g. 'mxn')
networkstringNetwork (e.g. 'spei')
protocolstringProtocol (e.g. 'clabe')

cURL Example

curl -X POST "https://dev.backend.colurs.co/recipients/mxn" \
-H "Authorization: Bearer [ACCESS_TOKEN]" \
-H "x-api-key: [API_KEY]" \
-H "Content-Type: application/json" \
-d '{"beneficiary_name":"María López","account_number":"646180157000000099","bank_code":"40012","currency":"mxn"}'

Response

response.json
{
"code_transaction": "OK",
"recipient_id": 
"rec_xyz789"}

Possible Errors

CodeErrorDescription
400BadRequestInvalid account data or incorrect CLABE
409ConflictRecipient is already registered
💡
Save `recipient_id` to use when creating withdrawals.

Withdrawal methods

List withdrawal methods

Gets user’s registered withdrawal methods (recipient accounts).

List withdrawal methods

Authorizations

Both x-api-key and Authorization: Bearer <token> headers are required.

Endpoint

GEThttps://dev.backend.colurs.co/withdrawal-methods/mxn

Required Headers

Content-Type: application/jsonAccept: application/jsonx-api-key: [API_KEY]Authorization: Bearer [ACCESS_TOKEN]

cURL Example

curl -X GET "https://dev.backend.colurs.co/withdrawal-methods/mxn" \
-H "Authorization: Bearer [ACCESS_TOKEN]" \
-H "x-api-key: [API_KEY]"

Response

response.json
{
"code_transaction": "OK",
"data": [
  {
    "recipient_id": "rec_abc123",
    "beneficiary_name": "María López",
    "account_number": "646180157000000099",
    "bank_code": 
  "40012"},
  {
    "recipient_id": "rec_def456",
    "beneficiary_name": "Carlos García",
    "account_number": "014180605000000001",
    "bank_code": 
  "40014"}
]
}

Delete withdrawal method

Delete a registered recipient account.

Delete withdrawal method

Authorizations

Both x-api-key and Authorization: Bearer <token> headers are required.

Endpoint

DELETEhttps://dev.backend.colurs.co/withdrawal-methods/mxn

Required Headers

Content-Type: application/jsonAccept: application/jsonx-api-key: [API_KEY]Authorization: Bearer [ACCESS_TOKEN]

Request Body

FieldTypeRequiredDescription
recipient_idstringRecipient ID to delete

cURL Example

curl -X DELETE "https://dev.backend.colurs.co/withdrawal-methods/mxn?recipient_id=rec_abc123" \
-H "Authorization: Bearer [ACCESS_TOKEN]" \
-H "x-api-key: [API_KEY]"

Response

response.json
{
"code_transaction": "OK",
"message": 
"Recipient deleted successfully"}

Possible Errors

CodeErrorDescription
400BadRequestrecipient_id not provided
404NotFoundRecipient not found

Create SPEI withdrawal

Execute an MXN withdrawal via SPEI to a registered recipient account.

Create MXN withdrawal

Authorizations

Both x-api-key and Authorization: Bearer <token> headers are required.

Endpoint

POSThttps://dev.backend.colurs.co/withdrawals/mxn/

Required Headers

Content-Type: application/jsonAccept: application/jsonx-api-key: [API_KEY]Authorization: Bearer [ACCESS_TOKEN]

Request Body

FieldTypeRequiredDescription
recipient_idstringRegistered recipient ID
amountstringAmount to withdraw in MXN (e.g. '10000.00')
referencestringTransfer reference
conceptstringSPEI payment concept

cURL Example

curl -X POST "https://dev.backend.colurs.co/withdrawals/mxn/" \
-H "Authorization: Bearer [ACCESS_TOKEN]" \
-H "x-api-key: [API_KEY]" \
-H "Content-Type: application/json" \
-d '{"recipient_id":"rec_abc123","amount":"10000.00","concept":"Pago de servicios"}'

Response

response.json
{
"code_transaction": "OK",
"withdraw_id": 12345,
"wid": "w_abc123xyz",
"amount": "10000.00",
"fee": "15.00",
"total": "10015.00",
"status": 
"pending"}

Possible Errors

CodeErrorDescription
400BadRequestInvalid data or amount out of range
402InsufficientFundsInsufficient balance for withdrawal
404NotFoundRecipient not found
⚠️
`fee` indicates charged commission. `total` is the amount deducted from balance (amount + fee).