Skip to content

/pix-automatico/cashin/cancel Cancel Debit Order ​

Background ​

Cancels a debit order that has not yet been debited.

  • For a debit order whose debit instruction has not yet reached the payer's bank, the cancellation takes effect immediately: orderStatus is CANCELLED and cancellation.status is SUCCESS; the payer will not receive a reminder for that debit.
  • For a debit order whose debit instruction has already reached the payer's bank, the cancellation is processed asynchronously: orderStatus changes only after the cancellation takes effect, and the processing progress is shown in cancellation.status:
StageorderStatuscancellation.status
Accepted by this endpointUnchanged (PENDING or SCHEDULED)PENDING
Cancellation takes effectCANCELLEDSUCCESS
Cancellation rejectedUnchangedFAILED

Confirm the result through Get Debit Order Details; see Cancellation Request.

Note

cancellation.status being PENDING does not mean the cancellation succeeded; what counts is orderStatus becoming CANCELLED. A debit order whose cancellation was rejected (FAILED) keeps its original status and will be debited as scheduled on the debit date; if you still need to cancel it, submit the request again before the deadline. We recommend cancelling as early as possible to leave time to resubmit.

Cancelling a debit order does not affect the debit authorization; debit orders can still be created normally for later periods. To stop all later debits, cancel the authorization.

Endpoint ​

ItemValue
MethodPOST
Path/pix-automatico/cashin/cancel
Content-Typeapplication/json
PurposeCancel a debit order that has not yet been debited

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.

FieldLocationTypeLengthRequiredDescription
platOrderNoBodystring64YesPlatform order number of the debit order to cancel.
cancellationReasonBodystring32NoCancellation reason; for the values see the overview enum summary. Defaults to RECEIVER_USER_REQUESTED when omitted.

Cancellable States and Deadlines ​

  • The payee can cancel a debit order whose orderStatus is PENDING or SCHEDULED; the deadline is 22:00 (America/Sao_Paulo) on the day before the debit date (scheduledDate).
  • The payer can cancel that debit at their bank until 23:59 (America/Sao_Paulo) on the day before the debit date; after such a cancellation, the debit order's cancellation.reason is PAYER_USER_REQUESTED.

Rules ​

  • Cancelling a debit order does not create an order, so the request does not need to carry mchOrderNo; the debit order to cancel is identified by platOrderNo, and a repeated cancellation returns a state conflict according to the rules below.
  • A first payment (cashinType is QRCODE) is paid by the payer scanning the code and is not a scheduled debit, so it cannot be cancelled through this endpoint; a validation failure is returned.
  • A debit order that is already cancelled (orderStatus is CANCELLED) or has a cancellation request in progress (cancellation.status is PENDING) returns a state conflict.
  • If the previous cancellation was rejected (cancellation.status is FAILED), it can be submitted again within the deadline, and cancellation is updated to this request.
  • Beyond the above deadline, a state conflict is returned (the debit order cancellation deadline has passed).

Request Example ​

Request header example:

http
POST /pix-automatico/cashin/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
{
  "platOrderNo": "PAC202610250000000001"
}

Response Fields ​

The endpoint uses the standard status, msg, and data response envelope. A debit order whose debit instruction has not yet reached the payer's bank becomes CANCELLED immediately after cancellation; for a debit order whose instruction has already reached the bank, orderStatus stays unchanged after acceptance and cancellation.status is PENDING, so confirm through Get Debit Order Details that orderStatus becomes 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.platOrderNostring64YesPlatform order number of the debit order.
data.orderStatusstring16YesDebit result status; CANCELLED for an immediate cancellation, otherwise it stays at its pre-acceptance value of PENDING or SCHEDULED; for the values see Get Debit Order Details.
data.cancellationobjectN/AYesThis cancellation request and its processing progress; see Cancellation Request.
data.cancellation.statusstring16YesCancellation request status: SUCCESS for an immediate cancellation, otherwise PENDING.
data.cancellation.reasonstring32YesCancellation reason; for the values see the overview enum summary.
data.cancellation.requestedAtint19YesTime the cancellation request was accepted, Unix timestamp in seconds.
data.cancellation.cancelledAtint19NoTime the cancellation took effect, Unix timestamp in seconds; null when cancellation.status is not SUCCESS.

Response Examples ​

Example 1: Debit instruction has not yet reached the bank; cancelled immediately

json
{
  "status": 200,
  "msg": "sucesso",
  "data": {
    "platOrderNo": "PAC202610250000000001",
    "orderStatus": "CANCELLED",
    "cancellation": {
      "status": "SUCCESS",
      "reason": "RECEIVER_USER_REQUESTED",
      "requestedAt": 1792929900,
      "cancelledAt": 1792929900
    }
  }
}

Example 2: Debit instruction has reached the bank; cancellation in progress

After the cancellation is accepted, orderStatus stays SCHEDULED and cancellation.status is PENDING; after the cancellation takes effect, orderStatus becomes CANCELLED and cancellation.status becomes SUCCESS.

json
{
  "status": 200,
  "msg": "sucesso",
  "data": {
    "platOrderNo": "PAC202610250000000001",
    "orderStatus": "SCHEDULED",
    "cancellation": {
      "status": "PENDING",
      "reason": "RECEIVER_USER_REQUESTED",
      "requestedAt": 1793372400,
      "cancelledAt": null
    }
  }
}

Response Error Codes ​


Back to Pix Subscription Overview