查询退款状态
请求方式和路径
POST /payin/v1/getRefundStatus
请求头
| 字段名 | 类型 | 必传 | 描述 |
|---|---|---|---|
| content-type | string | Yes | application/json |
| x-api-key | string | Yes | Paydify提供,跟appId相同 |
| x-api-timestamp | string | Yes | 时间戳,单位毫秒 |
| x-api-signature | string | Yes | 签名,具体参看签名算法 |
请求体
| 字段名 | 类型 | 必传 | 描述 |
|---|---|---|---|
| mchTxnId | string | 否 | 商户侧退款订单ID,mchTxnId、refundTxnId和paymentTxnId 不能同时为空 |
| refundTxnId | string | 否 | Paydify返回的退款订单ID,mchTxnId、refundTxnId和paymentTxnId 不能同时为空 |
| paymentTxnId | string | 否 | 关联的Paydify支付订单ID,mchTxnId、refundTxnId和paymentTxnId 不能同时为空 |
响应头参数
| 字段名 | 类型 | 必传 | 描述 |
|---|---|---|---|
| x-api-key | string | 是 | Paydify提供,跟appId相同 |
| x-api-timestamp | string | 是 | 时间戳,单位毫秒 |
| x-api-signature | string | 是 | 签名,具体参看签名算法 |
返回值
| 字段名 | 类型 | 描述 |
|---|---|---|
| code | string | 响应码,SYS_SUCCESS表示成功 |
| message | string | 响应消息 |
| messageDetail | string | 响应消息详情 |
| success | boolean | 是否成功 |
| data[i].refundTxnId | string | Paydify侧的退款订单ID |
| data[i].mchTxnId | string | 商户侧的订单ID |
| data[i].paymentTxnId | string | 关联的Paydify支付订单ID |
| data[i].txnHash | string | 链上的交易hash |
| data[i].txnAmount | string | 退款订单金额,假如币种currency是USDT,则1.23表示1.23USDT |
| data[i].currency | string | 退款币种 |
| data[i].payMethod2 | string | 支付使用的链,枚举值参看支持的链和币种 |
| data[i].appId | string | Paydify提供 |
| data[i].state | string | 退款状态,枚举值参看退款状态 |
| data[i].mchExtInfo | string | 商户扩展信息,JSON字符串 |
| data[i].errorMsg | string | 退款失败原因说明 |
| data[i].envType | string | appId标签,标记属于正式还是测试 |
| data[i].checkoutMode | int | 收银台模式,可选值:MERCHANT(商户下发支付金额)、CUSTOMER(顾客输入支付金额) |
| data[i].refundedTime | int | 退款成功的时间戳,单位毫秒,只有退款成功才有值 |
| data[i].createdTime | int | 支付发起的时间戳,单位毫秒 |
| data[i].updatedTime | int | 最近更新的时间戳,单位毫秒 |
请求示例
shell
# 请求
# 成功的返回值
{
"code": "SYS_SUCCESS",
"message": null,
"messageDetail": null,
"data": [{
"refundTxnId": "R2209141130105863014",
"txnHash": "0x123456789",
"paymentTxnId": "P220914xxx",
"txnAmount": "1.00",
"currency": "USDC",
"payMethod1": "bitkeep",
"payMethod2": "bnb",
"mchTxnId": "MCH_REFUND_123456",
"appId": "A1111",
"envType": "live",
"mchExtInfo": "{\"orderId\":\"123\"}",
"errorMsg": "",
"state": "pending",
"refundedTime": 1756725871000,
"createdTime": 1756697092000,
"updatedTime": 1756814549000
}],
"success": true
}
# 失败的返回值
{
"code": "SYS_ERROR",
"message": "System error",
"messageDetail": "Error details",
"data": null,
"success": false
}# 请求
# 成功的返回值
{
"code": "SYS_SUCCESS",
"message": null,
"messageDetail": null,
"data": [{
"refundTxnId": "R2209141130105863014",
"txnHash": "0x123456789",
"paymentTxnId": "P220914xxx",
"txnAmount": "1.00",
"currency": "USDC",
"payMethod1": "bitkeep",
"payMethod2": "bnb",
"mchTxnId": "MCH_REFUND_123456",
"appId": "A1111",
"envType": "live",
"mchExtInfo": "{\"orderId\":\"123\"}",
"errorMsg": "",
"state": "pending",
"refundedTime": 1756725871000,
"createdTime": 1756697092000,
"updatedTime": 1756814549000
}],
"success": true
}
# 失败的返回值
{
"code": "SYS_ERROR",
"message": "System error",
"messageDetail": "Error details",
"data": null,
"success": false
}