Create Refund
Create a refund for a PIX cashin payment.
Endpoint
POST/cashin/pix/refund-qrcodeAuthentication
Merchant Credential. See Authentication.
Background
The merchant locates its own cashin order by the original platform order number platOrderNo or merchant order number mchOrderNo (either one) and submits the refund amount, the merchant refund number, and the refund description.
The currency of the refund amount amount must match the original order currency, and the amount unit is BRL. Multiple partial refunds are allowed; the cumulative refunded principal must not exceed the original order principal. The merchant must ensure that the merchant refund number refundSn is unique within the same merchant; it is used for idempotency control of refund requests and for later tracking. The final refund result is determined by data. in the response, the asynchronous notification, or the Query Refund Detail result.
After a refund occurs, the status of the original cashin order moves from SUCCESS to REFUND. REFUND only means that a refund has occurred on the order, not that it has been fully refunded: an order can be partially refunded several times and its status is REFUND after a partial refund as well. The cumulative refunded principal is in data. of the response; compare it with the payAmount of the original order to check whether it has been fully refunded.
Refund time limit: a Pix refund through the original route must be initiated within 90 calendar days after the original transaction was completed; refunds after 90 days are not allowed. The 90-day limit applies only to "Pix refunds through the original route"; it is not a uniform limit for all refunds or for MED. After the limit, the original transaction can no longer be returned through the Pix refund API; if funds still need to be returned to the customer, handle it through a new payout flow. MED disputes are governed by separate regulatory time limits and handling rules.
Request Fields
For authentication headers, see Authentication; they are not listed in the table below.
| Field | Location | Type | Length | Required | Description |
|---|---|---|---|---|---|
platOrderNo | Body | string | 32 | Either | Platform order number of the original cashin order, i.e. the platOrderNo returned by cashin ordering or cashin query; provide at least one of this and mchOrderNo. |
mchOrderNo | Body | string | 32 | Either | Merchant order number of the original cashin order, i.e. the mchOrderNo passed at cashin ordering; provide at least one of this and platOrderNo. |
refundSn | Body | string | 64 | Yes | Merchant refund number, defined by the merchant; must be unique within the same merchant and is also the refund idempotency key. |
amount | Body | decimal(25,2) | 25,2 | Yes | Refund amount for this request in BRL, at most two decimal places; the range per refund is 10 – 50000, and the currency matches the original order. Multiple refunds are allowed; the cumulative refunded principal must not exceed the original order principal. |
information | Body | string | 128 | No | Refund description (refund reason), filled in by the merchant. |
refund | Body | string | 16 | No | Refund reason category. |
Request Examples
Request header example:
POST /cashin/pix/refund-qrcode HTTP/1.1
Content-Type: application/json
X-Merchant-Id: 92315566000120
X-Timestamp: 1790200000
X-Nonce: 550e8400-e29b-41d4-a716-446655440000
Digest: SHA-256=<Base64Digest>
Authorization: Signature keyId="v1",alg="ES256",headers="(request-target) x-timestamp x-nonce digest",signature="<ES256_SIGNATURE_BASE64>"Request body example:
{
"platOrderNo": "BAS202608160000000001",
"refundSn": "REFUND202608160001",
"amount": 50,
"information": "Refund agreed between merchant and customer",
"refundReasonCategory": "CUSTOMER_REQUEST"
}Response Fields
The API uses a unified status, msg, data response structure. The final refund result is determined by data., the asynchronous notification, or later query results. Note the difference: the outermost status is the API response code (200 means the request was accepted), while data. is the refund status.
| Field | Type | Length | Returned | Description |
|---|---|---|---|---|
status | int | 4 | Yes | Response code. |
msg | string | 128 | Yes | Message corresponding to status; sucesso on success. |
data | object | N/A | No | Refund response data; may be absent when the request fails at the signature verification or protocol parsing stage. |
data. | string | 64 | Yes | Platform refund ID, generated by Adopay once the refund is accepted and used to track this refund. |
data. | string | 64 | Yes | Merchant refund number, echoed from the request. |
data. | string | 64 | Yes | Platform order number of the original cashin order; echoed from the request when platOrderNo was sent, otherwise the platform order number matching the given mchOrderNo. |
data. | string | 64 | No | Original merchant order number. |
data. | string | 128 | Yes | Refund description, echoed from the request. |
data. | decimal(25,2) | 25,2 | Yes | Refund amount requested this time, echoed from amount in the request. |
data. | string | 16 | Yes | Refund status; see the enum below. |
data. | decimal(25,2) | 25,2 | No | Principal successfully refunded this time, excluding fees; the fee refunded this time is in data.. |
data. | decimal(25,2) | 25,2 | No | Fee amount refunded this time; 0 when no fee is refunded. |
data. | decimal(25,2) | 25,2 | No | Original cashin order amount. |
data. | decimal(25,2) | 25,2 | No | Cumulative principal successfully refunded on the original cashin order so far, excluding fees. |
data. | decimal(25,2) | 25,2 | No | Cumulative fee successfully refunded on the original cashin order so far, excluding refund principal. |
data. | string | 64 | No | Pix end-to-end transaction ID of the refund transaction; may be empty while the channel has not returned it. |
data. | int | 19 | No | Refund time, Unix timestamp in seconds. |
data.status Enum
| Enum Value | Description | Final State |
|---|---|---|
PENDING | Refund in progress; the request has been accepted but fund processing is not complete — keep querying or wait for the asynchronous notification. | No |
SUCCESS | Refund succeeded; fund processing is complete. | Yes |
FAILED | Refund failed; this refund has ended. | Yes |
Response Examples
The following example is a first successful refund on the original order: principal 50.00 and fee 0.30 refunded; cumulative refunded principal is 50.00 and cumulative refunded fee is 0.30.
{
"status": 200,
"msg": "sucesso",
"data": {
"refundId": "313",
"refundSn": "REFUND202608160001",
"platOrderNo": "BAS202608160000000001",
"mchOrderNo": "CASHIN202608160001",
"information": "Refund agreed between merchant and customer",
"amount": 50,
"status": "SUCCESS",
"refundAmount": 50,
"feeRefundAmount": 0.3,
"originAmount": 100,
"refundTotalAmount": 50,
"feeRefundTotalAmount": 0.30,
"e2eId": "D1234567820260816000000000000001",
"refundTime": 1786887025
}
}