跳到主要内容

获取订阅

检索特定订阅的详细信息,包括当前状态、账单信息和客户详情。

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

Authorizations

Authorizationstringheaderrequired

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

Headers

x-merchant-account-idstringrequired

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

Examples:""default""

Path Parameters

subscription_idstringrequired

要检索的订阅的唯一标识符。

Examples:"sub_1234567890abcdef"

Response

application/json

Successful Response

idstringrequired

唯一订阅标识符。

Examples:"sub_1234567890abcdef"
objectstringrequired

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

Examples:"subscription"
createdstringrequired

订阅创建时间(ISO 8601)。

Examples:"2024-01-15T10:30:00Z"
updatedstringrequired

最后更新时间(ISO 8601)。

Examples:"2024-01-20T14:22:00Z"
statusstringrequired

订阅状态。

Examples:"active""failed""past_due""cancelled"
customerobjectrequired

带有生成ID的客户信息。

planobjectrequired

订阅计划详情。

payment_methodobjectrequired

支付方式详情。

current_period_startstringrequired

当前计费期开始时间。

Examples:"2024-01-15T10:30:00Z"
current_period_endstringrequired

当前计费期结束时间。

Examples:"2024-02-15T10:30:00Z"
next_billing_datestringrequired

下次计费日期(YYYY-MM-DD格式)。

Examples:"2024-02-15"
trial_startstring | null

试用期开始时间(如果适用)。

Examples:"null"
trial_endstring | null

试用期结束时间(如果适用)。

Examples:"null"
billing_detailsobjectrequired

账单信息和支付历史。

descriptionstring | null

订阅描述。

Examples:"Premium Plan Subscription"
metadataobject

自定义元数据。

Examples:"{}"
livemodebooleanrequired

这是否为生产模式订阅。

Examples:"false"
curl --request GET \
--url https://api.efundpay.com/v4/subscriptions/sub_1234567890abcdef \
--header 'Authorization: Bearer <token>' \
--header 'x-merchant-account-id: <x-merchant-account-id>'
{
"id": "sub_1234567890abcdef",
"object": "subscription",
"created": "2024-01-15T10:30:00Z",
"updated": "2024-01-20T14:22: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",
"trial_start": null,
"trial_end": null,
"billing_details": {
"payment_attempts": 0,
"last_payment_date": "2024-01-15T10:30:00Z",
"last_payment_status": "succeeded",
"next_retry_date": null
},
"description": "Premium Plan Subscription",
"metadata": {
"plan_name": "premium",
"user_tier": "gold"
},
"livemode": false
}
Powered by Docusaurus