This page's content:

The checkout can be easily integrated by making an API call, followed by a redirect to our checkout flow.

Afterwards, you just need a script which treads the update notifications sent by our servers.

Please see the diagram below. There are three interactions with EBANX: request, input redirect, query.

If Boleto is chosen as a payment method the flow is a little different. Although the user gets the Boleto as an email from EBANX, we highly recommend that you also display it to your customer when he returns to your store after checkout. Please see the following example to have an idea of how it works under the hood.

  • Calling request via HTTP GET

Your stores webserver makes a server-to-server call to the EBANX server. The given example includes the minimum number of parameters needed. Please see the API Reference for further parameters and details.

https://api.ebanxpay.com/ws/request?

There is also the option to use the sub-account in the request. The following is an example of request:

https://api.ebanxpay.com/ws/request?  integration_key=YOUR_SECRET_KEY  &payment_type_code=_all  &currency_code=USD  &amount=100  &merchant_payment_code=ABC  &name=Marcos+Silva  &email=marcos@silva.com  &sub_acc_name=Merchant+Test+Name  &suba_acc_image_url=https://www.colourbox.com/preview/9155263-store-front.jpg

For both requests, you will receive a response which includes a JSON object like this:

{
   "status": "SUCCESS",
   "payment": {
     "merchant_payment_code":"ABC",
     "status":"OP",
     "open_date":"2011-05-01 13:40:01",
     "amount_br":182,
     "amount_ext":100,
     "currency_ext":"USD",
     "due_date":"2011-05-09",
     "hash":"1998bff11bf7b3185e8f2af113ee3fb1fa4c9",
     "payment_type_code":"itau"
   },
   "redirect_url": "https://api.ebanxpay.com/ws/?hash=1998bff11bf7b3185e8f2af113ee3fb1fa4c9"
 }

You should pass your store’s payment ID or order ID as merchant_payment_code. EBANX will save the relation between the hash and the merchant payment code for further reference. It is recommended that you do the same after receiving the hash from the EBANX server.

The other important parameter is the redirect_url. After getting the response from request, you have to redirect the customer to the URL.

  • Redirecting the customer to the EBANX Checkout pages

     

https://api.ebanxpay.com/ws/?hash=1998bff11bf7b3185e8f2af113ee3fb1fa4c9

On the following pages that the customer will see, he will enter all the payment details, like CPF (Brazilian residents registration number), name and address. After the customer is done, he will be redirected to your store’s website.

  • Calling query via https get after customer return to store

When the customer returns to your store’s site you must query EBANX for the payment status. This is done making a server-to-server call using the query service. You will receive the hash as get parameter when the customer returns to your store.

https://api.ebanxpay.com/ws/query?  integration_key=YOUR_KEY  &hash=1998bff11bf7b3185e8f2af113ee3fb1fa4c9

The EBANX server will send a JSON object as response, including the payment status:

{
   "payment": {
     "merchant_payment_code":"27",
     "status":"CO",
     "open_date":"2011-03-20 16:14:57",
     "confirm_date":"2011-03-20 06:15:00",
     "receive_date":null,
     "transfer_date":null,
     "amount_br":"182.00",
     "amount_ext":"100.00",
     "currency_ext":"USD",
     "due_date":"2011-03-09",
     "hash":"1cd3ea04dd17c14a0b5d329e2557d8a73cc9",
     "payment_type_code":"itau"
   },
   "status":"SUCCESS"
 }

In this case the payment has the status “CO”, which means it is confirmed and you process with shipping the goods.

Please see this table for possible payment status:

Code Status Description
OP Open The payment was recently opened.
PE Pending The customer has already completed the checkout process and the payment is waiting to be cleared.
CO Confirmed The payment is confirmed
CA Canceled The payment was canceled. This usually happens when the customer did not complete checkout.

Note: If the customer has chosen Boleto Bancário as payment method he will get the Boleto from EBANX by e-mail, but you can also choose to display it to the customer on your checkout confirmation page.