Brazil Transactions
PIX
There are two types of PIX payments in Brazil: static and dynamic. First, it is important to understand that the PIX payment is only a shortcut for the bank account your customers have in Brazil.
Static PIX
For Static PIX payments, you will share your PIX key with the customer so they can make a payment using this key – usually it is an e-mail address or a random key (EVP). The customer will pay using their bank account and you will receive it in your account within Attrus. The customer can choose any amount to pay.
How to get your PIX key: The PIX key for your Attrus account is provided along with your API credentials during onboarding. You can also find it in the Bank Accounts section of the Attrus Portal.
Important requirements:
- The customer must be registered in your system before making the payment, so we can properly identify and reconcile the incoming funds
- For this type of payment, you don't need to create a transaction via API — as soon as we receive the payment, an automatic transaction will be created and you will receive an
identifiedwebhook notification
Example of sharing PIX key with your customer:
PIX Key (Email): [email protected]
PIX Key (EVP): e55eeo1d-01ef-016e-14d0-a1ea701ae17e
Once the customer pays using this PIX key, you will receive a webhook notification with the transaction details.
Dynamic PIX (QR Code)
curl -X POST "https://api.facilitapay.com/api/v1/transactions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...." \
-d '{
"transaction": {
"subject_id": "customer id",
"from_bank_account_id": "your physical BRL bank account id",
"to_bank_account_id": "the internal BRL cash in id",
"currency": "BRL",
"exchange_currency": "BRL",
"value": "1500.00",
"use_dynamic_pix": true,
"dynamic_pix_expires_at": "2025-05-08T08:30:44.074Z"
}
}'
For Dynamic PIX payments, you'll need to create a transaction with the transaction endpoint. This type of payment requires a fixed value to be paid, and an expiration date. You will request for the dynamic pix, and we will return with a code that you will transform into the QR Code to share with the customer. Unlike the static, the dynamic QR code is unique for each payer, expirable, and its amount cannot be changed once it's generated.
You will also get a payment_expired webhook if it's not paid within the expiration date. Besides the use_dynamic_pix flag, you'll also need to provide the expiration date in dynamic_pix_expires_at.
HTTP Request
POST /transactions
Body Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
transaction | An object containing all the required values | object | true |
subject_id | The ID generated when you registered you customer as one of your subjects | UUID | true |
from_bank_account_id | The ID of the BRL exclusive bank account that we opened for you | UUID | true |
to_bank_account_id | The destination bank account ID whose currency is equals to the exchange_currency field | UUID | true |
currency | Must be "BRL" for pix transactions | string | true |
exchange_currency | One of: BRL, USD or EUR | string | true |
use_dynamic_pix | Must be true for pix transactions. You don't need to send this field for other payment methods | boolean | true |
value | Amount you want to charge with two decimal places only, e.g.: "1500.00" | string | true |
dynamic_pix_expires_at | Future date at least more than 1 minute ahead of the current UTC date time. Format: YYYY-MM-DDThh:mm:ssZ | datetime | false |
Common Mistakes
Using an account without a registered pix key
Solution: You used an account that does not have a pix key registered on the portal. Contact our support team and share the request/response. We'll set up a pix account for you.
Providing an invalid date time format
Solution: You must provide the specified date time format. Check in the "Body Parameters" section above
Providing a past date
Solution: You must use a future date with more the 1 minute ahead of the current UTC date time
TED
The TED payment is a normal bank transfer. For this type of transaction, instead of sharing with the customer a PIX Key, you'll share the details of your bank account. The required information includes: Account Number, Account Branch, Beneficiary name, and Document Number.
Where to find your bank account details: You can find your Attrus bank account details in the Bank Accounts section of the Attrus Portal, under "Attrus Pay-in accounts". This information is also provided during onboarding along with your API credentials.
After sharing these details, the customer uses it to pay you the value they need to. For this type of payment, you don't need to create a transaction request, only have your customer registered, as soon as we receive the payment, an automatic transaction will be created.
Boleto
Boleto is a Brazilian payment method that generates a document containing a unique number and a barcode. It can be paid at banks, authorized retail stores, ATMs, or directly through the customer's banking app. You define the expiration date when generating the boleto. Once your customer makes the payment, confirmation can take up to 3 business days, as the settlement process is not instant. Paid or not, you will receive a webhook with the status change.
Please note that, due to regulatory requirements, the boleto must display the payer's full address. Therefore, the subject_id provided must be registered with all address_* fields. Additionally, both email and phone number are also mandatory.
After generating the boleto, three new variables will appear in the response:
url_pdf: an endpoint to download a full PDF;bar_code: A string that can be converted to an image, so it can be displayed to your customer - to be scanned later;digital_line: A string that can be displayed with the option to enable the customer to copy the boleto bar code and paste it into their bank app.
curl -X POST "https://api.facilitapay.com/api/v1/transactions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...." \
-d '{
"transaction": {
"currency": "BRL",
"exchange_currency": "USD",
"value": "400.00",
"from_boleto": {
"expire_at": "2023-08-30"
},
"to_bank_account_id": "your internal cash-in USD/BRL id",
"subject_id": "customer id"
}
}'
HTTP Request
POST /transactions
Body Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
transaction | An object containing all the required values | object | true |
currency | Source currency for the transaction (ISO 4217 format) | string | true |
exchange_currency | Currency to be exchanged (ISO 4217 format) | string | true |
value | Value to be exchanged (in the source currency) | string | true |
from_boleto | An object, containing the following parameters: | object | true |
from_boleto.expire_at | Expiration date of the boleto in the format YYYY-MM-DD | string | true |
to_bank_account_id | ID of the account you will send the funds after the boleto is paid | string | true |
subject_id | ID of your customer | string | true |
Boleto PDF Download
After receiving the response, retrieve the data.id field and use it in the following endpoint to download the boleto PDF. The API will return the PDF file directly as a binary response.
curl -X GET "https://api.facilitapay.com/api/v1/transactions/:id/boleto_pdf" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...."
HTTP Request
GET /transactions/:id/boleto_pdf
Path Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
id | The ID generated when a boleto transaction is created | string | true |
Checkout Page for cards
For Brazil we give the option to have a pre-built, hosted checkout page (HPP) for your customer pay with cards, if you don't wish to implement one yourself. Our system will generate a unique checkout URL and a corresponding checkout ID. You can share this checkout URL directly with your customers, allowing them to complete their payment through our secure payment page.
Once the payment is completed, we will notify you by sending a payment confirmation to your webhook endpoint along with the checkout ID, which can be used as a reference for tracking and managing the transaction within your system. The checkout URL will remain active until a payment is successfully processed, after that the checkout page will no longer be accessible.
If the payment attempt fails, we will also notify you via webhook. The checkout page will also remain active until a successful payment is made.
curl -X POST "https://api.facilitapay.com/api/v1/transactions/checkout" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...." \
-d '{
"subject_id": "customer id",
"value": "100.00",
"currency": "BRL",
"exchange_currency": "BRL",
"to_bank_account_id": "your cash-in internal account BRL or USD"
}'
HTTP Request
POST /transactions/checkout
Body Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
subject_id | ID of one of the partner's customer | string | true |
value | Transaction value with two decimal places in the original currency, e.g., 100.00 | string | true |
currency | Transaction currency (ISO 4217 format), e.g., BRL | string | true |
exchange_currency | Destination bank account currency. It can be the local currency (BRL), or international currencies (USD/EUR) | string | true |
to_bank_account_id | Id of the destination bank account. This bank account must have the same currency as the exchange_currency field | string | true |
Payout (BRL)
After registering your customer bank account with us, you will be able to pay them locally using the following endpoint. If you registered only the PIX key, we will be using it, if you registered the Bank details and PIX Key we will prioritize to pay via TED.
The payout transactions are initiated within your foreign currency cash-out account
curl -X POST "https://api.facilitapay.com/api/v1/transactions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...." \
-d '{
"transaction": {
"currency": "USD",
"exchange_currency": "BRL",
"value": "500.00",
"from_bank_account_id": "your USD/EUR cash-out internal account id",
"to_bank_account_id": "the id of your customer bank account",
"subject_id": "your customer id"
}
}'
HTTP Request
POST /transactions
Body Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
transaction | An object containing all the required values | object | true |
currency | Source currency for the transaction (ISO 4217 format) | string | true |
exchange_currency | Currency to be exchanged (ISO 4217 format) | string | true |
value | Value to be exchanged (in the source currency) | string | true |
from_bank_account_id | ID of your cash-out internal account | string | true |
to_bank_account_id | ID of your customer's bank account | string | true |
subject_id | ID of your customer | string | true |