Search

Are you looking for test card numbers?

Would you like to contact support?

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.

Before you begin

These instructions explain how to add OXXO to your existing API-only integration. The API-only integration works the same way for all payment methods. If you haven't done this integration yet, refer to our API-only integration guide.

Before starting your OXXO integration:

  1. Make sure that you have set up your back end implementation.
  2. 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.

    /payments request
    curl https://checkout-test.adyen.com/v65/payments \
    -H "x-API-key: YOUR_X-API-KEY" \
    -H "content-type: application/json" \
    -d '{
        "amount": {
            "currency": "MXN",
            "value": 30000
        },
        "reference": "YOUR_ORDER_NUMBER",
        "paymentMethod": {
            "type": "oxxo"
        },
        "returnUrl": "https://your-company.com/...",
        "merchantAccount": "YOUR_MERCHANT_ACCOUNT",
        "countryCode": "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.
    /payments response
    {
        "resultCode": "PresentToShopper",
        "action": {
            "alternativeReference": "59570565678234",
            "expiresAt": "2019-10-12T00:00:00",
            "initialAmount": {
                "currency": "MXN",
                "value": 30000
                },
            "instructionsUrl": "https://checkoutshopper-test.adyen.com/checkoutshopper/voucherInstructions.shtml?txVariant=oxxo",
            "merchantName": "YOUR_MERCHANT_NAME",
            "merchantReference": "YOUR_ORDER_NUMBER",
            "paymentMethodType": "oxxo",
            "reference": "59595705656782342019101200903004",
            "totalAmount": {
                "currency": "MXN",
                "value": 30000
                },
            "type": "voucher"
        }
    }

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 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:

resultCode Description Action 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.

To follow the status of the voucher, you have to set up notifications to receive payment updates and results through a notification webhook.
If you set up PENDING notifications specifically for OXXO, you receive a notification for pending OXXO voucher payments. You will receive the final result of the payment in an AUTHORISATION notification.

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.

When you create the voucher, it is shown as an offer in your Customer Area, with an Open status. If you've set up notifications, you will get a PENDING notification.

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. If you've set up notifications, you will get an AUTHORISATION notification. This all happens automatically in a live environment, but you can test this process in your Customer Area.

To be able to test this flow, make sure that you have the following user roles in your test Customer Area:

  • Merchant view offers: This allows you to see OXXO offers that are Open in your Customer Area.
  • Promote offers to sale (test): This allows you to manually promote an OXXO offer from Open to Received in your Customer Area. In this way, you can test what happens when we process the payment. This permission is only available in TEST.

Check the status of OXXO test payments in your Customer Area:

  • OXXO vouchers that are pending or that have expired, are under TransactionsOffers.
  • 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