SPEI
Learn how to accept SPEI, a common payment method in Mexico.
SPEI® is a system developed and operated by Banco de México that allows the general public, in a matter of seconds, to make electronic payments, also called electronic transfers, via a bank, the Internet, or mobile banking. This system allows money to be transferred electronically between bank deposit accounts almost instantly.
Payment type | Bank transfer |
Market | Mexico |
Customers currencies | MXN |
Processing currencies | MXN |
Settlement currencies | EUR |
Refunds | Yes |
Payout | Yes |
Step 1. Make a transaction request
From your server, make a POST /payment_preauthorize request.
https://sandbox.payabl.com/pay/backoffice/payment_preauthorize
Include in the request parameters below:
The below parameters are mandatory for SPEI.
merchantid
: The merchant identification number.orderid
: The field orderid is optional and exclusively for the merchant's convenience.amount
: The amount field contains the transaction’s total amount. This is the amount that will be transmitted to the authorizing system.currency
: The currency field contains the alphanumeric currency code for the transaction, according to ISO 4217, e.g. MXN.payment_method
: The payment method id - 130 (or 126 if instructed by tech support).signature
: The signature field contains a 40-figure hexadecimal value. This signature value is a checksum designed to protect the merchant account from unauthorized access.email
: The customer's email address.custom2
: The name of payment method - spei.nationalid
: Consumer’s national id, has to satisfy the following regular expression: RFC: 13 chars, ex: MAMB780915969; CURP: 18 chars.nationaltype
: User's identification type RFC or CURP.
You can see a full list of parameters in Pre-Authorization.
Request example
/pay/backoffice/payment_preauthorize&merchantid=gateway_test&amount=23¤cy=MXN&orderid=Payabl-Test
&language=en&gender=&lastname=Mann&street=Office+11A,+Swepco+Court,+Griva+Digeni+80&zip=60322&
city=Frankfurt&country=DEU&customerid=&salutation=&title=&firstname=Muster&company=&birthday=&house=&
postbox=&state=&[email protected]&phone=&fax=&mobile=&customerip=&custom1=&custom2=SPEI&custom3=&
url_return=http://dev-sim-ng.inatec.local/~simdad/InatecResponse/redirect_response.php&url_success=
http://dev-sim-ng.inatec.local/~simdad/InatecResponse/success.php&url_failed=http://dev-sim-ng.inatec.
local/~simdad/InatecResponse/failed.php¬ification_url=https://api.powercash.de/simulation/billing_
response.php&payment_method=130&nationaltype=RFC&nationalid=MAMB780915969&subject=test+subject&
content=test+content&signature=4938f36364571ddeeb80fa1d61b011a801b5ffbe
Step 2. Handle the redirect
To complete the payment, you need to redirect the customer to the correct URL in the response.
Response
transactionid=105352762&transid=105352762&status=2000&errormessage=pending&errmsg=pending&amount=23&
price=23¤cy=MXN&orderid=Payabl-Test&user_id=787410&redirect_url=https://checkout-test.pagsmile.
com/checkout?prepay_id=VVYwNzVPZEhKV1VSdjU5akl4QkhxOHhKZWxUTDJ0YWJKTlROR3daditQYz0=-5a1e6537
Step 3. Transaction states
If the customer successfully completed the transaction, you will receive a notification with confirmation.
Notification example (successful transaction):
type=capture&orderid=Payabl-Test&errorcode=0&errormessage=&security=036e1050afc9f18ada82e923e39d45ec29
df31c8e7a7295e06378e08c434ca5d&transactionid=105352762&payment_method=130×tamp=1693227607&
payment_state=credited
If the customer initiated the transaction but didn't finalize it, you will receive a failed notification.
Notification example with error:
errorcode=-66183&errormessage=Wrong+national+type&security=98eb1dbce3c3075fa371217d5ef705b862dbe6c3429
6ed0b06d5f8afd4d7ba01×tamp=1693227169&transactionid=105352759&type=order&orderid=Payabl-Test
Refunds
The method allows merchants to refund full or partial amount of initial transaction via wire transfer. In order for this to be done, the merchant needs to initiate refund request, and customer will receive email with link where he should specify payment information to receive refund. Merchant needs to specify email of the customer, that he could receive email.
Refund will be processed after customer submitted payment data.
Request example
backoffice/payment_refund&merchantid=andrei&transactionid=215458995&amount=1¤cy=MXN&language=en&
external_id=en&signature=8b5d75824db2a85be4d9f98f68bfe900a527b8ee
Response example
transactionid=215458995&transid=215458995&status=0&errormessage=&errmsg=&amount=1.00&price=1.00&
currency=MXN&orderid=Payabl-Test
Payouts
The method allows merchants to send funds to a bank account via wire transfer. In order for this to be done, the merchant needs to submit the bank details of the customer.
Include in a request:
currency
: MXNaccount
: Customer's account number, 10 ~ 18 digitsdocument_id
: Customer's iddocument_type
: Customer's identification type, one of RFC or CURPbankcountry
:MEXbank_code
: bank code, see belowmethod
: speiaccount_type
: Should be one of debit | phone | clabe
Field | Value Format | Accepted Values |
---|---|---|
merchantid | String | [A-Z][0-9] |
amount | Float | 0.00 |
currency | String | MXN |
orderid | String | [0-9] |
language | String | en |
lastname | String | [A-Z] |
street | String | * |
zip | String | [A-Z][0-9] |
city | String | [A-Z] |
country | String | Country Code |
firstname | String | [A-Z] |
state | String | [A-Z] |
String | [A-Z][0-9][-&_]@[A-Z][0-9].[A-Z] | |
custom1 ### optional ### | String | * |
custom2 ### optional ### | String | * |
custom3 ### mandatory payment reason ### | String | * |
payment_method | String | 130 (or 126 if instructed by tech support) Payment Method Id |
phone | String | [0-9] |
bankname | String | Bank Name |
accountnumber | String | [A-Z][0-9] |
testmode ### only for testing ### | String | true |
testmodecallbackstatus ### only for testing ### | String | [PENDING-PROCESSED-ACCEPTED-FINISHED-ERROR] |
signature | String | * |
Request string:
POST https://sandbox.payabl.com/pay/backoffice/payment_cft
merchantid=test_merchant&amount=1.23¤cy=MXN&orderid=Inatec-Test&language=en&lastname=Mann&
street=An+der+Welle+4&zip=60322&city=Frankfurt&country=DEU&firstname=Muster&state=HE&email=test%
40inatec.com&custom1=&custom2=&custom3=&payment_method=130&document_id=50284414727&document_type=CC&
method=TRANSFIYA&bankcountry=COL&additional_remark=transfer+money&account_type=PHONE&account=5701234
5678910&signature=ff09cfa3b2e01e746ddbf19fbab08b30e31ab313
- Response:
transactionid=215456949&transid=215456949&status=2000&errormessage=pending&errmsg=pending&amount=100&
price=100¤cy=MXN&orderid=Payabl-Test&payment_method=130
1.1 Error
transactionid=215457170&transid=215457170&status=4001103&errormessage=method%20or%20channel%20is%20
inactive&errmsg=method%20or%20channel%20is%20inactive&amount=2&price=2¤cy=MXN&orderid=Payabl-Test&
payment_method=130
1.2 Pending
"transactionid=215437556&transid=215437556&status=2000&errormessage=pending&errmsg=pending&amount=1230&price=1230¤cy=MXN&orderid=Inatec-Test&payment_method=126""
- Notification:
2.1 Notification example with Error:
errormessage=&bank_code=001&method=BANKTRANSFER&account_holder=Muster+Mann&orderid=Payabl-Test&
errorcode=0&transactionid=215456949×tamp=1689150492&bank_country=BRA&security=b67f198da9d3
10b956405ff879d098a2e0f8a1728a5ddad6b0e9c4ce3edc9dae&payment_method=130&type=cft
2.2Notification example with Success
errorcode=-5002&method=BANKTRANSFER&account_holder=Muster+Mann&security=389ff24d11207156c43bfc7e9ebc89
3e12726dda4f5a0aaa27544a8c4c986e7c&payment_method=130&bank_country=BRA&errormessage=rejected+by+bank&
orderid=Payabl-Test&type=cft×tamp=1689154433&bank_code=001&transactionid=215456961
Example of SPEI account
Account Type | Account | Text |
---|---|---|
clabe | 112233445566778899 | 18 digits |
debit | 1122334455667788 | 16 digits |
phone | 5522123456 | 10 digits |
Mexico document type
Mexican taxpayers could get RFC.
RFCs are 13 digits long for individuals, 12 for companies, and they’re made up of letters and numbers. The first 4 digits for individuals, or 3 for companies, are taken from the name, then there are six numbers denoting the date of birth or when the business was founded, and the end digits are check digits.Mexican citizen or resident could get CURP.
It’s an 18-digit social security number for people living in Mexico. The 18 characters combine information deriving from your name, date and place of birth, and gender to create a unique code.
Bank in Mexico
Check below the different values that bank_code parameter can take in Mexico.
Bank Name | Bank Code |
---|---|
ABC CAPITAL | 40138 |
ACCENDO BANCO | 40102 |
ACTINVER | 40133 |
AFIRME | 40062 |
AKALA | 90638 |
AMERICAN EXPRES | 40103 |
ASP INTEGRA OPC | 90659 |
AUTOFIN | 40128 |
AZTECA | 40127 |
BAJIO | 40030 |
BANAMEX | 40002 |
BANCO FINTERRA | 40154 |
BANCO S3 | 40160 |
BANCOMEXT | 37006 |
BANCOPPEL | 40137 |
BANCREA | 40152 |
BANJERCITO | 37019 |
BANK OF AMERICA | 40106 |
BANKAOOL | 40147 |
BANOBRAS | 37009 |
BANORTE | 40072 |
BANREGIO | 40058 |
BANSEFI | 37166 |
BANSI | 40060 |
BANXICO | 2001 |
BARCLAYS | 40129 |
BBASE | 40145 |
BBVA BANCOMER | 40012 |
BMONEX | 40112 |
CAJA POP MEXICA | 90677 |
CAJA TELEFONIST | 90683 |
CB INTERCAM | 90630 |
CI BOLSA | 90631 |
CIBANCO | 40143 |
CoDi Valida | 90903 |
COMPARTAMOS | 40130 |
CONSUBANCO | 40140 |
CREDICAPITAL | 90652 |
CREDIT SUISSE | 40126 |
CRISTOBAL COLON | 90680 |
DEUTSCHE | 40124 |
DONDE | 40151 |
ESTRUCTURADORES | 90606 |
EVERCORE | 90648 |
FINAMEX | 90616 |
FINCOMUN | 90634 |
FOMPED | 90689 |
FONDO (FIRA) | 90685 |
GBM | 90601 |
HDI SEGUROS | 90636 |
HIPOTECARIA FED | 37168 |
HSBC | 40021 |
ICBC | 40155 |
INBURSA | 40036 |
INDEVAL | 90902 |
INMOBILIARIO | 40150 |
INTERCAM BANCO | 40136 |
INVERCAP | 90686 |
INVEX | 40059 |
JP MORGAN | 40110 |
KUSPIT | 90653 |
LIBERTAD | 90670 |
MASARI | 90602 |
MIFEL | 40042 |
MIZUHO BANK | 40158 |
MONEXCB | 90600 |
MUFG | 40108 |
MULTIVA BANCO | 40132 |
MULTIVA CBOLSA | 90613 |
NAFIN | 37135 |
PAGATODO | 40148 |
PROFUTURO | 90620 |
REFORMA | 90642 |
SABADELL | 40156 |
SANTANDER | 40014 |
SANTANDER2 | 90814 |
SCOTIABANK | 40044 |
SHINHAN | 40157 |
STP | 90646 |
Inteligencia en Finanzas, S.A.P.I. de C.V. (ALBO) | 90646 |
TRANSFER | 90684 |
UNAGRA | 90656 |
VALMEX | 90617 |
VALUE | 90605 |
VE POR MAS | 40113 |
VECTOR | 90608 |
VOLKSWAGEN | 40141 |
Updated 10 months ago