This site requires javascript to be enabled.

OXXO Pay Skip to main content
Worldline Connect Home Page

Results for

Results for Searching

Integration

You have two options when it comes to processing OXXO Pay payments. You can either use our hosted checkout pages or directly initiate payments on our platform and use your own checkout page. Both options are available to you, so you can choose the one that best suits your needs.

Before you begin

To follow along with this guide, please ensure that you have the following ready:

Using MyCheckout hosted payment pages

If you're looking for the quickest way to accept payments, our MyCheckout hosted payment pages are the optimal solution for a hassle-free payment experience. 

  1. Make a POST /v1/{merchantId}/hostedcheckouts API call.
  2. Add the order object containing the required properties. 

Additionally, you can add hostedCheckoutSpecificInput object, featuring the following strings:

  • returnUrl - the URL that the consumer is redirect to after the payment flow has finished. 
  • variant - the created styling of the checkout page tailored to your consumer's preferences.
  • locale - the language, that will be used for your hosted checkout page.
Property Data type Required
order object yes
amountOfMoney object yes
amount object yes
currencyCode string yes
customer object yes
personalInformation object yes
name object yes
firstName string yes
surname string yes
contactDetails object yes
emailAddress integer no
billdingAddress object yes
countryCode string yes

Below, you'll find an example request containing the essential data. For more information, please refer to our API Reference.

POST HOSTED CHECKOUTS REQUEST
{
  "order": {
    "amountOfMoney": {
      "amount": 1000,
      "currencyCode": "MXN"
    },
    "customer": {
      "personalInformation": {
        "name": {
          "firstName": "John",
          "surname": "Smith"
        }
      },
      "contactDetails": {
        "emailAddress": "connect@worldline.com"
      },
      "billingAddress": {
        "countryCode": "MX"
      }
    }
  }
}
POST HOSTED CHECKOUTS RESPONSE
{
  "RETURNMAC": "bd0a425f-ed16-4a66-a30b-fb250f9a860b",
  "hostedCheckoutId": "0682b5e0-9e75-71ff-a892-f0f147c150f2",
  "partialRedirectUrl": "pay1.preprod.checkout.worldline-solutions.com/checkout/3010202402-37efb01130eb4439b55040ef56feedba:0682b5e0-9e75-71ff-a892-f0f147c150f2:aec83ce8cde9491ba528360c30a9dbd0"
}

From the response, the important properties are:

  • hostedCheckoutId – can be used in subsequent API calls to retrieve the transaction details, such as GET/v1/{merchantId}/hostedcheckouts/{hostedCheckoutId}
  • partialRedirectUrl – is used to create the URL to which the customer needs to be redirected, By default, we configure every account with the subdomain payment, so you can always connect https://payment/. with the partialRedirectUrl, for example:
https://payment.pay1.preprod.checkout.worldline-solutions.com/checkout/9992..........

For more information on customizing the checkout page, please refer to our detailed guide on MyCheckout hosted payment pages.

The hostedCheckoutId is only valid for 2 hours, please ensure to store the createdPaymentOutput.payment.id from the GET /v1/{merchantId}/hostedcheckouts/{hostedCheckoutId} response to be able to retrieve data after 2 hours have elapsed via the GET /v1/{merchantId}/payments/{paymentId} API call. Alternatively, we can also send a webhook event that will contain it.

Using your own checkout page

You can build a direct integration using our SDKs (or integrate our API from scratch). Depending on your integration needs, there are several options available.

Client encryption

Our Client API allows you to perform various actions. All you need is to be able to create a session via the POST/v1/{merchantId}/sessions API call, which will grant you access to the Client API. It's highly recommended that you use our Client SDKs, provided for the following programming languages:

We also have reference implementations showing how to use these SDKs on GitHub.

Non-encrypted data

If you wish to do a direct server-to-server API call, go for this option. The difference with the other options mentioned before is that you don't need to submit the encryptedCustomerInput property. After the consumer selects the payment product, you need to perform the following:

  1. Make a POST /v1/{merchantId}/payments API call.
  2. Add the order object containing the required properties.
  3. Add the redirectPaymentMethodSpecificInputobject containing the required properties.
  4. Add theredirectionData object containing the returnUrl property. 

Property Data type Required
amount integer yes
paymentProductId integer yes
order object yes
amountOfMoney object yes
customer object yes
billdingAddress object yes
contactDetails object yes
personalInformation object yes
name object yes
references sobject yes
cashPaymentMethodSpecificInput object yes
currencyCode string yes
countryCode string yes
emailAddress integer no
merchantCustomerId string yes
firstName string yes
surname string yes
merchantReference string yes

Below, you'll find an example request containing the essential data. For more information, please refer to our API Reference.

POST PAYMENTS REQUEST
{
    "order": {
        "amountOfMoney": {
            "amount": 1500,
            "currencyCode": "MXN"
        },
        "customer": {
            "billingAddress": {
                "countryCode": "MX"
            },
            "contactDetails": {
                "emailAddress": "test@isaac.ar"
            },
            "merchantCustomerId": "1141124073",
            "personalInformation": {
                "name": {
                    "firstName": "Okey",
                    "surname": "Friesen",
                }
            }
        },
        "references": {
            "merchantReference": "1705055359001"
        }
    },
    "cashPaymentMethodSpecificInput": {
        "paymentProductId": 1502
    }
}
POST PAYMENTS RESPONSE
{
  "creationOutput": {},
  "merchantAction": {
    "actionType": "REDIRECT",
    "redirectData": {
      "RETURNMAC": "924628c0-fcfa-4041-ba40-8f00f7abc774",
      "redirectURL": "https://sandbox.ebanxpay.com/print/voucher/execute?hash=68599d3cd4965f2a9fa9bb977bacb3c84670112a292b9aa9"
    }
  },
  "payment": {
    "id": "10254438349",
    "paymentOutput": {
      "amountOfMoney": {
        "amount": 1500,
        "currencyCode": "MXN"
      },
      "references": {
        "merchantReference": "1705055359001",
        "providerId": "188",
        "providerMerchantId": "0"
      },
      "amountPaid": 0,
      "paymentMethod": "cash",
      "cashPaymentMethodSpecificOutput": {
        "paymentProductId": 1502
      }
    },
    "status": "PENDING_PAYMENT",
    "statusOutput": {
      "isCancellable": false,
      "providerRawOutput": [],
      "isRefundable": false
    }
  }
}
Next Process flows