Skip to content

PIX Out Webhook ​

1. Background ​

After the partner initiates a PIX payout transaction, the final result may not be determinable within the synchronous request. Once the payout order succeeds, fails, or is refunded, Adopay notifies the partner of the final result via an HTTP asynchronous callback.

The partner must process notifications idempotently by platOrderNo or mchOrderNo. 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 ​

ItemValue
MethodPOST
URL{callbackUrl}
Content-Typeapplication/json
PurposeNotify the final PIX payout result

{callbackUrl} is the payout callback URL that the partner has configured; 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))>.
AuthorizationstringVariableYesES256 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.

FieldTypeLengthReturnedDescription
eventstring64YesNotification event; see the event enum below.
subMerchantNostring64YesPartner-specific. Sub-merchant ID that owns this payout order.
attachstring128Noattach value the partner submitted when placing the original payout order; returned as-is if it was submitted, empty otherwise.
mchOrderNostring32YesMerchant order number, i.e. the mchOrderNo the partner submitted when initiating the payout.
platOrderNostring64YesAdopay payout platform order number.
orderStatusstring16YesOrder status, one of PENDING (processing), SUCCESS (payout succeeded), FAILED (payout 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 payout reference; may be empty when not yet 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.
amountdecimal25,2YesAmount credited: the amount credited to the payee; 0 on failure.
feedecimal25,2YesFee; 0 on failure.
fromIspbstring16NoISPB code of the paying institution.
fromBankstring512YesName of the paying institution (bank or payment institution).
fromCnpjstring64YesPayer's CNPJ; sensitive information.
fromNamestring128YesPayer's name.
toPixstring64YesPayee's Pix key; sensitive information.
toIspbstring16YesISPB code of the receiving institution; may be empty when unavailable.
ispbNamestring512YesName of the receiving institution; may be empty when unavailable.
toNamestring128YesPayee's name; sensitive information.
toCpfCnpjstring64YesPayee's CPF/CNPJ; sensitive information.
payTimeint19YesPayout 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_SUCCESSSUCCESSPayout succeeded.
PIX_OUT_FAILEDFAILEDPayout 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; amount is the credited amount of this refund and refundTotalAmount is the cumulative refunded principal.

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_OUT_SUCCESS",
  "subMerchantNo": "SUBMERCHANT0001",
  "attach": "merchant-data-001",
  "mchOrderNo": "CASHOUT202608170001",
  "platOrderNo": "APS202608170000000001",
  "orderStatus": "SUCCESS",
  "e2eId": "E0000000020260817000000000000002",
  "orderAmount": 101.50,
  "amount": 100.00,
  "fee": 1.50,
  "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. 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
HTTP/1.1 200 OK
Content-Type: text/plain

OK

7. Notification Scenarios and Retries ​

When the payout succeeds, fails, or is refunded, 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 CodeResponse BodyResult
200—299Strictly equal to OK or SUCCESS 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

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 ​

  1. Determine the transaction result from event together with orderStatus; do not rely on event alone to judge success, failure, or refund.
  2. When a success notification arrives, re-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.