Skip to content

Create Refund ​

Create a refund for a PIX cashin payment.

Endpoint ​

POST /cashin/pix/refund-qrcode

Authentication ​

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.status 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.refundTotalAmount 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.

FieldLocationTypeLengthRequiredDescription
platOrderNoBodystring32EitherPlatform 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.
mchOrderNoBodystring32EitherMerchant order number of the original cashin order, i.e. the mchOrderNo passed at cashin ordering; provide at least one of this and platOrderNo.
refundSnBodystring64YesMerchant refund number, defined by the merchant; must be unique within the same merchant and is also the refund idempotency key.
amountBodydecimal(25,2)25,2YesRefund 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.
informationBodystring128NoRefund description (refund reason), filled in by the merchant.
refundReasonCategoryBodystring16NoRefund reason category.

Request Examples ​

Request header example:

http
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:

json
{
  "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.status, 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.status is the refund status.

FieldTypeLengthReturnedDescription
statusint4YesResponse code.
msgstring128YesMessage corresponding to status; sucesso on success.
dataobjectN/ANoRefund response data; may be absent when the request fails at the signature verification or protocol parsing stage.
data.refundIdstring64YesPlatform refund ID, generated by Adopay once the refund is accepted and used to track this refund.
data.refundSnstring64YesMerchant refund number, echoed from the request.
data.platOrderNostring64YesPlatform 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.mchOrderNostring64NoOriginal merchant order number.
data.informationstring128YesRefund description, echoed from the request.
data.amountdecimal(25,2)25,2YesRefund amount requested this time, echoed from amount in the request.
data.statusstring16YesRefund status; see the enum below.
data.refundAmountdecimal(25,2)25,2NoPrincipal successfully refunded this time, excluding fees; the fee refunded this time is in data.feeRefundAmount.
data.feeRefundAmountdecimal(25,2)25,2NoFee amount refunded this time; 0 when no fee is refunded.
data.originAmountdecimal(25,2)25,2NoOriginal cashin order amount.
data.refundTotalAmountdecimal(25,2)25,2NoCumulative principal successfully refunded on the original cashin order so far, excluding fees.
data.feeRefundTotalAmountdecimal(25,2)25,2NoCumulative fee successfully refunded on the original cashin order so far, excluding refund principal.
data.e2eIdstring64NoPix end-to-end transaction ID of the refund transaction; may be empty while the channel has not returned it.
data.refundTimeint19NoRefund time, Unix timestamp in seconds.

data.status Enum ​

Enum ValueDescriptionFinal State
PENDINGRefund in progress; the request has been accepted but fund processing is not complete — keep querying or wait for the asynchronous notification.No
SUCCESSRefund succeeded; fund processing is complete.Yes
FAILEDRefund 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.

json
{
  "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
  }
}