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 based on refundId (platOrderNo stays the same across multiple refunds of one order). The same order may be notified multiple times due to retries.
WARNING
Respond within 3 seconds; a response slower than 3 seconds is treated as a callback failure.
2. Callback Endpoint and Method
| Item | Value |
|---|---|
| Method | POST |
| URL | {callbackUrl} |
| Content-Type | application/json |
| Purpose | Notify the PIX payout refund result |
{callbackUrl} is the payout callback URL that the partner has configured; it must be a complete HTTP or HTTPS URL.
3. Request Headers
| Field | Type | Length | Required | Description |
|---|---|---|---|---|
Content-Type | string | 16 | Yes | Fixed to application/json. |
X-Merchant-Id | string | 64 | Yes | Merchant ID that receives the notification. |
X-Timestamp | string | 19 | Yes | Unix timestamp in seconds. |
X-Nonce | string | 64 | Yes | Random string for this request, used for anti-replay. |
Digest | string | 52 | Yes | Digest of the raw request body, in the format SHA-256=<Base64(SHA256(body_bytes))>. |
Authorization | string | - | Yes | ES256 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 indicates business success, in which case msg = "sucesso". Any value other than 200 indicates a business error; see msg for the reason.
| Field | Type | Length | Returned | Description |
|---|---|---|---|---|
event | string | 64 | Yes | Notification event; see the event enum below. |
mchOrderNo | string | 32 | Yes | Merchant order number of the original payment order. |
platOrderNo | string | 64 | Yes | Platform order number of the original payment order. |
orderStatus | string | 16 | Yes | Order status of the original payout order; always REFUND (refunded) in a refund notification, corresponding to event, see the mapping table below. |
e2eId | string | 64 | No | PIX end-to-end transaction ID; may be empty when the channel has not returned it. |
amount | decimal(25,2) | 25,2 | Yes | Amount credited by this refund, excluding fees; see feeRefundAmount for the fee refunded this time. |
fee | decimal(25,2) | 25,2 | Yes | Fee of the original payout order. |
fromBank | string | 512 | Yes | Name of the paying institution (bank or payment institution). |
fromCnpj | string | 64 | Yes | Payer CNPJ; sensitive information. |
fromName | string | 128 | Yes | Payer name. |
toPix | string | 64 | Yes | Payee Pix Key; sensitive information. |
toIspb | string | 16 | Yes | ISPB code of the receiving institution; may be empty when not available. |
ispbName | string | 512 | Yes | Name of the receiving institution; may be empty when not available. |
toName | string | 128 | Yes | Payee name; sensitive information. |
toCpfCnpj | string | 64 | Yes | Payee CPF/CNPJ; sensitive information. |
payTime | int | 19 | Yes | Payment time of the original order, Unix timestamp in seconds. |
status | int | - | No | Response code |
msg | string | 128 | Yes | Message; sucesso when normal, the error message on a business error. |
attach | string | 128 | No | The attach value the partner passed when creating the original payout order; returned as-is if it was passed, empty otherwise. |
refundId | string | 64 | No | Platform refund order number of this refund. |
orderAmount | decimal(25,2) | 25,2 | No | Order amount of the original payment order, same meaning as orderAmount in the payout callback. |
refund | decimal(25,2) | 25,2 | No | As of the completion of this refund, the cumulative principal refunded on the original payment order, excluding fees. |
fee | decimal(25,2) | 25,2 | No | As of the completion of this refund, the accumulated fees refunded for the original payout order, excluding the refund principal. |
feeRefundAmount | decimal(25,2) | 25,2 | No | Fee amount refunded in this request; 0 when no fee is refunded. |
currency | string | 3 | No | Refund currency, identical to the original order's currency, for example BRL. |
subMerchantNo | string | 64 | No | Partner-specific. Sub-merchant ID. |
Event and Status Mapping
event | orderStatus | Meaning |
|---|---|---|
PIX_OUT_REFUND | REFUND | Refund succeeded; the original cashout order moves from SUCCESS to REFUND, which does not mean it has been fully refunded. |
REFUND status notes
- State transition:
REFUNDcan only be reached fromSUCCESS. After a refund occurs, the cashout order moves fromSUCCESStoREFUND; orders inPENDINGorFAILEDnever enterREFUND. - Not necessarily a full refund:
REFUNDonly 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 principalrefundwith the amount of the original payment order (Total Amount amountin the payout callback). - Refund details: the principal, fee, and cumulative amounts of each refund are in this notification;
amountis the credited amount of this refund andrefundis the cumulative refunded principal.Total Amount
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.
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",
"subMerchantNo": "SUB10000000001"
}6. Partner Response Requirements
The partner 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/1.1 200 OK
Content-Type: text/plain
OK7. 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 14 times, for at most 15 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 Code | Response Body | Result |
|---|---|---|
200—299 | Strictly equal to OK or SUCCESS after trimming leading and trailing whitespace | Notification delivered; no more retries |
200—299 | Empty body, JSON, other text, or wrong casing | Notification failed; retry continues |
Non-2xx | Any content | Notification failed; retry continues |
| No HTTP response received | Network timeout or connection failure | Notification 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 is a 2xx status, its body is empty, so retries continue.
8. Integration Notes
- Determine the transaction result from
eventtogether withorderStatus; do not rely oneventalone to judge success or failure. toPix,toName,fromCnpjandtoCpfCnpjare sensitive information and should be masked in logs and audit systems.