/pix-automatico/cashin/cancel Cancel Debit Order
Background
Cancels a debit order that has not yet been debited.
The request must carry subMerchantNo to indicate the sub-merchant that the debit order belongs to.
- For a debit order whose debit instruction has not yet reached the payer's bank, the cancellation takes effect immediately:
orderStatusisCANCELLEDandcancellation.isstatus 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:
orderStatuschanges only after the cancellation takes effect, and the processing progress is shown incancellation.:status
| Stage | orderStatus | cancellation. |
|---|---|---|
| Accepted by this endpoint | Unchanged (PENDING or SCHEDULED) | PENDING |
| Cancellation takes effect | CANCELLED | SUCCESS |
| Cancellation rejected | Unchanged | FAILED |
Confirm the result through Get Debit Order Details; see Cancellation Request.
Note
cancellation. 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
| Item | Value |
|---|---|
| Method | POST |
| Path | /pix-automatico/cashin/cancel |
| Content-Type | application/json |
| Purpose | Cancel a debit order that has not yet been debited |
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.
| Field | Location | Type | Length | Required | Description |
|---|---|---|---|---|---|
subMerchantNo | Body | string | 64 | Yes | Sub-merchant ID. |
platOrderNo | Body | string | 64 | Yes | Platform order number of the debit order to cancel. |
cancellation | Body | string | 32 | No | Cancellation reason; for the values see the overview enum summary. Defaults to RECEIVER_ when omitted. |
Cancellable States and Deadlines
- The payee can cancel a debit order whose
orderStatusisPENDINGorSCHEDULED; 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.isreason PAYER_.USER_ REQUESTED
Rules
subMerchantNomust match the sub-merchant that the debit order belongs to; otherwise resource not found is returned.- 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 byplatOrderNo, and a repeated cancellation returns a state conflict according to the rules below. - A first payment (
cashinTypeisQRCODE) 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 (
orderStatusisCANCELLED) or has a cancellation request in progress (cancellation.isstatus PENDING) returns a state conflict. - If the previous cancellation was rejected (
cancellation.isstatus FAILED), it can be submitted again within the deadline, andcancellationis 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:
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:
{
"subMerchantNo": "SUB00000001",
"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. is PENDING, so confirm through Get Debit Order Details that orderStatus becomes 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 | Sub-merchant ID, identical to subMerchantNo in the request. |
data. | string | 64 | Yes | Platform order number of the debit order. |
data. | string | 16 | Yes | Debit 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. | object | N/A | Yes | This cancellation request and its processing progress; see Cancellation Request. |
data. | string | 16 | Yes | Cancellation request status: SUCCESS for an immediate cancellation, otherwise PENDING. |
data. | string | 32 | Yes | Cancellation reason; for the values see the overview enum summary. |
data. | int | 19 | Yes | Time the cancellation request was accepted, Unix timestamp in seconds. |
data. | int | 19 | No | Time the cancellation took effect, Unix timestamp in seconds; null when cancellation. is not SUCCESS. |
Response Examples
Example 1: Debit instruction has not yet reached the bank; cancelled immediately
{
"status": 200,
"msg": "sucesso",
"data": {
"subMerchantNo": "SUB00000001",
"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. is PENDING; after the cancellation takes effect, orderStatus becomes CANCELLED and cancellation. becomes SUCCESS.
{
"status": 200,
"msg": "sucesso",
"data": {
"subMerchantNo": "SUB00000001",
"platOrderNo": "PAC202610250000000001",
"orderStatus": "SCHEDULED",
"cancellation": {
"status": "PENDING",
"reason": "RECEIVER_USER_REQUESTED",
"requestedAt": 1793372400,
"cancelledAt": null
}
}
}Response Error Codes
Back to Pix Subscription Overview