Skip to content

Payment Refund Result Callback Notification to Merchant ​

1. Notification Background ​

After Adopay processes a payment refund and completes it, Adopay notifies the merchant of the refund result via an HTTP asynchronous callback.

Merchants should handle notifications idempotently based on refundId (platOrderNo stays the same across multiple refunds of one order). The same order may receive multiple notifications due to retries.

WARNING

Respond within 3 seconds; a response slower than 3 seconds is treated as a callback failure.

2. Callback URL and Request Method ​

ItemContent
Request methodPOST
Request URL{callbackUrl}
Content-Typeapplication/json
PurposeNotify the Pix cashout refund result

{callbackUrl} is the payout callback URL that the merchant has configured in the merchant console, and must be a complete HTTP or HTTPS URL.

3. Request Header Fields ​

FieldTypeLengthRequiredDescription
Content-Typestring16YesFixed as application/json.
X-Merchant-Idstring64YesMerchant number receiving the notification.
X-Timestampstring19YesUnix timestamp in seconds.
X-Noncestring64YesRandom string for this request, used for anti-replay.
Digeststring52YesDigest of the raw request body, in the format SHA-256=<Base64(SHA256(body_bytes))>.
Authorizationstring-YesES256 HTTP Signature information.

Both Digest and Authorization are computed over the raw JSON bytes that are finally sent. Merchants must not re-serialize the JSON before performing signature verification.

4. Request Body Fields ​

Business status: status is an integer; status = 200 indicates business success, in which case msg = "sucesso". Any value other than 200 indicates a business error; see msg for the reason.

FieldTypeLengthReturnedDescription
eventstring64YesNotification event; see the event enum below.
mchOrderNostring32YesMerchant order number of the original payment order.
platOrderNostring64YesPlatform order number of the original payment order.
orderStatusstring16YesOrder status of the original payout order; always REFUND (refunded) in a refund notification, corresponding to event, see the mapping table below.
e2eIdstring64NoPix end-to-end transaction ID; may be empty when the channel has not returned it yet.
amountdecimal(25,2)25,2YesAmount credited by this refund, excluding fees; see feeRefundAmount for the fee refunded this time.
feedecimal(25,2)25,2YesFee of the original payout order.
fromBankstring512YesName of the paying institution (bank or payment institution).
fromCnpjstring64YesPayer CNPJ; sensitive information.
fromNamestring128YesPayer name.
toPixstring64YesPayee Pix Key; sensitive information.
toIspbstring16YesISPB code of the receiving institution; may be empty when not available.
ispbNamestring512YesName of the receiving institution; may be empty when not available.
toNamestring128YesPayee name; sensitive information.
toCpfCnpjstring64YesPayee CPF/CNPJ; sensitive information.
payTimeint19YesPayment time of the original order, Unix timestamp in seconds.
statusint-NoResponse code
msgstring128YesMessage; sucesso when normal, the error message on a business error.
attachstring128NoThe attach value the merchant passed when creating the original payout order; returned as-is if it was passed, empty otherwise.
refundIdstring64NoPlatform refund order number of this refund.
orderAmountdecimal(25,2)25,2NoOrder amount of the original payment order, same meaning as orderAmount in the payout callback.
refundTotalAmountdecimal(25,2)25,2NoAs of the completion of this refund, the cumulative principal refunded on the original payment order, excluding fees.
feeRefundTotalAmountdecimal(25,2)25,2NoAs of the completion of this refund, the cumulative fee amount refunded on the original cashout order, excluding the refund principal.
feeRefundAmountdecimal(25,2)25,2NoFee amount refunded this time; 0 when no fee is refunded.
currencystring3NoRefund currency, identical to the original order currency, e.g. BRL.

Event and Status Mapping ​

eventorderStatusMeaning
PIX_OUT_REFUNDREFUNDRefund succeeded; the original cashout order moves from SUCCESS to REFUND, which does not mean it has been fully refunded.

REFUND status notes

  1. State transition: REFUND can only be reached from SUCCESS. After a refund occurs, the cashout order moves from SUCCESS to REFUND; orders in PENDING or FAILED never enter REFUND.
  2. Not necessarily a full refund: REFUND only means that a refund has occurred on the cashout order, not that it has been fully refunded. To check whether it has been fully refunded, compare the cumulative refunded principal refundTotalAmount with the amount of the original payment order (amount in the payout callback).
  3. Refund details: the principal, fee, and cumulative amounts of each refund are in this notification; amount is the credited amount of this refund and refundTotalAmount is the cumulative refunded principal.

5. Request Example ​

The following example shows the first refund of the original order: this refund returns principal 200.00 and fee 2.50; the cumulative refunded principal on the original order is 200.00, and the cumulative refunded fee is 2.50.

http
POST /notify/adopay/cashout HTTP/1.1
Host: merchant.example.com
Content-Type: application/json
X-Merchant-Id: 92315566000120
X-Timestamp: 1786838460
X-Nonce: 4de901987ca14b25acf2639056ac6002
Digest: SHA-256=<REQUEST_BODY_SHA256_BASE64>
Authorization: Signature keyId="v1",alg="ES256",headers="(request-target) x-timestamp x-nonce digest",signature="<ES256_SIGNATURE_BASE64>"

{
  "status": 200,
  "msg": "sucesso",
  "event": "PIX_OUT_REFUND",
  "mchOrderNo": "MO20260824000001",
  "platOrderNo": "PO20260824000001",
  "orderStatus": "REFUND",
  "e2eId": "D1234567820260825123456789012345",
  "amount": 200.00,
  "fee": 1.50,
  "fromBank": "ADOX INSTITUICAO DE PAGAMENTO LTDA",
  "fromCnpj": "***.820.307/0002**",
  "fromName": "DX MEIOS DE PAGAMENTOS LTDA",
  "toPix": "ma***com",
  "toIspb": "60701190",
  "ispbName": "ITAÚ UNIBANCO S.A.",
  "toName": "MARIA OLIVEIRA",
  "toCpfCnpj": "123******01",
  "payTime": 1786838460,
  "attach": "merchant-data-001",
  "refundId": "PR20260825000001",
  "orderAmount": 1000.00,
  "refundTotalAmount": 200.00,
  "feeRefundTotalAmount": 2.50,
  "feeRefundAmount": 2.50,
  "currency": "BRL"
}

6. Merchant Response Requirements ​

The merchant must finish idempotent processing and respond within 3 seconds with HTTP 200—299 and a plain-text body of OK (SUCCESS is also accepted).

Response example:

http
HTTP/1.1 200 OK
Content-Type: text/plain

OK

7. Notification Scenarios and Retry Count ​

When a payment refund succeeds, Adopay sends a callback notification to the merchant.

If the first delivery of a notification fails, it is retried at most 14 times, for at most 15 deliveries in total. Once the merchant successfully receives the notification and returns the required success response, no more retries are made.

HTTP Status CodeResponse BodyResult
200 to 299Strictly equals OK or SUCCESS after trimming leading and trailing whitespaceNotification successful, no more retries
200 to 299Empty body, JSON, other text, or non-standard casingNotification failed, retry continues
Non-2xxAny contentNotification failed, retry continues
No HTTP response receivedNetwork timeout or connection failureNotification failed, retry continues

OK and SUCCESS are case-sensitive. For example, ok, Success, or {"status":"SUCCESS"} are not recognized as success responses. Although HTTP 204 belongs to 2xx, its response body is empty, so retries continue.

8. Integration Notes ​

  1. It is recommended to determine the transaction result from event and orderStatus; do not rely on event alone to determine success or failure.
  2. Upon receiving a successful notification, re-verify amount, feeRefundAmount, the currency, and the original order information.
  3. toPix, toName, fromCnpj and toCpfCnpj are sensitive information and should be masked in logs and audit systems.