This page's content:

How does EBANX Pay JS works?

Customer Data

The customer will inform their creditcard data through your store page. This data will be used by EBANX to generate a token.

Using LIB js, the request will be made directly from customer’s browser to EBANX server. Meaning that customer’s credit card information will not be stored in Merchant’s server.

Request Token

A request will be made from customer’s browser to EBANX server, sending the customer creditcard data to generate a token that represents the customer credit card information. The token will be returned to the customer to continue the request.

Request Payment

Once the token is received, the form with the payment details will be submitted to our API, which will create the payment.

The diagram below show the flow of the operation.


Why use EBANX Pay JS

One of the main reasons to use EBANX Pay JS is that you don’t have to worry about storing and securing cardholder data.

According to PCI DSS requirements, you must restrict access and protect stored cardholder data.

Through EBANX Pay JS, the customer will inform their creditcard data and our servers will generate a token for this creditcard, so you don’t have to store any sensitive data. This token will be used for the whole request.

How to use EBANX Pay JS


Add this script to your page:

<script type="text/javascript" src=""></script>


EBANX.config.setMode('test'); // Set mode. production/test
EBANX.config.setPublishableKey('put your key here'); // Set your Publishable key. To identify your site to EBANX API you must start by providing your [publishable key]
EBANX.config.setCountry('br'); // Set your checkout country (see:


The following is an example of action to create a single use token, used to pass credit-card information to your server in a safe way.

var createTokenCallback = function(ebanxResponse) {
if ('status')) {
document.getElementById('status').textContent = 'Success, the token is: ' +;
} else {
var errorMessage = ebanxResponse.error.err.status_message || ebanxResponse.error.err.message;
document.getElementById('status').textContent = 'Error ' + errorMessage;

card_number: document.getElementById('card-number').value,
card_name: document.getElementById('card-name').value,
card_due_date: document.getElementById('card-due-date').value,
card_cvv: document.getElementById('card-cvv').value
}, createTokenCallback);


If you have any doubts or need help, you can send and email to: EBANX Integration