Skip to content

/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.status is PENDING), no more debit orders can be created under this authorization.

The request must carry subMerchantNo to indicate the sub-merchant that the debit authorization belongs to.

Cancellation is processed asynchronously. The debit authorization status changes only after the cancellation takes effect, and the processing progress is in cancellation.status:

Stagestatuscancellation.status
Accepted by this APIStays APPROVEDPENDING
Cancellation takes effectCANCELLEDSUCCESS
Cancellation rejectedStays APPROVEDFAILED; 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_CANCELLED or AUTHORIZATION_CANCELLATION_FAILED. The payer can also cancel the authorization on their own in their bank app, in which case cancellation.reason is PAYER_USER_REQUESTED and AUTHORIZATION_CANCELLED 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 ​

ItemValue
MethodPOST
Path/pix-automatico/authorization/cancel
Content-Typeapplication/json
PurposeCancel an approved debit authorization

Authentication ​

Uses the common signature authentication (ES256 request signing); set X-Merchant-Id to the partner's primary merchant ID. See Authentication and Request Signing.

Request Fields ​

For authentication headers, see Authentication; they are not listed in the table below.

FieldLocationTypeLengthRequiredDescription
subMerchantNoBodystring64YesSub-merchant ID.
authorizationIdBodystring64YesID of the debit authorization to cancel, generated by Adopay and globally unique in the Adopay system.
cancellationReasonBodystring32NoCancellation reason; for values see the overview enum summary. Defaults to RECEIVER_USER_REQUESTED if omitted.

Rules ​

  • subMerchantNo must match the sub-merchant that the debit authorization belongs to; otherwise resource not found is returned.
  • Cancelling an authorization does not produce an order, so the request does not need to carry mchOrderNo; the debit authorization to cancel is identified by authorizationId, and repeated cancellation returns a state conflict according to the rules below.
  • Only a debit authorization whose status is APPROVED can be cancelled; otherwise a state conflict is returned.
  • If the debit authorization already has a cancellation request in progress (cancellation.status is PENDING), a state conflict is returned.
  • If the previous cancellation was rejected (cancellation.status is FAILED), cancellation can be requested again, and cancellation is updated to this request.

Request Example ​

Request header example:

http
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:

json
{
  "subMerchantNo": "SUB00000001",
  "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.status stays APPROVED and data.cancellation.status is PENDING; confirm through Get Authorization Details that status has become CANCELLED.

FieldTypeLengthReturnedDescription
statusint4YesResponse code
msgstring128YesMessage corresponding to status
dataobjectN/AOn successCancellation result; may be omitted when the request fails at signature verification or protocol parsing.
data.subMerchantNostring64YesSub-merchant ID, identical to subMerchantNo in the request.
data.authorizationIdstring64YesDebit authorization ID.
data.statusstring16YesDebit 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.cancellationobjectN/AYesThis cancellation request and its processing progress, see Cancellation Request.
data.cancellation.statusstring16YesCancellation request status; PENDING when the request is accepted.
data.cancellation.reasonstring32YesCancellation reason; for values see the overview enum summary.
data.cancellation.requestedAtint19YesTime the cancellation request was accepted, Unix timestamp in seconds.

Response Example ​

json
{
  "status": 200,
  "msg": "sucesso",
  "data": {
    "subMerchantNo": "SUB00000001",
    "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