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. Once the cashout order succeeds or fails, Adopay notifies the merchant of the final result through an HTTP asynchronous callback.

The merchant should process notifications idempotently based on platOrderNo or merchantOrderNo. The same order may receive multiple notifications due to retries.

2. Callback URL and Request Method ​

Adopay sends JSON notifications via POST to the cashout callback URL provided by the merchant, with Content-Type set to application/json. The callback URL must be a complete HTTP or HTTPS URL. For signature verification and success response requirements, see the 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))>.
Authorizationstring-YesES256 HTTP Signature.

Both Digest and Authorization are 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 the business 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.
attachstring128YesThe attach value passed by the merchant when the original cashout order was created; returned as-is if provided at order creation, empty otherwise.
merchantOrderNostring64YesMerchant order number passed by the merchant when initiating the cashout.
platOrderNostring64YesAdopay cashout platform order number.
orderStatusstring16Yescashout result: SUCCESS means the cashout succeeded, FAILED means the cashout failed.
e2eIdstring64YesBank E2E transaction number / external channel cashout reference number; may be empty when not generated.
amountdecimal25,2YesMerchant order amount.
receivedAmountdecimal25,2YesAmount actually credited to the payee.
feedecimal25,2YesMerchant fee; 0 on failure.
fromIspbstring16YesISPB code of the paying institution.
fromIspbNamestring512YesName of the paying institution.
fromCnpjstring64YesPayer CNPJ.
fromNamestring128YesPayer name.
toPixstring64YesPayee Pix Key; sensitive information.
toIspbstring16YesISPB code of the receiving institution; may be empty when not available.
toIspbNamestring512YesName 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-YesResponse code
msgstring128YesCorresponds to status

Event and Status Mapping ​

eventorderStatusMeaning
PIX_CASHOUT_SUCCESSSUCCESScashout succeeded.
PIX_CASHOUT_ERRORFAILEDcashout failed.

5. Request Example ​

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_SUCCESS",
  "attach": "merchant-data-001",
  "merchantOrderNo": "CASHOUT202608170001",
  "platOrderNo": "APS202608170000000001",
  "orderStatus": "SUCCESS",
  "e2eId": "E0000000020260817000000000000002",
  "amount": 100,
  "receivedAmount": 100,
  "fee": 1.5,
  "fromIspb": "87654321",
  "fromIspbName": "ADOX INSTITUICAO DE PAGAMENTO LTDA",
  "fromCnpj": "12345678000195",
  "fromName": "",
  "toPix": "maria.oliveira@example.com",
  "toIspb": "60701190",
  "toIspbName": "ITAÚ UNIBANCO S.A.",
  "toName": "MARIA OLIVEIRA",
  "toCpfCnpj": "12345678901",
  "payTime": 1786838460
}

6. Merchant Response Requirements ​

After completing idempotency processing, the merchant should return HTTP 200—299 with a response body that is strictly the plain text SUCCESS or OK:

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

SUCCESS

7. Notification Scenarios and Retry Counts ​

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

After the first delivery attempt of a notification fails, Adopay retries at most 9 times, for a total of at most 10 delivery attempts. Once the merchant receives the notification successfully and returns the required success response, no further retries are made.

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

HTTP Status CodeResponse BodyResult
200—299Exactly SUCCESS or OK 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

SUCCESS and OK are case-sensitive. For example, success, Success, or {"status":"SUCCESS"} will not be recognized as a success response. HTTP 204 is a 2xx status, but because the response body is empty, retries continue.

8. Integration Notes ​

  1. Determine the transaction result from event together with orderStatus; do not rely on event alone to decide success or failure.
  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.