列出所有 Payment Intent
返回 Payment Intent 列表。
GET https://api.stripe.com/v1/payment_intents
示例
运行以下 cURL 命令发送请求。
cURL
curl -X GET https://api.stripe.com/v1/payment_intents \
-u "<YOUR_SECRET_KEY>:"
参数
查询参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
ending_before | 字符串 | 可选 | 分页游标。传入当前页第一条记录的对象 ID 以获取上一页。 |
limit | 整数 | 可选 | 限制响应中的记录数。输入 1 到 100 的整数,默认值为 10。 |
starting_after | 字符串 | 可选 | 分页游标。传入当前页最后一条记录的对象 ID 以获取下一页。 |
expand[] | 字符串数组 | 可选 | 标识需要补充数据并内联返回的嵌套响应对象。 |
响应
成功时 Stripe 返回 200,参数校验失败时返回 400,API 密钥无效时返回 401。完整列表见 Stripe 的错误代码。
200: OK
Response
{
"object": "list",
"data": [
{
"id": "pi_1234567890",
"object": "payment_intent",
"amount": 1000,
"currency": "usd",
"status": "requires_confirmation"
}
],
"has_more": false,
"url": "/v1/payment_intents"
}
错误响应
400: Bad Request
Response
{
"error": {
"message": "If passing an array with explicit keys (e.g. foo[0]=a&foo[1]=b) instead of as an array (e.g. foo[]=a&foo[]=b), the keys must be numeric and sequential starting from 0. You passed the keys `1`, we expected to have a key with the value `0`.",
"param": "expand",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_kCeAL5FAly5bkh?t=1734734555",
"type": "invalid_request_error"
}
}
401: Unauthorized
Response
{
"error": {
"type": "invalid_request_error",
"message": "Invalid API Key provided: sk_test_********************1234"
}
}