Cancelling Pix Automático Enrollments
Requirements
- API credentials - Ensure you have your EBANX integration key. If not, complete the Merchant Signup Form.
Instructions
Follow the steps below.
- Ensure enrollment status is Pending or Accepted- You can only cancel an enrollment if its - statusis equal to pending or accepted. You can check the status of your enrollment using the end-point- /ws/userenrollments/queryreferencing to its- merchant_enrollment_code.- 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 shown below. Enrollments with a status of - acceptedor- pendingare eligible for cancellation. Other possible enrollment statuses include- not_accepted,- expired,- not_found, and- revoked, none of which can be cancelled- {
 "status": "SUCCESS",
 "payment_type": "pix-automatico",
 "enrollment": {
 "status": "accepted",
 "email": "",
 "spi_code": "RR2101818220250811jYwwlNucP9A"
 },
 "subscription": {
 "subscription_name": "Descriptor of the subscription",
 "start_date": "2025-08-13",
 "expiration_date": null,
 "frequency": "weekly",
 "retry": "allow_3R_7D",
 "fixed_amount": "10.00"
 },
 "payer": {
 "bank_name": "PAYER BANK NAME",
 "bank_ispb": 12345678,
 "agency_number": "100",
 "account_number": "12345678",
 "document": "146***89",
 "fingerprint": "8CJLxYtVmFshkDh60pLrRAaJ9uWCCoaPOd+C6rvShJ4="
 },
 "customer": {
 "email": "customer@ebanx.com",
 "name": "DEBTOR FULL NAME",
 "document": "123***01",
 "fingerprint": "Ce4LdDtVmFshkDh60pLrRAaJ9uWCCoaPOd+C6rvShJ47"
 }
 }
- Cancel the enrollment- To cancel an enrollment, you just need to call the end-point - /ws/userenrollment(from your server) with the following required fields:- Parameter - Requirement - Description - integration_key- Required - Your unique and secret integration key - operation- Required - Must be - cancel- Enrollment data:- Parameter - Requirement - Description - country- Required - Must be - BR- merchant_enrollment_code- Required - The unique enrollment identifier - Please, check the example below: - curl -X POST 'https://sandbox.ebanx.com/ws/userenrollment' \
 --header 'Content-Type: application/json' \
 --data '{
 "integration_key": "{{integration_key}}",
 "operation": "cancel",
 "enrollment": {
 "country": "BR",
 "merchant_enrollment_code": "{{merchant_enrollment_code}}"
 }
 }'- A successful request will return a JSON response similar to the one below Note the - status_dateand- reason_codefor audit trail details.- {
 "status": "SUCCESS",
 "enrollment": {
 "status": "revoked"
 }
 }
- Handling Scheduled Payments- When an enrollment is cancelled, any scheduled payment will also be cancelled, unless the payment is set for the following day and the cancellation request is made after 10 PM BRT. Important- According to the payment method rules established by the Brazilian Central Bank, if an enrollment is cancelled between 10:00 PM BRT and 11:59 PM BRT, payments scheduled for the following day will still be processed as usual. - As soon as the payment is canceled by the customer's bank, the payment status is modified from - PEto- CAand a Status Update notification is sent.- {
 "operation":"payment_status_change",
 "notification_type":"update",
 "merchant_payment_code":"{{unique_payment_code}}"
 }- Referencing the payment - hash, 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 - CAfor the recurring payment and the details of the cancellation inside the- transaction_statusnode.- {
 "payment": {
 "hash": "6834b47584a89429eda5c9272f741c54ce0f6c5921caaaa",
 "country": "br",
 "merchant_payment_code": "1748284533",
 "order_number": null,
 "status": "CA",
 "status_date": "2025-05-27 21:35:33",
 "open_date": "2025-05-26 18:35:33",
 "confirm_date": null,
 "transfer_date": null,
 "amount_br": "10.00",
 "amount_ext": "10.00",
 "amount_iof": "0.00",
 "currency_rate": "1.0000",
 "currency_ext": "BRL",
 "due_date": "2025-05-28",
 "instalments": "1",
 "payment_type_code": "pix-automatico",
 "redirect_url": "https://sandbox.ebanx.com/ws/redirect?hash=6834b47584a89429eda5c9272f741c54ce0f6c5921aaaaa",
 "pre_approved": false,
 "capture_available": null,
 "transaction_status": {
 "acquirer": "EBANX IP",
 "code": "NOK",
 "description": "Payment cancellation requested by the user",
 "description_code": "ENROLLMENT_CANCELLED",
 },
 "enrollment": {
 "status": "revoked",
 "merchant_enrollment_code": "123456789"
 },
 "subscription": {
 "subscription_name": "Descriptor of the subscription",
 "start_date": "2025-08-13",
 "expiration_date": null,
 "frequency": "weekly",
 "retry": "allow_3R_7D",
 "fixed_amount": "10.00"
 },
 "retries": {
 "retry_status": "ENDED",
 "available_retries": 0,
 "payment_attempts": [
 {
 "attempted_at": "2025-05-28 18:35:33",
 "attempt_response": "FAILED"
 }
 ]
 }
 },
 "status": "SUCCESS"
 }
- Congratulations!- You have succesfully Cancelled a Pix Automático Enrollments. For more information, refer to theDirect API reference guidechevron_right
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.