This page's content:
What is a Direct API
The Direct API of EBANX is the transparent checkout (with no redirect) solution that allows you to accept payments by all payment methods and countries directly on your domain.
Your customers will benefit from a smoother user experience as they can complete the checkout without the need to leave the store’s front end.
There are some requirements to follow before making the integration that you can learn here.
1. Using EBANX Direct
The use of Direct API needs to be implemented in the store’s checkout process. After the customer has verified the shopping cart and provided his personal & shipping information, he should input the data to conclude the payment. Afterward, you can show a confirmation page according to the payment status.
For some payment methods the status may change, and you will receive status change notifications from our server. You will also see the following sections how this can be done.
Please see the diagram below for full mode:
See the following example to have an idea of how it works under the hood.
2. Payment request via HTTP POST
Your store’s web server makes a server-to-server call to the EBANX server. The given example includes the minimum number of parameters needed for a boleto request. Please see the Direct API Reference for further settings and details. For more details about how to create a payment using different payment methods from all countries that EBANX supports, click here.
Please note the JSON expression needs to be included in a parameter called request_body. Also, you should pass your store’s payment id or order id as merchant_payment_code. EBANX will save the relationship between the hash and the merchant payment code for further reference. We recommend that you do the same after receiving the confirmation from the EBANX server.
The EBANX server will send a JSON object as a response, including the payment status:
In case of a failure the response will look like this:
3. Asynchronous Notifications
When a payment status is changed, EBANX sends a notification to your system through the Notification URL that you have set in your Dashboard. Your system receives the notification then call our Query Operation. By doing this, you will know the status and more information about that payment.
After you get the notification, you must output a response (it can be any string that you like) indicating that the notification was successful. You can check your notifications in the Notification Log in your Dashboard.
Notifications are important since they indicate when you can deliver your product/service to your customer.
For more detailed and technical information check out our documentation HERE.