Skip to content

Cashout Webhook ​

Asynchronous payout status notification.

Endpoint ​

POST /callback_url

Authentication ​

Merchant Credential. See Authentication.

1. Notification Background ​

After a merchant initiates a Pix payout transaction, the final result may not be determinable in the synchronous request. After the cashout order succeeds, fails, or is refunded, Adopay notifies the merchant of the result through an HTTP asynchronous callback.

The merchant should process notifications idempotently based on platOrderNo or mchOrderNo. 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 ​

Adopay sends a JSON notification with POST to the cashout callback URL provided by the merchant, with Content-Type set to application/json. The callback URL is the one the merchant configured in the merchant console, and is written as /callback_url in this document; it must be a complete HTTP or HTTPS URL. For signature verification and success response requirements, see Webhook Specification.

3. Request Header Fields ​

FieldTypeLengthRequiredDescription
Content-Typestring16YesFixed to application/json.
X-Merchant-Idstring64YesMerchant ID receiving the notification.
X-Timestampstring19YesUnix timestamp in seconds.
X-Noncestring64YesRandom string of this request, used for anti-replay protection.
Digeststring52YesDigest of the raw request body. Format: SHA-256=<Base64(SHA256(body_bytes))>.
AuthorizationstringVariableYesES256 HTTP Signature.

Digest and Authorization are both computed over the raw JSON bytes actually sent. When verifying the signature, the merchant 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.

FieldTypeLengthReturnedDescription
eventstring64YesNotification event; see the event enum below.
attachstring128NoThe attach value passed by the merchant when the original cashout order was created; returned as-is if provided at order creation, empty otherwise.
mchOrderNostring32YesMerchant order number, i.e. the mchOrderNo passed by the merchant when initiating the cashout.
platOrderNostring64YesAdopay cashout platform order number.
orderStatusstring16YesOrder status, one of PENDING (processing), SUCCESS (cashout succeeded), FAILED (cashout failed), REFUND (refunded; reached only from SUCCESS, and it only means a refund has occurred, not necessarily a full refund); corresponds one to one with event, see the mapping table below.
e2eIdstring64YesBank E2E transaction number / external channel cashout reference number; may be empty when not generated.
orderAmountdecimal(25,2)25,2NoOrder amount: the payout amount submitted by the merchant, same as data.amount in the create and query responses; the amount actually credited to the payee is amount.
amountdecimal(25,2)25,2YesAmount credited: the amount credited to the payee; 0 on failure.
feedecimal(25,2)25,2YesFee; 0 on failure.
fromIspbstring16NoISPB code of the paying institution.
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.
payTimeint19YesCashout completion time, Unix timestamp in seconds; 0 when unavailable.
statusint-NoResponse code
msgstring128YesMessage; sucesso when normal, the error message on a business error.

Event and Status Mapping ​

eventorderStatusMeaning
PIX_OUT_SUCCESSSUCCESSCashout succeeded.
PIX_OUT_FAILEDFAILEDCashout failed.

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 order's amount.
  3. Refund details: the principal, fee, and cumulative amounts of each refund are in the Cashout Refund Webhook; refundAmount is the principal of this refund and refundTotalAmount is the cumulative refunded principal.

5. Request Example ​

http
POST /callback_url 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_SUCCESS",
  "attach": "merchant-data-001",
  "mchOrderNo": "CASHOUT202608170001",
  "platOrderNo": "APS202608170000000001",
  "orderStatus": "SUCCESS",
  "e2eId": "E0000000020260817000000000000002",
  "orderAmount": 101.5,
  "amount": 100,
  "fee": 1.5,
  "fromIspb": "87654321",
  "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
}

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 Counts ​

Adopay sends a callback notification to the merchant when a cashout succeeds, fails, or is refunded.

After the first send of each notification fails, Adopay retries up to 14 times, for a maximum of 15 sends in total. Once the merchant has received it and returned the required success response, no more retries are made.

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

HTTP Status CodeResponse BodyResult
200—299Exactly OK or SUCCESS after trimming leading and trailing whitespaceNotification succeeded; no more retries
200—299Empty body, JSON, other text, or casing other than the required oneNotification failed; retries continue
Not 2xxAny contentNotification failed; retries continue
No HTTP response receivedNetwork timeout or connection failureNotification failed; retries continue

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

8. Integration Notes ​

  1. Determine the transaction result from event together with orderStatus; do not rely on event alone to decide success, failure, or refund.
  2. When a success notification is received, verify amount, the payee, and the Pix Key.
  3. toPix, toName, fromCnpj, and toCpfCnpj are sensitive information and should be stored masked in logs and audit systems.