Skip to main content

Pay-In · Mexico

TOPPAY TeamAbout 4 min

Overview

The Pay-In API initiates collection transactions from customers. This page covers Mexico (country code mx) with two ordering modes:

ModePathDescription
Cashier mode/pay/prePayDefault. Returns cashierUrl for the platform H5 cashier
API mode/pay/transOrderRequires method in the request; returns payData / payDataType (CLABE, QR code, redirect URL, etc.)

method (Mexico Pay-In codes) is listed in Regional Payment Guide — Mexico.

Integration note

Cashier mode is enabled by default. Contact support to whitelist your merchant account before integrating API mode.

Request Header

Shared by both modes:

FieldRequiredTypeDescription
Content-TypeMStringFixed value: application/json

Cashier Mode (prePay)

Pre-order and redirect the customer to the platform cashier via cashierUrl.

Request URL

Domain: Prefer unified host openapi.toppayment.com (path unchanged); legacy country domain (e.g. global-mx-openapi.toppayment.com) remains available.

EnvironmentURL
Sandboxhttps://openapi.toppayment.com/sandbox/mx/pay/prePay
Productionhttps://openapi.toppayment.com/mx/pay/prePay

Request Body

FieldRequiredTypeDescription
mchNoMString(32)Merchant number
orderNumMString(64)Merchant order number
amountMNumber(32,8)Transaction amount
Positive, integer or at most 2 decimal places; not all zeros; no three or more decimal places
Example: 100.50
productDetailMString(100)Product detail
methodOString(16)Payment method (Mexico)
Optional; omit to let the user choose on the cashier. Common: SPEI; also CODI, OXXORegional Payment Guide — Mexico
timestampMString(13)Timestamp in milliseconds
customerNameMString(64)Customer name
customerEmailMString(64)Customer email
customerPhoneMString(32)Customer phone
expiryPeriodONumber(1–9999)Validity in minutes
downNotifyUrlMString(255)Async callback URL
redirectUrlOString(512)Redirect after payment
signMStringSignature — see Signature

Request Body Example

Content-type: application/json

Response Body Parameters

FieldRequiredTypeDescription
successMBooleanSuccess flag
codeMString9999 = success
msgOStringMessage
timeStampMNumberServer time (ms)
dataMObjectPayload
orderNumMStringMerchant order number
platOrderNumMStringPlatform order number
amountMNumberTransaction amount
feeMNumberFee
methodMStringPayment method — Regional Payment Guide — Mexico
productDetailMStringProduct detail
customerNameMStringCustomer name
customerEmailMStringCustomer email
customerPhoneMStringCustomer phone
validTimeMNumberExpiry timestamp (ms)
cashierUrlMStringCashier URL

Response note

Cashier mode does not return payData or payDataType. Those fields appear only in API mode responses.

Content-type: application/json

API Mode (transOrder)

Specify the payment method in the request, place the order directly with the channel, and receive payData / payDataType (SPEI CLABE, CoDi QR payload, OXXO payment page URL, etc.) without the platform H5 cashier.

Request URL

EnvironmentURL
Sandboxhttps://openapi.toppayment.com/sandbox/mx/pay/transOrder
Productionhttps://openapi.toppayment.com/mx/pay/transOrder

Request Body

Differences from cashier mode:

FieldRequiredTypeDescription
methodMString(16)Payment method (Mexico)
Required in API mode. Common: SPEI, CODI, OXXORegional Payment Guide — Mexico

All other fields match cashier mode.

Request Body Example

Content-type: application/json

Response Body Parameters

Common fields match cashier mode. API mode focuses on:

FieldRequiredTypeDescription
payDataMStringPayment payload — CLABE, CoDi QR string, OXXO page URL, etc.; meaning depends on payDataType
payDataTypeMStringVA, QR_CODE, CASHIER_URL, etc.

payDataType Reference

payDataTypeDescriptionTypical methods
VAVirtual account / CLABE for bank transferSPEI
QR_CODEQR payload string — render as QR code on your sideCODI
CASHIER_URLUpstream payment page URLOXXO
Content-type: application/json

Notification

Both ordering modes use the same async callback. Mexico uses v1 onlynotifyVersion / v2 payer fields are not supported.

For SPEI and similar flows, multiple success callbacks under the same orderNum are possible — see Pay-In notification rules in Regional Payment Guide — Mexico.

HTTP Request

FieldRequiredTypeDescription
Content-TypeMStringapplication/json

Notification Body

FieldRequiredTypeDescription
platOrderNumMStringPlatform order number
versionMStringFixed value: v1
orderNumMStringMerchant order number
amountMNumberAmount
feeMNumberFee
customerNameMStringCustomer name
customerEmailMStringCustomer email
customerPhoneMStringCustomer phone
statusMStringStatus — see Transaction Status Codes
signMStringCallback signature

Acknowledgment

Important

Return the string SUCCESS only to confirm receipt of the notification.

{
    "platOrderNum": "PRE2009165141186183168",
    "version": "v1",
    "orderNum": "MX12345621",
    "amount": 100.50,
    "fee": 2,
    "customerName": "Juan Garcia",
    "customerEmail": "[email protected]",
    "customerPhone": "+5255123456789",
    "status": "SUCCESS",
    "sign": "…"
}