Skip to content

Query Refund Detail ​

Query refund detail by merchant refund SN.

Endpoint ​

GET /cashin/check-refund

Authentication ​

Merchant Credential. See Authentication.

Background ​

The merchant queries the current status, refund amount, cumulative refunded amount, refunded fee, and original cashin order information of its own refund order by the merchant refund number refundSn or the platform refund ID refundId (either one).

A successful query only means the current order information has been returned; it does not mean the refund finally succeeded, and the refund result is determined by data.status. This API can be used when the synchronous request timed out, a notification was missed, or a status needs to be reconciled.

Request Fields ​

For authentication headers, see Authentication; they are not listed in the table below.

FieldLocationTypeLengthRequiredDescription
refundSnQuerystring64ConditionalMerchant refund number, i.e. the refundSn submitted when the refund was initiated; provide at least one of this and refundId.
refundIdQuerystring64ConditionalPlatform refund ID, i.e. the refundId returned by the refund request response or refund notification; provide at least one of this and refundSn.

Provide either refundSn or refundId (at least one); both ways use the same path.

Request Examples ​

Query by merchant refund number:

http
GET /cashin/check-refund?refundSn=REFUND202608160001 HTTP/1.1
Content-Type: application/json
X-Merchant-Id: 92315566000120
X-Timestamp: 1786867200
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>"

Query by platform refund ID:

http
GET /cashin/check-refund?refundId=313 HTTP/1.1
Content-Type: application/json
X-Merchant-Id: 92315566000120
X-Timestamp: 1786867200
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>"

Response Fields ​

The API uses a unified status, msg, data response structure. A successful response does not mean the refund succeeded; while the refund is still in progress, the merchant should keep querying or wait for the asynchronous refund notification. Note the difference: the outermost status is the API response code, data.status is the refund status, and data.orderStatus is the status of the original cashin order.

Business status: dataStatus is an integer; dataStatus = 200 indicates the business succeeded, in which case dataMsg = "SUCCESS". Any value other than 200 indicates a business error; see dataMsg for the reason.

FieldTypeLengthReturnedDescription
statusint4YesResponse code.
msgstring128YesMessage corresponding to status; sucesso on success.
dataobjectN/ANoRefund order query result; may be absent when the request fails at the signature verification, protocol parsing, parameter validation, or order query stage.
data.mchOrderNostring32YesMerchant order number of the original cashin order.
data.platOrderNostring64YesPlatform order number of the original cashin order.
data.orderStatusstring16YesCurrent status of the original cashin order; values and meanings are listed in the orderStatus enum of Query Payment by Order SN. REFUND after a refund.
data.amountdecimal(25,2)25,2YesOriginal cashin order amount.
data.payAmountdecimal(25,2)25,2YesActual paid amount of the original cashin order.
data.msgstring128YesMessage; an empty string when there is nothing to say.
data.payTimeint19YesPayment completion time of the original cashin order, Unix timestamp in seconds.
data.e2eIdstring64YesPix end-to-end transaction ID of the refund transaction; empty string while the channel has not returned it.
data.payerNamestring128YesPayer name of the original cashin order; empty string when unavailable.
data.payerDocumentstring14YesPayer tax ID of the original cashin order (CPF 11 digits / CNPJ 14 digits); empty string when unavailable.
data.originE2eIdstring64YesPix end-to-end transaction ID of the original cashin transaction, i.e. the payment being refunded.
data.refundAmountdecimal(25,2)25,2YesRefund amount this time (principal, excluding fees); for multiple refunds, distinguish this time from the cumulative amount.
data.refundTotalAmountdecimal(25,2)25,2YesCumulative principal refunded on the original cashin order so far, excluding fees.
data.refundSnstring64YesMerchant refund number.
data.refundIdstring64YesPlatform refund ID.
data.statusstring16YesRefund status; see the enum below.
data.attachstring128NoThe attach value passed by the merchant when the original cashin order was created; returned as-is if provided at order creation, empty otherwise.
data.currencystring3NoRefund currency, same as the original order currency, for example BRL.
data.feeRefundAmountdecimal(25,2)25,2NoFee refunded this time; 0 when no fee is refunded.
data.feeRefundTotalAmountdecimal(25,2)25,2NoCumulative fee successfully refunded on the original cashin order so far, excluding refund principal.
data.refundTimeint19NoRefund time, Unix timestamp in seconds.
data.dataStatusint-NoResponse code
data.dataMsgstring128NoCorresponds to dataStatus

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. See dataMsg for the failure reason.Yes

orderStatus Order Status ​

data.orderStatus is the current status of the original cashin order, not the status of the refund; the refund status is in data.status.

ValueMeaningDescription
PENDINGIn progressThe order is being processed or is waiting for a result.
SUCCESSSucceededThe order transaction completed successfully; if a refund occurs later, the order status changes to REFUND.
FAILEDFailedThe order transaction failed.
REFUNDRefundedA refund has occurred on the order (the amount has been partly or fully returned). It can only be reached from SUCCESS, and it does not mean the order has been fully refunded.

Usage notes:

  1. After the original cashin order has been refunded, data.orderStatus is REFUND. For a detailed description of each value and whether it is terminal, see the orderStatus enum of Query Payment by Order SN.
  2. data.orderStatus = REFUND does not mean this refund succeeded. The result of this refund is determined only by data.status (PENDING / SUCCESS / FAILED); while data.status is PENDING, keep querying or wait for the asynchronous notification.
  3. data.orderStatus does not reflect refund amounts. Use data.refundAmount for this refund and data.refundTotalAmount for the cumulative refunded amount; to check whether the order has been fully refunded, compare data.refundTotalAmount with data.payAmount.
  4. State transition: the original cashin order can only move from SUCCESS to REFUND; orders in PENDING or FAILED never enter REFUND. An order can be partially refunded several times, and its status is REFUND after a partial refund as well.

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": {
    "attach": "order-source=checkout",
    "mchOrderNo": "CASHIN202608160001",
    "platOrderNo": "BAS202608160000000001",
    "orderStatus": "REFUND",
    "amount": 100,
    "payAmount": 100,
    "msg": "",
    "payTime": 1786887025,
    "e2eId": "D1234567820260816000000000000001",
    "payerName": "Maria Oliveira",
    "payerDocument": "12345678901",
    "originE2eId": "E1234567820260816000000000000001",
    "refundAmount": 50,
    "refundTotalAmount": 50,
    "refundSn": "REFUND202608160001",
    "refundId": "313",
    "status": "SUCCESS",
    "currency": "BRL",
    "feeRefundAmount": 0.3,
    "feeRefundTotalAmount": 0.30,
    "refundTime": 1786890000,
    "dataStatus": 200,
    "dataMsg": "SUCCESS"
  }
}