/pix-automatico/authorization/cancel Cancel Authorization
Background
Cancels an approved (APPROVED) debit authorization, applicable to all sign-up methods. Once the cancellation request is accepted (cancellation. is PENDING), no more debit orders can be created under this authorization.
Cancellation is processed asynchronously. The debit authorization status changes only after the cancellation takes effect, and the processing progress is in cancellation.:
| Stage | status | cancellation. |
|---|---|---|
| Accepted by this API | Stays APPROVED | PENDING |
| Cancellation takes effect | CANCELLED | SUCCESS |
| Cancellation rejected | Stays APPROVED | FAILED; cancellation can be requested again |
Confirm the result through Get Authorization Details; see Cancellation Request.
When the cancellation takes effect or is rejected, Adopay pushes AUTHORIZATION_ or AUTHORIZATION_. The payer can also cancel the authorization on their own in their bank app, in which case cancellation. is PAYER_ and AUTHORIZATION_ is pushed as well; see Pix Automático Webhook. If no notification arrives, query periodically; see Status Tracking.
To cancel only a single scheduled debit order, use Cancel Debit Order.
Endpoint
| Item | Value |
|---|---|
| Method | POST |
| Path | /pix-automatico/authorization/cancel |
| Content-Type | application/json |
| Purpose | Cancel an approved debit authorization |
Authentication
Uses the common signature authentication (ES256 request signing). See Authentication and Request Signing.
Request Fields
For authentication headers, see Authentication; they are not listed in the table below.
| Field | Location | Type | Length | Required | Description |
|---|---|---|---|---|---|
authorizationId | Body | string | 64 | Yes | ID of the debit authorization to cancel, generated by Adopay and globally unique in the Adopay system. |
cancellation | Body | string | 32 | No | Cancellation reason; for values see the overview enum summary. Defaults to RECEIVER_ if omitted. |
Rules
- Cancelling an authorization does not produce an order, so the request does not need to carry
mchOrderNo; the debit authorization to cancel is identified byauthorizationId, and repeated cancellation returns a state conflict according to the rules below. - Only a debit authorization whose
statusisAPPROVEDcan be cancelled; otherwise a state conflict is returned. - If the debit authorization already has a cancellation request in progress (
cancellation.isstatus PENDING), a state conflict is returned. - If the previous cancellation was rejected (
cancellation.isstatus FAILED), cancellation can be requested again, andcancellationis updated to this request.
Request Example
Request header example:
POST /pix-automatico/authorization/cancel HTTP/1.1
Content-Type: application/json
X-Merchant-Id: 2492265300
X-Timestamp: 1787011200
X-Nonce: a9f3c1d47e8b9a2c4d1f9e8a7b6c5d4e
Digest: SHA-256=<Base64 digest>
Authorization: Signature keyId="v1",alg="ES256",headers="(request-target) x-timestamp x-nonce digest",signature="<ES256_SIGNATURE_BASE64>"Request body example:
{
"authorizationId": "0f8c1f3e-5b7a-4c0e-9a55-2d3b1a9c7e10"
}Response Fields
The API uses the standard status, msg, and data response structure. When the request is accepted, data. stays APPROVED and data. is PENDING; confirm through Get Authorization Details that status has become CANCELLED.
| Field | Type | Length | Returned | Description |
|---|---|---|---|---|
status | int | 4 | Yes | Response code |
msg | string | 128 | Yes | Message corresponding to status |
data | object | N/A | On success | Cancellation result; may be omitted when the request fails at signature verification or protocol parsing. |
data. | string | 64 | Yes | Debit authorization ID. |
data. | string | 16 | Yes | Debit authorization status; stays APPROVED when the request is accepted and becomes CANCELLED only after the cancellation takes effect; for values see Get Authorization Details. |
data. | object | N/A | Yes | This cancellation request and its processing progress, see Cancellation Request. |
data. | string | 16 | Yes | Cancellation request status; PENDING when the request is accepted. |
data. | string | 32 | Yes | Cancellation reason; for values see the overview enum summary. |
data. | int | 19 | Yes | Time the cancellation request was accepted, Unix timestamp in seconds. |
Response Example
{
"status": 200,
"msg": "sucesso",
"data": {
"authorizationId": "0f8c1f3e-5b7a-4c0e-9a55-2d3b1a9c7e10",
"status": "APPROVED",
"cancellation": {
"status": "PENDING",
"reason": "RECEIVER_USER_REQUESTED",
"requestedAt": 1795168800
}
}
}Response Error Codes
Back to Pix Subscription Overview