列出所有退款
返回现有退款的列表。Stripe 按时间倒序显示退款,即最近的条目优先显示。响应默认包含最近的 10 笔退款。
GET https://api.stripe.com/v1/refunds
示例
cURL 示例:
cURL
curl -X GET https://api.stripe.com/v1/refunds \
-u <YOUR_SECRET_KEY>:
响应
响应返回标准代码。
200: OK
Response
{
"object": "list",
"url": "/v1/refunds",
"has_more": false,
"data": [
{
"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
}
]
}
错误响应
400: Bad Request
Response
{
"error": {
"code": "resource_missing",
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
"message": "No such charge: 'ch_1NirD82eZvKYlo2CIvbtLWuY'",
"param": "charge",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_HIH2jWkJGecwCk?t=1754504399",
"type": "invalid_request_error"
}
}
401: Unauthorized
Response
{
"error": {
"type": "invalid_request_error",
"message": "Invalid API Key provided: sk_test_********************1234"
}
}
参数
查询参数
| 参数 | 类型 | 说明 |
|---|---|---|
charge | 字符串 | 要查询退款的交易 ID。如果省略,Stripe 将返回该账户的所有退款。 |
created | 字典 | 返回仅在指定日期区间内创建的退款。该结果可以是一个包含以下键的字典:gt、gte、lt、lte。 |
ending_before | 字符串 | 用于分页的游标。使用对象 ID ending_before 来定义您在列表中的位置。如果您发起了一个列表请求并收到 100 条结果,其中第一条为 obj_bar,那么后续的调用可以包含 ending_before=obj_bar 来获取列表的上一页。 |
limit | 整数 | 限制响应中的记录数。请输入 1 到 100 之间的整数(默认值:10)。 |
payment_intent | 字符串 | 要查询退款的 PaymentIntent 的 ID。如果省略,Stripe 将返回该账户的所有退款。 |
starting_after | 字符串 | 用于分页的游标。使用对象 ID starting_after 来定义您在列表中的位置。 如果您发起一个列表查询并收到 100 条结果,最后一条以 obj_foo 结尾,则后续调用中可包含 starting_after=obj_foo 来获取列表的下一页。 |
expand[] | 字符串数组 | 用于标识需要进行数据增强并内联返回的嵌套响应对象。 |