跳到主要内容

列出订阅

检索订阅列表,支持按状态、客户、计划筛选和分页选项。

GEThttps://api.efundpay.com/v4/subscriptions
This endpoint requires the subscriptions.read scope.

Authorizations

Authorizationstringheaderrequired

Bearer认证头,格式为 `Bearer <token>`,其中 `<token>` 是您的认证令牌。

Headers

x-merchant-account-idstringrequired

用于此请求的商户账户ID。

Examples:""default""

Path Parameters

limitinteger

返回的最大项目数量。

Default:20
Range:1 <= x <= 100
Examples:"20"
cursorstring

指向要返回的结果页面的指针。

Examples:"0"
statusstring

按订阅状态筛选。

Examples:"active""failed""cancelled""past_due"
customer_idstring

按客户ID筛选。

Examples:"cus_abc123"

Response

application/json

Successful Response

objectstringrequired

对象类型,始终为"list"。

Examples:"list"
itemsSubscription · object[]required

返回的订阅对象列表。

limitintegerrequired

此页面的项目数量。

Examples:"20"
next_cursorstring | null

指向下一页项目的游标。

Examples:"2"
previous_cursorstring | null

指向前一页项目的游标。

Examples:"1"
curl --request GET \
--url https://api.efundpay.com/v4/subscriptions?status=active&limit=20 \
--header 'Authorization: Bearer <token>' \
--header 'x-merchant-account-id: <x-merchant-account-id>'
{
"items": [
{
"id": "sub_1234567890abcdef",
"object": "subscription",
"created": "2024-01-15T10:30:00Z",
"status": "active",
"customer": {
"id": "cus_abc123",
"display_name": "John Doe",
"external_identifier": "customer-12345",
"first_name": "John",
"last_name": "Doe",
"email_address": "john@example.com",
"phone_number": "+1234567890",
"account_number": "123456789"
},
"plan": {
"name": "Basic Monthly",
"currency": "USD",
"amount": 1000,
"interval": "month",
"trial_period_days": 14,
"billing_cycle_anchor": "immediate"
},
"payment_method": {
"token_id": "tok_a1b2c3d4",
"type": "card",
"card": {
"number": "4111111111111111",
"expiration_date": "12/27",
"security_code": "123"
}
},
"current_period_start": "2024-01-15T10:30:00Z",
"current_period_end": "2024-02-15T10:30:00Z",
"next_billing_date": "2024-02-15"
},
{
"id": "sub_abcdef1234567890",
"object": "subscription",
"created": "2024-01-10T08:15:00Z",
"status": "active",
"customer": {
"id": "cus_def456",
"display_name": "Jane Smith",
"external_identifier": "customer-67890",
"first_name": "Jane",
"last_name": "Smith",
"email_address": "jane@example.com",
"phone_number": "+1987654321",
"account_number": "987654321"
},
"plan": {
"name": "Premium Yearly",
"currency": "USD",
"amount": 9999,
"interval": "year",
"trial_period_days": 30,
"billing_cycle_anchor": "first_of_month"
},
"payment_method": {
"token_id": "tok_b2c3d4e5",
"type": "card",
"card": {
"number": "5555555555554444",
"expiration_date": "11/26",
"security_code": "456"
}
},
"current_period_start": "2024-01-10T08:15:00Z",
"current_period_end": "2025-01-10T08:15:00Z",
"next_billing_date": "2025-01-10"
}
],
"limit": 20,
"next_cursor": "ZXhhbXBsZTE",
"previous_cursor": "Xkjss7asS"
}
Powered by Docusaurus