Skip to content

Create Refund ​

Create a refund for a PIX cashin payment.

Endpoint ​

POST /cashin/pix/refund

Authentication ​

Merchant Credential. See Authentication.

Background ​

The merchant locates its own cashin order by the original platform order number origPlatOrderNo or the original merchant order number origMerchantOrderNo, and submits the refund amount, refund reason, and other information. At least one of the two original order numbers is required.

The currency of the refund amount refundAmount must match the original order currency, and amounts are in the major currency unit. The merchant must ensure the merchant refund order number is unique within the same merchant, for idempotency control of refund requests and subsequent tracking; the final refund result is determined by orderStatus, the asynchronous notification, or a subsequent query.

Refund time limit: a Pix original-route refund must be initiated within 90 calendar days after the original transaction completes; refunds are not allowed after 90 days. This 90-day limit applies only to "Pix original-route refunds" and is not a unified limit for all refunds or for MED. After this deadline, the original transaction can no longer be refunded through the Pix refund API; if funds still need to be returned to the customer, they should be handled through a new payout. MED disputes are subject to separate regulatory time limits and handling rules.

Request Fields ​

FieldLocationTypeLengthRequiredDescription
X-Merchant-IdHeaderstring64YesMerchant ID, read from the request header.
X-TimestampHeaderint19YesUnix request timestamp in seconds, used for request freshness validation.
X-NonceHeaderstring64YesRandom string for request anti-replay protection.
DigestHeaderstring52YesDigest of the request body. Format: SHA-256=<Base64Digest>.
AuthorizationHeaderstring-YesES256 request signature, where keyId is the merchant key version.
origPlatOrderNoBodystring64One of two requiredOriginal platform order number; fill in at least one of this or origMerchantOrderNo.
origMerchantOrderNoBodystring64One of two requiredOriginal merchant order number; fill in at least one of this or origPlatOrderNo.
merchantOrderNoBodystring64YesMerchant refund order number; must be unique within the same merchant.
refundAmountBodydecimal25,2YesPrincipal amount requested for this refund, excluding fees; must be greater than 0, and its currency must match the original order currency. Multiple refunds are allowed; the cumulative refunded principal must not exceed the original order principal.
refundReasonBodystring128YesRefund reason.
refundReasonCategoryBodystring16NoRefund reason category.
notifyUrlBodystring255NoURL where the merchant receives refund result notifications.

Request Examples ​

Request header example:

http
POST /cashin/pix/refund 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
{
  "origPlatOrderNo": "BAS202608160000000001",
  "origMerchantOrderNo": "CASHIN202608160001",
  "merchantOrderNo": "REFUND202608160001",
  "refundAmount": 50,
  "refundReason": "Refund agreed between merchant and customer",
  "refundReasonCategory": "CUSTOMER_REQUEST",
  "notifyUrl": "https://merchant.example.com/callback/refund"
}

Response Fields ​

The API uses a unified status, msg, data response structure. The final refund result should be determined by orderStatus, the asynchronous notification, or a subsequent query.

FieldTypeLengthReturnedDescription
statusint4YesResponse code
msgstring128YesCorresponds to status
dataobjectN/ANoRefund response data; may be absent when the request fails at the signature verification or protocol parsing stage.
data.merchantOrderNostring64YesMerchant refund order number, echoed back from the request.
data.platOrderNostring64ConditionalPlatform refund order number; returned after the refund order is created successfully.
data.amountdecimal(25,2)25,2YesPrincipal amount requested for this refund, excluding fees; echoes refundAmount from the request.
data.refundAmountdecimal(25,2)25,2YesPrincipal amount successfully refunded this time, excluding fees; see data.feeRefundAmount for the fee refunded this time.
data.feeRefundAmountdecimal(25,2)25,2YesFee amount refunded this time; 0 when no fee is refunded.
data.origPlatOrderNostring64ConditionalOriginal platform order number.
data.origMerchantOrderNostring64ConditionalOriginal merchant order number.
data.origAmountdecimal25,2ConditionalOriginal merchant order amount.
data.origTotalRefundAmountdecimal(25,2)25,2ConditionalCumulative principal successfully refunded so far on the original cashin order, excluding fees.
data.origTotalFeeRefundAmountdecimal(25,2)25,2ConditionalCumulative fee amount successfully refunded so far on the original cashin order, excluding the refunded principal.
data.e2eIdstring64NoPix end-to-end transaction ID.
data.orderStatusstring16YesCurrent status of the refund.
data.refundTimeint19NoRefund time, Unix timestamp in seconds.

data.orderStatus Enum ​

Enum ValueDescriptionFinal State
PENDINGRefund being processed.No
SUCCESSRefund succeeded.Yes
FAILEDRefund failed.Yes

Response Examples ​

The following example shows the first successful refund on the original order: principal 50.00 and fee 0.30 refunded, cumulative refunded principal 50.00, and cumulative refunded fee 0.30.

json
{
  "status": 200,
  "msg": "sucesso",
  "data": {
    "merchantOrderNo": "REFUND202608160001",
    "platOrderNo": "RFD202608160000000001",
    "amount": 50,
    "refundAmount": 50,
    "origPlatOrderNo": "BAS202608160000000001",
    "origMerchantOrderNo": "CASHIN202608160001",
    "origAmount": 100,
    "origTotalRefundAmount": 50,
    "origTotalFeeRefundAmount": 0.30,
    "e2eId": "E1234567820260816000000000000001",
    "orderStatus": "SUCCESS",
    "refundTime": 1786887025,
    "feeRefundAmount": 0.3
  }
}