获取退款
获取指定退款的详情。
GET https://api.stripe.com/v1/refunds/{id}
示例
运行以下 cURL 命令发送请求。
cURL
curl -X GET https://api.stripe.com/v1/refunds/re_1Nispe2eZvKYlo2Cd31jOCgZ \
-u "<YOUR_SECRET_KEY>:"
参数
查询参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
expand[] | 字符串数组 | 可选 | 标识需要补充数据并内联返回的嵌套响应对象。 |
路径变量
| 名称 | 类型 | 必需 | 说明 |
|---|---|---|---|
id | 字符串 | 必需 | 要获取的退款 ID。 |
响应
响应使用标准状态码:200 表示成功,401 表示 API 密钥无效。请求未知退款 ID 时返回 404。完整列表见 Stripe 的错误代码。
200: OK
Response
{
"id": "re_1Nispe2eZvKYlo2Cd31jOCgZ",
"object": "refund",
"amount": 212,
"balance_transaction": "txn_1Nispe2eZvKYlo2CYezqFhEx",
"charge": "ch_1NirD82eZvKYlo2CIvbtLWuY",
"created": 1692942318,
"currency": "usd",
"destination_details": {
"card": {
"reference": "123456789012",
"reference_status": "available",
"reference_type": "acquirer_reference_number",
"type": "refund"
},
"type": "card"
},
"metadata": {},
"payment_intent": "pi_1GszsK2eZvKYlo2CfhZyoZLp",
"reason": null,
"receipt_number": null,
"source_transfer_reversal": null,
"status": "succeeded",
"transfer_reversal": null
}
错误响应
404: Not Found
Response
{
"error": {
"code": "resource_missing",
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
"message": "No such refund: 're_1Nispe2eZvKYlo2Cd31jOCgZ'",
"param": "id",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_UQf6XBwBl9yk66?t=1734829676",
"type": "invalid_request_error"
}
}
401: Unauthorized
Response
{
"error": {
"type": "invalid_request_error",
"message": "Invalid API Key provided: sk_test_********************1234"
}
}