Pix Automático Fixed Enrollments
Pix Automático works by establishing an authorization, achieved through an enrollment process, between merchant and customer, and referencing it in every recurring payment. This way, the customer's bank can validate the payment against the enrollment and transfer funds without the need for customer interaction, given that they know the payment request has been validated and comes from a valid source.

The simplest form of Pix Automático enrollments are fixed subscriptions, where the price stays fixed and changes are made only via new agreements with the customer, usually after a predetermined period of time.
By following this basic integration guide, you will understand how you can create enrollments and accept Pix Automático recurring payments in your check-out, by using EBANX Direct API. To complete a payment with Pix Automático you will need a few API calls that will create an enrollment for your customer, the recurring payment and provide the necessary information for the customer to complete the transaction.
Requirements
- EBANX Sandbox Account - Provides a test environment where you can explore our payment solutions.
- Sign up for an EBANX Sandbox Account.
- Complete the online form.
- Our team will reach out to you shortly.
- API credentials - Ensure you have your EBANX integration key. If not, complete the Merchant Signup Form.
Instructions
To complete a Pix Automático enrollment and recurring payments, please follow the steps below.
Call the /ws/userenrollment API to get the Enrollment QR Code
Pix Automático generates a QR Code, which is scanned by the user in their banking app of choice. To get this, you just need to call the end-point
ws/userenrollment(server-side) with the following required fields:Basic parameters
Parameter Requirement Description integration_keyRequired Your integration key payment_type_codeRequired Must be pix-automaticooperationRequired Must be enrollmentexpiration_time_in_secondsOptional QR code expires based on the duration specified in this parameter or the default set by EBANX (24 hours). The time must be specified in seconds. Enrollment data
Parameter Requirement Description countryRequired Must be BRemailRequired Customer e-mail nameRequired Customer name documentRequired Customer document merchant_enrollment_codeRequired Unique enrollment code subscription_nameRequired Descriptor of the service being provided, which will be displayed in the customer's banking app expiration_dateOptional If necessary, defines when the enrollment is no longer valid and no further payments will be charged frequencyRequired The billing cycle of the enrollment.
Available frequencies are:weekly,monthly,quarterly,halfyearly,yearlyretryRequired Determines whether the merchant will retry payments that fail on the expect billing day.
The available retry policies are:not_allowedfor no additional attempts orallow_3R_7Dfor up to three retries within seven days after the first paymentfixed_amountRequired Provided when recurring payments will have a fixed value. For variable enrollments, use max_amount_floorinsteadstart_dateRequired Day when the payment that initiates the subscription will be charged Sample request
curl -X POST 'https://sandbox.ebanx.com/ws/userenrollment' \
--header 'Content-Type: application/json' \
--data '{
{
"integration_key": "{{integration_key}}",
"payment_type_code": "pix-automatico",
"operation": "enrollment",
"expiration_time_in_seconds": 3600,
"enrollment": {
"country": "BR",
"email": "{{customer_email}}",
"name": "{{customer_name}}",
"document": "{{customer_document}}",
"merchant_enrollment_code": "{{unique_enrollment_code}}",
"subscription": {
"subscription_name": "Descriptor of the subscription.",
"expiration_date": "2025-12-30",
"frequency": "monthly",
"retry": "allow_3R_7D",
"fixed_amount": 19.90,
"start_date": "2024-12-15"
}
}'A successful request will return a JSON response like the one below. The Pix Automático raw QR Code value will be in the parameter
qr_code_value.You can also use the
redirect_urlto redirect your customer to an external page to display the Pix Automatico voucher and QR code. In Sandbox environment, you will find in theredirect_urlthe link to use our Simulator.{
"status": "SUCCESS",
"redirect_url": "https://sandbox.ebanx.com/ewallet/recurrency-agreement?return_url=https%3A%2F%2Fsandbox.ebanx.com%2Fws%2Fcustomerenrollment-finish%2Ffake%3Fenrollment%3DMTYwOTA6bXktZW5yb2xsbWVudC0zMzA%253D&enrollment_uuid=PpKBQFh3wwa4agh9e",
"enrollment": {
"merchant_enrollment_code": "{{unique_enrollment_code}}",
"country": "BR",
"name": "{{customer_name}}",
"email": "{{customer_email}}",
"subscription": {
"subscription_name": "Descriptor of the subscription.",
"start_date": "2024-12-15",
"expiration_date": "2025-12-30",
"frequency": "monthly",
"retry": "allow_3R_7D",
"fixed_amount": "19.90",
"qr_code_value": "00020101021226780014br.gov.bcb.pix2556fake-pix.com.br/qr/v2/ACA4311F88661BC0D48200487EF1BCD95204000053039865802BR5910FAKEPIX Ltda6008CURITIBA62070503***36923"
}
}
}Presenting the Pix QR Code
You can present the QR code by rendering the code at your page.
Copying QR Code to ClipboardAlternatively, you can simply deliver the QR Code number from
qr_code_valueto your customer's clipboard so they can paste it into their banking/wallet app.At this point you have a
pendingenrollment and will be notified via webhook when there is a status change.Confirming the Enrollment
As soon as the enrollment is confirmed by the customer in their banking app, the enrollment status is modified from
pedingtoacceptedand a Status Update notification is sent to the URL defined in your merchant configuration.{
"operation":"enrollment_status_change",
"notification_type":"update",
"merchant_enrollment_code":"{{unique_enrollment_code}}"
}Using the ID provided in
merchant_enrollment_code, use the/ws/userenrollments/queryendpoint to get the latest status of the enrollment.Check the example:
curl -X POST 'https://sandbox.ebanx.com/ws/userenrollments/query' \
--header 'Content-Type: application/json' \
--data '{
"integration_key": "{{integration_key}}",
"enrollment": {
"merchant_enrollment_code": "{{unique_enrollment_code}}"
}
}'A successful request will return a JSON response like the one below, with a status of
acceptedfor the enrollment approved by the customer. Other possible enrollment statuses includenot accepted,pending,expired,not_foundandrevoked, depending on the actions taken by the merchant or customer.{
"status": "SUCCESS",
"payment_type": "pix-automatico",
"enrollment": {
"status": "accepted",
"email": "",
"spi_code": "RR2101818220250811jYwwlNucP9A"
},
"subscription": {
"subscription_name": "Descriptor of the subscription",
"start_date": "2024-12-15",
"expiration_date": "2025-12-30",
"frequency": "monthly",
"retry": "allow_3R_7D",
"fixed_amount": "19.90"
}
}Important:Pending enrollments expire by default after 24 hours. If the customer does not complete the process in time, the enrollment will be marked as expired. You can override this behavior by setting the field
expiration_time_in_seconds, which defines the QR code expiration time for each request.Call the /ws/direct API to schedule the Pix Automático payment
ImportantThe recurring payment request must be sent between 2 and 10 days before the next billing day. For example, if a payment is due on January 17th, the payment request must be sent no earlier than January 7th and no later than January 15th.
Scheduling a recurring payment with Pix Automático is really straightforward. The following fields will be required:
Parameter Requirement Description merchant_payment_codeRequired Unique merchant payment code amount_totalRequired Total amount to be charged. Note that the amount must match the one set in the enrollment currency_codeRequired Must be BRLcountryRequired Must be BRpayment_type_codeRequired Must be pix-automaticoemailRequired Customer e-mail nameRequired Customer name documentRequired Customer document due_dateRequired Expected billing date (DD/MM/YYYY) - it must be between 2 and 10 days after the current date merchant_enrollment_codeRequired The enrollment code generated in the previous steps. The enrollment must have a acceptedstatus to be used in recurring paymentsCheck the example:
curl -X POST 'https://sandbox.ebanx.com/ws/direct' \
--header 'Content-Type: application/json' \
--data '{
"integration_key": "{{integration_key}}",
"payment": {
"merchant_payment_code": {{merchant_payment_code}},
"amount_total": 19.90,
"currency_code": "BRL",
"country": "BR",
"payment_type_code": "pix-automatico",
"email": "{{customer_email}}",
"name": "{{customer_name}}",
"document": "{{customer_document}}",
"due_date": "17/01/2024",
"enrollment": {
"merchant_enrollment_code": "{{merchant_enrollment_code}}"
}
}
}'A successful request will return a JSON response like the one below. The Pix Automático payment will have a pending (
PE) status and will be confirmed later by the customer's bank.{
"payment": {
"hash": "{{unique_payment_hash}}",
"country": "BR",
"merchant_payment_code": "{{unique_payment_code}}",
"status": "PE",
"status_date": "2024-01-17 21:11:36",
"open_date": "2024-01-10 13:00:00",
"confirm_date": null,
"transfer_date": null,
"amount_br": "19.90",
"amount_ext": "19.90",
"amount_iof": "0.00",
"currency_rate": "1.0000",
"currency_ext": "BRL",
"due_date": "2024-01-17",
"payment_type_code": "pix-automatico",
"redirect_url": "https://sandbox.ebanx.com/ws/redirect?hash=683f3c53c065aab9b5151a38cd6b717e29df06dcb60cbb3c",
"pre_approved": false,
"enrollment": {
"status": "accepted",
"merchant_enrollment_code": "{{unique_enrollment_code}}",
},
"subscription": {
"subscription_name": "Descriptor of the subscription",
"start_date": "2024-12-15",
"expiration_date": "2025-12-30",
"frequency": "monthly",
"retry": "allow_3R_7D",
"fixed_amount": "19.90"
},
"retries": {
"retry_status": "LOCKED",
"available_retries": 3,
"payment_attempts": [
{
"attempted_at": "2024-01-17 21:11:33",
"attempt_response": "PENDING"
}
]
}
},
"status": "SUCCESS"
}noteIn the Sandbox environment, the
redirect_urlin the response of your payment schedule will lead you to the payment Simulator, allowing you to reproduce multiple payment processing scenarios.Confirming the Payment
As soon as the payment is confirmed by the customer's bank, the payment status is modified from
PEtoCOand a Status Update notification is sent.{
"operation":"payment_status_change",
"notification_type":"update",
"merchant_payment_code":"{{unique_payment_code}}"
}Using the
hashprovided in the payment response, use the/ws/queryendpoint to get the latest status of the payment.Check the example:
curl -X POST 'https://sandbox.ebanx.com/ws/query' \
--header 'Content-Type: application/json' \
--data '{
"integration_key": "{{integration_key}}",
"hash": "{{unique_payment_hash}}"
}'A successful request will return a JSON response like the one below, with a status of
COfor the successful recurring payment.{
"payment": {
"hash": "{{unique_payment_hash}}",
"country": "BR",
"merchant_payment_code": "{{unique_payment_code}}",
"status": "CO",
"status_date": "2024-01-17 21:11:36",
"open_date": "2024-01-10 13:00:00",
"confirm_date": null,
"transfer_date": null,
"amount_br": "19.90",
"amount_ext": "19.90",
"amount_iof": "0.00",
"currency_rate": "1.0000",
"currency_ext": "BRL",
"due_date": "2024-01-17",
"payment_type_code": "pix-automatico",
"redirect_url": "https://sandbox.ebanx.com/ws/redirect?hash=683f3c53c065aab9b5151a38cd6b717e29df06dcb60cbb3c",
"pre_approved": false,
"transaction_status": {
"acquirer": "EBANX IP",
"code": "OK",
"description": "Recurring payment successfully paid",
"description_code": "ACCEPTED"
},
"enrollment": {
"status": "accepted",
"merchant_enrollment_code": "{{unique_enrollment_code}}",
},
"subscription": {
"subscription_name": "Descriptor of the subscription",
"start_date": "2024-12-15",
"expiration_date": "2025-12-30",
"frequency": "monthly",
"retry": "allow_3R_7D",
"fixed_amount": "19.90"
},
"retries": {
"retry_status": "ENDED",
"available_retries": 0,
"payment_attempts": [
{
"attempted_at": "2024-01-17 21:11:33",
"attempt_response": "CONFIRMED"
}
]
}
},
"status": "SUCCESS"
}Now, for each new billing cycle, simply repeat 5 and 6!
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 integration@ebanx.com for assistance.
- Not a partner yet? Please complete the Merchant Signup Form, and our commercial team will reach out to you.