Query Refund Detail
Query refund detail by merchant refund SN.
Endpoint
GET/cashin/check-refundAuthentication
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.. 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.
| Field | Location | Type | Length | Required | Description |
|---|---|---|---|---|---|
refundSn | Query | string | 64 | Conditional | Merchant refund number, i.e. the refundSn submitted when the refund was initiated; provide at least one of this and refundId. |
refundId | Query | string | 64 | Conditional | Platform 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:
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:
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. is the refund status, and data. 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.
| 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 order query result; may be absent when the request fails at the signature verification, protocol parsing, parameter validation, or order query stage. |
data. | string | 32 | Yes | Merchant order number of the original cashin order. |
data. | string | 64 | Yes | Platform order number of the original cashin order. |
data. | string | 16 | Yes | Current 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. | decimal(25,2) | 25,2 | Yes | Original cashin order amount. |
data. | decimal(25,2) | 25,2 | Yes | Actual paid amount of the original cashin order. |
data. | string | 128 | Yes | Message; an empty string when there is nothing to say. |
data. | int | 19 | Yes | Payment completion time of the original cashin order, Unix timestamp in seconds. |
data. | string | 64 | Yes | Pix end-to-end transaction ID of the refund transaction; empty string while the channel has not returned it. |
data. | string | 128 | Yes | Payer name of the original cashin order; empty string when unavailable. |
data. | string | 14 | Yes | Payer tax ID of the original cashin order (CPF 11 digits / CNPJ 14 digits); empty string when unavailable. |
data. | string | 64 | Yes | Pix end-to-end transaction ID of the original cashin transaction, i.e. the payment being refunded. |
data. | decimal(25,2) | 25,2 | Yes | Refund amount this time (principal, excluding fees); for multiple refunds, distinguish this time from the cumulative amount. |
data. | decimal(25,2) | 25,2 | Yes | Cumulative principal refunded on the original cashin order so far, excluding fees. |
data. | string | 64 | Yes | Merchant refund number. |
data. | string | 64 | Yes | Platform refund ID. |
data. | string | 16 | Yes | Refund status; see the enum below. |
data. | string | 128 | No | The attach value passed by the merchant when the original cashin order was created; returned as-is if provided at order creation, empty otherwise. |
data. | string | 3 | No | Refund currency, same as the original order currency, for example BRL. |
data. | decimal(25,2) | 25,2 | No | Fee refunded this time; 0 when no fee is refunded. |
data. | decimal(25,2) | 25,2 | No | Cumulative fee successfully refunded on the original cashin order so far, excluding refund principal. |
data. | int | 19 | No | Refund time, Unix timestamp in seconds. |
data. | int | - | No | Response code |
data. | string | 128 | No | Corresponds to dataStatus |
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. See dataMsg for the failure reason. | Yes |
orderStatus Order Status
data. is the current status of the original cashin order, not the status of the refund; the refund status is in data..
| Value | Meaning | Description |
|---|---|---|
PENDING | In progress | The order is being processed or is waiting for a result. |
SUCCESS | Succeeded | The order transaction completed successfully; if a refund occurs later, the order status changes to REFUND. |
FAILED | Failed | The order transaction failed. |
REFUND | Refunded | A 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:
- After the original cashin order has been refunded,
data.isorderStatus REFUND. For a detailed description of each value and whether it is terminal, see theorderStatusenum of Query Payment by Order SN. data.orderStatus = REFUNDdoes not mean this refund succeeded. The result of this refund is determined only bydata.(status PENDING/SUCCESS/FAILED); whiledata.isstatus PENDING, keep querying or wait for the asynchronous notification.data.does not reflect refund amounts. UseorderStatus data.for this refund andrefundAmount data.for the cumulative refunded amount; to check whether the order has been fully refunded, comparerefund Total Amount data.withrefund Total Amount data..payAmount - State transition: the original cashin order can only move from
SUCCESStoREFUND; orders inPENDINGorFAILEDnever enterREFUND. An order can be partially refunded several times, and its status isREFUNDafter 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.
{
"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"
}
}