Skip to content

Payout Refund Webhook ​

1. Background ​

A refund has occurred on the Adopay side; after Adopay completes processing the refund, it notifies the partner of the refund result.

The partner must process notifications idempotently by platOrderNo. The same order may be notified multiple times due to retries.

2. Callback Endpoint and Method ​

ItemValue
MethodPOST
URL{notifyUrl}
Content-Typeapplication/json
PurposeNotify the PIX payout refund result

{notifyUrl} is the partner-provided payout callback URL; it must be a complete HTTP or HTTPS URL.

3. Request Headers ​

FieldTypeLengthRequiredDescription
Content-Typestring16YesFixed to application/json.
X-Merchant-Idstring64YesMerchant ID that receives 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 actually sent. When verifying the signature, the partner must not re-serialize the JSON first.

4. Request Body Fields ​

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

FieldTypeLengthReturnedDescription
eventstring64YesSee the event enum below.
subMerchantNostring64NoSub-merchant ID.
attachstring128YesThis payout refund was not initiated by the merchant; the field comes from the original payout order corresponding to origPlatOrderNo, and is the attach value the partner submitted when calling the payout creation API. Returned as-is if it was submitted with the original payout order, empty otherwise.
merchantOrderNostring64YesMerchant refund order number of this refund.
platOrderNostring64YesPlatform refund order number of this refund.
origMerchantOrderNostring64YesOriginal merchant payout order number.
origPlatOrderNostring64YesOriginal platform payout order number.
origAmountdecimal(25,2)25,2YesOriginal payout order amount.
origTotalRefundAmountdecimal(25,2)25,2YesAs of the completion of this refund, the accumulated principal refunded for the original payout order, excluding fees.
origTotalFeeRefundAmountdecimal(25,2)25,2YesAs of the completion of this refund, the accumulated fees refunded for the original payout order, excluding the refund principal.
refundAmountdecimal(25,2)25,2YesPrincipal amount successfully refunded in this request, excluding the fee; for the fee refunded, see feeRefundAmount.
feeRefundAmountdecimal(25,2)25,2YesFee amount refunded in this request; 0 when no fee is refunded.
currencystring3YesRefund currency, identical to the original order's currency, for example BRL.
e2eIdstring64NoPIX end-to-end transaction ID; may be empty when the channel has not returned it.
refundTimeint19NoRefund time, Unix timestamp in seconds.
orderStatusstring16YesCurrent status of the refund order.
statusint-YesResponse code
msgstring128YesMessage corresponding to status

Event and Status Mapping ​

eventorderStatusMeaning
PIX_CASHOUT_REFUNDSUCCESSRefund succeeded.

5. Request Example ​

The following example shows a first refund on the original order: principal 200.00 and fee 2.50 refunded in this request; accumulated refund principal on the original order 200.00; accumulated refunded fees 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_CASHOUT_REFUND",
  "subMerchantNo": "SUB10000000001",
  "attach": "merchant-data-001",
  "merchantOrderNo": "MR20260825000001",
  "platOrderNo": "PR20260825000001",
  "origMerchantOrderNo": "MO20260824000001",
  "origPlatOrderNo": "PO20260824000001",
  "origAmount": 1000.00,
  "origTotalRefundAmount": 200.00,
  "origTotalFeeRefundAmount": 2.50,
  "refundAmount": 200.00,
  "feeRefundAmount": 2.50,
  "currency": "BRL",
  "e2eId": "D1234567820260825123456789012345",
  "refundTime": 1786887025,
  "orderStatus": "SUCCESS"
}

6. Partner Response Requirements ​

After completing idempotent processing, the partner should return HTTP 200—299 with a response body of exactly the plain text SUCCESS or OK:

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

SUCCESS

7. Notification Scenarios and Retries ​

When a payout refund succeeds, Adopay sends a callback notification to the partner.

After the first delivery attempt of a notification fails, Adopay retries at most 9 times, for at most 10 deliveries in total. Once the partner receives the notification successfully and returns the required success response, no further retries occur.

Whether to retry is determined jointly by the HTTP status code and the response body:

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

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

8. Integration Notes ​

  1. Determine the transaction result from event together with orderStatus; do not rely on event alone to judge success or failure.