Process OXXO Payments
https://api-sandbox.epag.io/payment/MY_PAYMENT_TOKEN/sendPayment
Processes an OXXO payment order that were already created using the Create Payment Order
method.
Here is a summary of the flow for a payment using OXXO.
1. Customer Checkout:
The customer shops online and proceeds to the checkout page. They select OXXO as their preferred payment method.
2. Voucher Generation:
The online system generates a payment voucher. This voucher contains a unique barcode and a reference number. The customer receives this voucher, which they can either print or save on their mobile device.
3. In-Store Payment:
The customer takes the voucher to any OXXO convenience store. They present the voucher to the cashier and pay the exact amount in cash. The cashier scans the barcode, and the payment is processed.
4. Payment Confirmation:
After the customer pays at the OXXO store, the payment information is transmitted to the payment processor. OXXO sends its payment report approximately between 10 and 11 AM Mexico City time. Our API updates immediately upon receiving their report, so daily updates will be reflected during those hours. The merchant receives confirmation of the payment, typically within the next business day. The Merchant can then proceed with fulfilling the customers order.
Request Fields
method
(required/string): Payment method. Valid option:OXXO
.expiration_date
(optional/date/YYYY-MM-DD): Expiration date (if not informed system will assume 5 days of current date).description
(optional/string): This is a message that goes attached to the transaction and will show at the recipient's bank statement.logo
(optional/string): The HTTP/Data URL of your logo (must be JPG or PNG format and it is recommended to be proportional to 200 x 45 pixels). If omitted, no logo will be displayed.
Response Fields
payment_token
(string): Token to identify this payment.refresh_token
(string): Updated access token for next calls.transaction_status
(string): Status of this payment.oxxo_amount
(string): Amount of this payment.oxxo_barcode_image
(string): Base64 zipped PNG image representation of Oxxo barcode.oxxo_barcode
(string): Text string containing barcode to pay this payment.oxxo_pdf
(string): Payment confirmation in Base64 zipped PDF format.
AUTHORIZATION | API Key |
---|---|
Key | X-Auth-Token |
Value | MY_ACCESS_TOKEN |
Body Raw(json)
{
"method": "OXXO",
"expiration_date": "2024-05-09",
"description": "Payment via OXXO",
"logo": "data:image/png;base64,BASE64_ENCODED_IMAGE"
}
Example Request
- 200 - Success
- 401 - Unauthorized
- 502 - Bad Gateway
Example Request
curl --location 'https://api-sandbox.epag.io/payment/MY_PAYMENT_TOKEN/sendPayment' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"method": "OXXO",
"expiration_date": "2024-05-09",
"description": "Payment via OXXO",
"logo": "data:image/png;base64,BASE64_ENCODED_IMAGE"
}'
Example Response
Content-Type: application/json
{
"transaction_status": "PROCESSING",
"payment_token": "42afe884-f047-4452-a3db-65a7de76a9c5",
"oxxo_barcode": "64000012578123060900025032",
"oxxo_barcode_image": "BASE64_ZIPPED_PNG",
"oxxo_amount": "123.45",
"oxxo_pdf": "BASE64_ZIPPED_PDF",
"refresh_token": "MY_ACCESS_TOKEN"
}
Example Request
curl --location 'https://api-sandbox.epag.io/payment/MY_PAYMENT_TOKEN/sendPayment' \
--header 'X-Auth-Token: INVALID_ACCESS_TOKEN' \
--data '{
"method": "OXXO",
"expiration_date": "2024-05-09",
"description": "Payment via OXXO"
}'
Example Response
Content-Type: application/json
{
"timestamp": "2024-01-16T15:35:10.131+0000",
"status": 401,
"error": "Unauthorized",
"message": "Access Denied",
"path": "/payment/c6b2ff38-b53d-42dc-b11a-bce5cc05c253/sendPayment"
}
Example Request
curl --location 'https://api-sandbox.epag.io/payment/MY_PAYMENT_TOKEN/sendPayment' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN' \
--data '{
"method": "OXXO",
"expiration_date": "2024-05-09",
"description": "Payment via OXXO"
}'
Example Response
Content-Type: application/json
{
"timestamp": "2024-01-16T20:12:28.156+0000",
"status": 502,
"error": "Bad Gateway",
"message": "There was an issue when contacting an external API, please contact support",
"path": "/payment/2f1c0103-b6fe-4e99-864c-d20c68b97a85/sendPayment",
"errors": [
{
"code": "00.03.0001",
"description": "There was an issue when contacting an external API, please contact support"
}
],
"refresh_token": "MY_ACCESS_TOKEN"
}