Payment-method icon

OXXO for API only

Add OXXO to an existing API-only integration.

Accept OXXO payments using our APIs, and build your own payment form to have full control over the look and feel of your checkout page.

Requirements

Requirement Description
Integration type Make sure that you have an existing API-only integration.
Setup steps Before you begin, add OXXO in your test Customer Area.

Build your payment form for OXXO

To show OXXO in your payment form, you need to:

  1. Show OXXO as an available payment method.

    We provide an OXXO logo which you can use on your payment form. For more information, refer to Downloading logos.

  2. Pass the following data to your server:

Make a payment

In your /payments request, specify:

  • amount: The currency and value of the amount due.
  • reference: Your reference to uniquely identify a payment. This reference is used in all communication with you about the payment status.
  • paymentMethod.type: oxxo.
  • returnUrl: The URL to return to after the voucher is created.
  • merchantAccount: Your unique merchant account identifier, with which you want to process the transaction.
  • countryCode: The country code for the payment method, in this case MX.

The /payments response with action.type voucher contains:

  • resultCode: PresentToShopper
  • action: Object containing information about the voucher:

    • alternativeReference: This reference is a short version of the barcode number of the voucher.
    • expiresAt: The date and time when the due date expires.
    • initialAmount: The currency and value of the amount due.
    • instructionsUrl: Link to instructions on how to pay.
    • merchantName: The name of your company.
    • merchantReference: The reference to uniquely identify a payment. This reference is used in all communication with you about the payment status.
    • paymentMethodType: This will state oxxo.
    • reference: The barcode number of the voucher.
    • totalAmount: The currency and value of the amount due.

Present the voucher

Use the information in the action object in the /payments response to present the voucher to the shopper.

  • action.instructionUrl: Link to the instructions how to pay.
  • action.expiresAt: The date and time when the due date expires.
  • action.reference: The barcode number for the payment.
  • action.totalAmount: The currency and value of the amount due.

Make sure that you show the voucher and an option to copy the barcode number. The shopper can then print the voucher and pay in cash at an OXXO store.

You can create and present a custom voucher, for example when you want to customize the look and feel of the voucher. The only restriction is the barcode. To generate the barcode to show on the voucher, you have to use the number from the action.reference field in the /payments response, and the generated barcode must be of the type Code-128.

Present the payment result

Use the resultCode that you received in the /payments response to inform your shopper of the payment status.

The resultCode value you can receive for OXXO is:

resultCodeDescriptionAction to take

PresentToShopper

Present the voucher.

After you present the voucher to the shopper, inform the shopper that you are waiting for the payment to be completed.

Test and go live

OXXO is an offline payment method. This means that there is time between the shopper receiving the voucher and the actual processing of the payment.

To follow the status of the voucher, you have to set up webhooks.

When you create the voucher, it is shown as an offer in your Customer Area, with an Open status. If you set up PENDING webhooks specifically for OXXO, you receive a webhook for pending OXXO voucher payments.

When the shopper pays the voucher at an OXXO store, the payment will be processed. The offer becomes a sale and the status changes to Received. You will receive the final result of the payment in an AUTHORISATION webhook. This all happens automatically in a live environment, but you can test this process in your Customer Area.

In the test environment, you can simulate an OXXO payment by promoting the pending payment to a sale.

  1. Log in to your test Customer Area.
  2. Go to Transactions > Offers.
  3. Select the PSP reference of the pending OXXO payment.
  4. Select the Promote this offer to a sale button.

OXXO vouchers that have been paid (including test offers that you manually promoted to sale), are under Transactions > Payments.

Test the reconciliation process by promoting test payments from offer to sale in your test Customer Area.

Before you can accept live OXXO payments, you need to submit a request to add the OXXO payment method in your live Customer Area.

See also