Skip to main content

SPEI logo

SPEI is an alternative payment method exclusive to Mexico, offered through Facilitapay and FLOW. Developed by Banco de México, it allows immediate electronic transfers between bank accounts of different institutions in Mexico, available 24/7. To use it, the user logs into their online or mobile banking, enters the beneficiary's data and the amount to be transferred, and confirms the transaction.

Integration through redirection

To integrate by redirection, the user must be present at the time of payment, which must be processed through a browser. First we must generate a payment order. In the case of using SPEI through FLOW we will need to send the email in the extra_data:

  "extra_data": {
"profile": {
"first_name": " ",
"last_name": " ",
"email": "test@gmail.com",
}
}
```

As service identifier, the **service_uuid** of the FACILITAPAY or FLOW service you have activated in your **Paylands Backend → Manage → Payment Services → [Listing](https://backend.paylands.com/payment-services/list)** must be indicated.

Once the order is generated, the user must be redirected to [the payment screen](/reference/#operation/redirection-payment) indicating the token of the order and in the query, the name of the APM:

We construct the redirection URL by replacing the **token** with the value returned in the previous call.

```jsx
https://api.paylands.com/v1/sandbox/payment/process/{token}?apm=SPEI
```

Once the user is redirected to this screen, they will be able to view a CLABE or QR code with which, through the mobile application, to complete the payment. When the payment is completed, the user will be redirected back to the URL OK or KO, depending on the result of the payment.

## Testing
For more information on how to test this payment method on each of your providers, visit the FACILITAPAY and FLOW documentation.

## Custom fields
Optionally, if you are using SPEI with FLOW, inside the `extra_data` object you can include the `payment_reason` field, which allows you to indicate a description of the payment.

```json
"extra_data": {
"payment": {
"payment_reason": "Payment description"
}
}
```