Overview
All transactions use the same base request format with operation-specific fields. This unified structure simplifies integration by providing a consistent API interface for both payments and withdrawals.Common Fields
All requests to the/process/
endpoint must include these base fields:
Field | Type | Required | Description |
---|---|---|---|
operation_type | string | Yes | "payment" or "withdrawal" |
amount | decimal | Yes | Transaction amount |
currency | string | No | Currency code (default: "MXN" ) |
customer | object | Yes | Customer information |
customer.name | string | Yes | Customer full name |
customer.email | string | Yes | Customer email address |
client_reference | string | No | Your reference identifier |
metadata | object | No | Additional data for your records |
return_url | string | No | URL for redirection after 3DS processing |
Basic Request Structure
Basic Request Structure
Request Headers
All requests must include these headers:Payment Request Fields
Whenoperation_type
is "payment"
, include these additional fields:
Field | Type | Required | Description |
---|---|---|---|
payment_method | object | Yes | Payment method details |
payment_method.type | string | Yes | Payment method type ("CARD" , "SPEI" , etc.) |
payment_method.token | string | * | Tokenized card ID (for card payments) |
payment_method.card_number | string | * | Card number (if not using token) |
payment_method.cvv | string | * | Security code (for raw card data) |
payment_method.expiry_month | string | * | Expiration month (for raw card data) |
payment_method.expiry_year | string | * | Expiration year (for raw card data) |
payment_method.cardholder_name | string | * | Cardholder name (for raw card data) |
For card payments, you’ll need to provide either a
token
or the full card details.Card Payment Examples
Below are some examples of card payment requests.Using Tokenized Card (Recommended)
Using Tokenized Card (Recommended)
For tokenized card payments (
payment_method.type: "CARD"
), you’ll need to provide the token
instead of the full card details:SPEI Bank transfer
SPEI Bank transfer
For SPEI transfers (
payment_method.type: "SPEI"
), only customer information is required:OXXO Cash Payment
OXXO Cash Payment
For OXXO payments (
payment_method.type: "oxxopay"
):Withdrawal Request Fields
Whenoperation_type
is "withdrawal"
, include these additional fields:
Field | Type | Required | Description |
---|---|---|---|
transfer_method | string | Yes | Transfer method ("SPEI" or "DEBIT_CARD" ) |
beneficiary | object | Yes | Beneficiary information |
reference | string | No | Your withdrawal reference |
description | string | No | Withdrawal description |
beneficiary
object includes the following fields:
Field | Type | Required | Description |
---|---|---|---|
beneficiary.account | string | Yes | Account number or CLABE |
beneficiary.name | string | Yes | Beneficiary full name |
beneficiary.rfc | string | Yes | Mexican tax ID (RFC) |
beneficiary.institution | string | Yes | Bank institution code |
beneficiary.email | string | Yes | Beneficiary email |
SPEI Withdrawal Example
SPEI Withdrawal Example
Supported Payment Methods
The following payment methods are supported:Method | Type Value | Description | Processing Time |
---|---|---|---|
Cards | CARD | Credit and debit cards | Instant |
SPEI | SPEI | Mexican bank transfers | Real-time |
OXXO | OXXO | Cash payments at OXXO stores | 24-48 hours |
Mercado Pago | MERCADOPAGO | Digital wallet | Instant |
SafetyPay | SAFETYPAY | Alternative cash payment | 24-48 hours |
Supported Transfer MethodsYou can use either SPEI for same-day bank transfers, or Debit Card for instant direct deposits.
- SPEI (
SPEI
): Bank account transfers, processed on the same day. - Debit Card (
DEBIT_CARD
): Direct card deposits, processed instantly.
Field Validation Rules
Amount & Currency
Amount & Currency
Field | Rules | Example |
---|---|---|
amount | 0.01 - 15,000,000, up to 2 decimals | 1000.50 , 25.99 |
currency | MXN (default), USD , uppercase | MXN , USD |
Email & Names
Email & Names
Field | Rules | Example |
---|---|---|
customer.email | Valid email format | user@domain.com |
customer.name | Required, any format | John Doe |
beneficiary.email | Valid email format | beneficiary@email.com |
beneficiary.name | Required, any format | Roberto Martínez García |
Mexican Tax & Banking
Mexican Tax & Banking
Field | Rules | Example |
---|---|---|
beneficiary.rfc | 12-13 alphanumeric, pattern: ^[A-Z&Ñ]{3,4}\\d{6}[A-Z\\d]{3}$ | XAXX010101000 , MAGR850920XY1 |
beneficiary.account | 18 digits: Bank(3) + Branch(3) + Account(11) + Check(1) | 012345678901234567 |
Complete Request Examples
Check the following examples to see how to use the request body.Request Size Limits
The request body size is limited to 10KB. Here’s a breakdown of the maximum size for each field:Field | Maximum Size |
---|---|
Total request body | 10KB |
Customer name | 255 characters |
Customer email | 320 characters |
Client reference | 255 characters |
Description | 500 characters |
Metadata object | 2KB |
Best Practices
Here are some best practices to help you build reliable, secure, and robust requests.Required Fields
Required Fields
- Always include required fields to avoid validation errors
- Use proper data types (strings, numbers, objects)
- Follow format requirements for special fields (email, RFC, CLABE)
Optional Fields
Optional Fields
- Include
client_reference
for transaction tracking - Use
metadata
for additional business information - Specify
return_url
for card payments that may require 3DS
Data Quality
Data Quality
- Validate email addresses before sending
- Ensure RFC format compliance for Mexican transactions
- Use correct bank institution codes for SPEI transfers
- Test with sandbox data before production
Security
Security
- Never log or store raw card data
- Use tokenized card data when possible
- Implement proper HMAC signature generation
- Validate all input data before sending requests
Next Steps
- Review Response Format for handling API responses
- Learn about Payment Methods for specific implementation details
- Check Error Handling for validation error management
- Explore Card Tokenisation for secure card data handling