Online Debit
Online Debit with EBANX offers a secure, real-time payment solution that allows customers to complete transactions directly through their online banking. When using Online Debit, customers are seamlessly redirected from your platform to their bank’s website, where all payment details are pre-filled, enabling a fast and safe checkout experience. This integration is especially popular in Latin America, as it provides a familiar and trusted method for consumers to pay directly from their bank accounts.
Requirements
- API credentials - Ensure you have your EBANX integration key. If not, complete the Merchant Signup Form.
- Familiarity with EBANX Direct - This setup follows the same general structure as other payment methods, with a few unique parameters.
How it works
- Define payment parameters - Collect essential details, such as amount, currency, and customer information.
- Request redirection link - Call the
ws/request
endpoint with required fields to generate the Online Debit redirection link. - Redirect customer - Use the
payment.redirect_url
to send customers to their online banking environment to complete the payment. - Listen for notifications - Receive payment status updates from EBANX.
- Confirm payment - Check the status for completed payments.
Instructions
Follow the steps below.
Select your environment
Select the appropriate environment for your integration. Use the sandbox environment for testing, or the production environment for live transactions. Use the URL for your HTTP requests based on your selection.
https://sandbox.ebanx.com/ws/directDefine your parameters
With Online Debit, customers are redirected to their online banking site, where they can complete the payment securely and quickly. To obtain this redirection link, call the ws/direct endpoint with the required fields:
Basic parameters:
Parameter Description operation
Set to request
integration_key
Your EBANX integration key payment_type_code
Set to banrisul
,bradesco
,bancodobrasil
, oritau
country
Set to br
for Brazil.Customer data:
Parameter Description name
Customer name email
Customer e-mail document
Customer document address
Customer address street_number
Customer street number city
Customer city state
Customer state zipcode
Customer zip code phone_number
Customer phone number Charge parameters:
Parameter Description merchant_payment_code
Unique merchant payment code currency_code
Supported values: BRL
andUSD
amount_total
Total amount to be charged due_date
Expiration date: dd/mm/yyyy
(optional)The due date Can be more than 3 days only when payment currency is
BRL
(Brazilian Real). The due date is based on the local time of the country that the payment was generated.Sample request
Use the following example to initiate a request.
curl -X POST \
--location 'https://sandbox.ebanx.com/ws/direct' \
--header 'Content-Type: application/json' \
--data '{
"integration_key": "your_ebanx_integration_key",
"operation": "request",
"payment": {
"name": "José Silva",
"email": "jose@example.com",
"document": "853.513.468-93",
"address": "Rua E",
"street_number": "1040",
"city": "Maracanaú",
"state": "CE",
"zipcode": "61919-230",
"country": "BR",
"phone_number": "8522847035",
"payment_type_code": "itau",
"merchant_payment_code": "0x0W2ver6D04-T03",
"due_date": "08/12/2024", // Optional
"currency_code": "BRL", // BRL or USD
"amount_total": 100
}
}'Sample response
A successful request returns a response like the example below, with the bank redirect link provided in the payment.redirect_url parameter.
{
"redirect_url": "https:\/\/sandbox.ebanxpay.com\/ws\/directtefredirect\/?hash=67536ed495cefb0683e26cd0492a06280d68cf7be9a97a00",
"payment": {
"hash": "67536ed495cefb0683e26cd0492a06280d68cf7be9a97a00",
"country": "br",
"merchant_payment_code": "0x0W2ver6D04-T03",
"order_number": null,
"status": "PE",
"status_date": null,
"open_date": "2024-12-06 21:38:28",
"confirm_date": null,
"transfer_date": null,
"amount_br": "100.38",
"amount_ext": "100.00",
"amount_iof": "0.38",
"currency_rate": "1.0000",
"currency_ext": "BRL",
"due_date": "2024-12-08",
"instalments": "1",
"payment_type_code": "itau",
"redirect_url": "https:\/\/sandbox.ebanxpay.com\/ws\/directtefredirect\/?hash=67536ed495cefb0683e26cd0492a06280d68cf7be9a97a00",
"pre_approved": false,
"capture_available": null
},
"status": "SUCCESS"
}At this stage, the payment will appear as pending (PE) in yourEBANX Dashboardchevron_rightRedirect customer to the returned URL
Redirect your customer to the URL provided in the redirect_url parameter. Once redirected, they will enter their online banking environment, where all purchase details are pre-filled, allowing them to complete their payment securely and conveniently.
Testing online debits in a sandbox environment
In our Sandbox environment, we provide an Online-Banking simulation interface to test bank transfer payments. This mock interface allows you to simulate different payment outcomes:
- Simulate Authorized = YES: Confirms the payment as successful.
- Simulate Authorized = NO: Denies the payment.
- Leave Pending: Leaves the payment in a pending state.
This simulation mimics the real production flow, where users are redirected to their Internet Banking to complete transactions, enabling you to thoroughly test authorized and unauthorized payments.
Monitor payment for status changes
Notifications
EBANX will send a notification whenever a payment status changes.
Make sure your system is set up to receive notifications from EBANX for any changes in payment status.
Status
After receiving a notification, retrieve the payment status.
When a payment is confirmed, the status will change from pending (PE) to confirmed (CO). If the customer does not complete the payment, the status will eventually change to cancelled (CA).
Congratulations!
You have succesfully integrated Online Debit.
For more information, refer to theDirect API reference guidechevron_right
Resources
Use the following resources when testing in your sandbox environment.
Sample Cards
Click here to view mock card data to validate your payment integration.
API Reference
Click here to access detailed API documentation to integrate efficiently.
Mock Customer Data
Click here to view mock customer data for testing and validating user flows.
Error Codes
Click here to review common error codes to troubleshoot and resolve issues quickly.
Still need help?
We hope this article was helpful. If you still have questions, you can explore the following options:
- Merchant support: Contact our support team at sales.engineering@ebanx.com for assistance.
- Not a partner yet? Please complete the Merchant Signup Form, and our commercial team will reach out to you.