/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..
Endpoint
| Item | Value |
|---|---|
| Method | GET |
| Path | /cashin/check-refund |
| Content-Type | application/json |
| Purpose | Query a cashin refund order |
Access Requirements
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 Example
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=<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:
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. 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 omitted when the request fails at signature verification, protocol parsing, parameter validation, or order lookup. |
data. | string | 64 | Yes | Partner-specific. Sub-merchant ID. |
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 | attach value the partner submitted when placing the original payment order; returned as-is if it was submitted, 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
| 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 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.
{
"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
- The query scope is limited to the primary merchant ID in the
X-Merchant-Idrequest header;subMerchantNois not required, and refund data of other partners cannot be queried by order number. data.is the only refund status field for judging the refund result; the API-levelstatus status = 200must not be treated as refund success, anddata.is the status of the original cashin order and must not be used to judge the refund result.orderStatus - 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.
- 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
refundSnand the refund status.