Skip to content

/cashin/check-refund Query Refund Detail ​

Background ​

/cashin/check-refund is the cashin refund order query API provided to partners. Using the merchant refund number refundSn or the platform refund ID refundId (either one), the partner can query a refund order's current status, refund amount, accumulated refund amount, refunded fees, and the original cashin order information.

A successful refund query only means the system has returned the refund order's current information; it does not mean the refund has finally succeeded. The refund result is determined by data.status.

Endpoint ​

ItemValue
MethodGET
Path/cashin/check-refund
Content-Typeapplication/json
PurposeQuery a cashin refund order

Access Requirements ​

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 Example ​

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=<Base64 digest>
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=<Base64 digest>
Authorization: Signature keyId="v1",alg="ES256",headers="(request-target) x-timestamp x-nonce digest",signature="<ES256_SIGNATURE_BASE64>"

Response Fields ​

The API uses the standard status, msg, and data response structure. A successful response does not mean the refund succeeded; while the refund is still being processed, the partner should keep querying or wait for the asynchronous refund result 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 omitted when the request fails at signature verification, protocol parsing, parameter validation, or order lookup.
data.subMerchantNostring64YesPartner-specific. Sub-merchant ID.
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.attachstring128Noattach value the partner submitted when placing the original payment order; returned as-is if it was submitted, 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 ​

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 Example ​

The following example shows a first successful refund on the original order: principal 50.00 and fee 0.30 refunded; accumulated refund principal 50.00; accumulated refunded fees 0.30.

json
{
  "status": 200,
  "msg": "sucesso",
  "data": {
    "subMerchantNo": "SUB00000001",
    "attach": "order-source=checkout",
    "mchOrderNo": "CASHIN202608160001",
    "platOrderNo": "BAS202608160000000001",
    "orderStatus": "REFUND",
    "amount": 100.00,
    "payAmount": 100.00,
    "msg": "",
    "payTime": 1786887025,
    "e2eId": "D1234567820260816000000000000001",
    "payerName": "Maria Oliveira",
    "payerDocument": "12345678901",
    "originE2eId": "E1234567820260816000000000000001",
    "refundAmount": 50.00,
    "refundTotalAmount": 50.00,
    "refundSn": "REFUND202608160001",
    "refundId": "313",
    "status": "SUCCESS",
    "currency": "BRL",
    "feeRefundAmount": 0.30,
    "feeRefundTotalAmount": 0.30,
    "refundTime": 1786890000,
    "dataStatus": 200,
    "dataMsg": "SUCCESS"
  }
}

Integration Notes ​

  1. The query scope is limited to the primary merchant ID in the X-Merchant-Id request header; subMerchantNo is not required, and refund data of other partners cannot be queried by order number.
  2. data.status is the only refund status field for judging the refund result; the API-level status = 200 must not be treated as refund success, and data.orderStatus is the status of the original cashin order and must not be used to judge the refund result.
  3. The partner should process amounts with high-precision decimal types and verify the currency, original order amount, refund amount of this request, and accumulated refund amount.
  4. The refund query API covers synchronous timeouts, missed notifications, and status reconciliation. The final-state refund notification and proactive queries may arrive at the same time; the partner must apply idempotent processing keyed on the merchant refund number refundSn and the refund status.

Response Error Codes ​