*此内容使用人工智能(Beta)翻译,可能包含错误。若要查看英文页面,请点按 此处

Subscription

代表用户对订阅产品的订阅。订阅ID与订阅用户的用户ID相同。

属性

pathstring

订阅的资源路径。

格式:universes/{universe_id}/subscription-products/{subscription_product_id}/subscriptions/{subscription_id}.

createTimestring
仅输出

订阅创建时的时戳。. 此字符串格式为 FieldMask

updateTimestring
仅输出

订阅最后更新时的时戳。. 此字符串格式为 FieldMask

activeboolean
仅输出

订阅是否已激活。

这与 whether state 是否等于 SUBSCRIBED_WILL_RENEW、SUBSCRIBED_WILL_NOT_RENEW 或 SUBSCRIBED_RENEWAL_PAYMENT_PENDING 是否相等。.

willRenewboolean
仅输出

订阅是否会续订。

这与 whether state 是否等于 SUBSCRIBED_WILL_RENEW 或 SUBSCRIBED_RENEWAL_PAYMENT_PENDING 相等。.

lastBillingTimestring
仅输出

订阅最后一次收费时的时戳。. 此字符串格式为 FieldMask

nextRenewTimestring
仅输出

订阅下次自动续订时的时戳。. 此字符串格式为 FieldMask

expireTimestring
仅输出

订阅将过期或已过期时的时戳。. 此字符串格式为 FieldMask

stateEnum<string>
仅输出

订阅状态。

可能的值:

| 值 | 描述 | | --- | --- | | STATE_UNSPECIFIED | 订阅状态未指定。| | SUBSCRIBED_WILL_RENEW | 订阅已激活,将在 next_renew_time 自动续订。| | SUBSCRIBED_WILL_NOT_RENEW | 订阅已激活,但不会自动续订。| | SUBSCRIBED_RENEWAL_PAYMENT_PENDING | 订阅已激活,正在等待确认付款的续订期。| | 过期 | 订阅已过期。查看 expiration_details 获取更多信息。|. 可能的值:

expirationDetailsobject

关于订阅过期的信息。.

purchasePlatformEnum<string>
仅输出

购买订阅的平台。

可能的值:

| 值 | 描述 | | --- | --- | | PURCHASE_PLATFORM_UNSPECIFIED | 购买平台未指定。| | 桌面 | 订阅在 Roblox 网站上购买。| | 移动 | 订阅在 Roblox 移动应用程序上购买。 |. 可能的值:

paymentProviderEnum<string>
仅输出

用于购买订阅的付款提供商。

可能的值:

| 值 | 描述 | | --- | --- | | PAYMENT_PROVIDER_UNSPECIFIED | 支付提供商未指定。| | STRIPE | 订阅使用 Stripe 购买。| | APPLE | 订阅使用 Apple 购买。| | GOOGLE | 订阅使用 Google 购买。| | ROBLOX_CREDIT | 订阅使用 Roblox 积分购买。 |. 可能的值:

userstring
不可改变

订阅订阅的用户。.

基本网址

https://apis.roblox.com
Subscription 资源

{
"path": "universes/123/subscription-products/some-subscription-product-id/subscriptions/some-subscription-id",
"createTime": "2023-07-05T12:34:56Z",
"updateTime": "2023-07-05T12:34:56Z",
"active": true,
"willRenew": true,
"lastBillingTime": "2023-07-05T12:34:56Z",
"nextRenewTime": "2023-07-05T12:34:56Z",
"expireTime": "2023-07-05T12:34:56Z",
"state": "STATE_UNSPECIFIED",
"expirationDetails": {
"reason": "EXPIRATION_REASON_UNSPECIFIED"
},
"purchasePlatform": "PURCHASE_PLATFORM_UNSPECIFIED",
"paymentProvider": "PAYMENT_PROVIDER_UNSPECIFIED",
"user": "users/123"
}

Subscription

获取订阅
Beta

GET /cloud/v2/universes/{universe_id}/subscription-products/{subscription_product_id}/subscriptions/{subscription_id}

获取订阅。

universe.subscription-product.subscription:read 范围只允许您获取自己的订阅—或者说,订阅 ID 必须匹配用于发出请求的用户 ID—因此其最佳使用案例是使用 OAuth 2.0 认证而不是 API 密钥。要阅读宇宙的所有订阅,请使用 universe:write 范围。

范围
universe:writeuniverse.subscription-product.subscription:read
请求路径参数
universe_idstring
必填

宇宙ID。.

subscription_product_idstring
必填

订阅产品ID。.

subscription_idstring
必填

订阅ID。.

查询参数
viewEnum<string>

用于检索订阅的视图。

支持基础和全面。

默认为基础。

可能的值:

| 值 | 描述 | | --- | --- | | VIEW_UNSPECIFIED | 订阅视图未指定;默认将被使用。| | 基础 | 仅包含 activerenewing 字段。| | FULL | 包含所有字段。 |. 可能的值:

GET /cloud/v2/universes/{universe_id}/subscription-products/{subscription_product_id}/subscriptions/{subscription_id}

curl -L -X GET 'https://apis.roblox.com/cloud/v2/universes/{universe_id}/subscription-products/{subscription_product_id}/subscriptions/{subscription_id}?view={string}' \
-H 'x-api-key: {your-api-key}'
答复

{
"path": "universes/123/subscription-products/some-subscription-product-id/subscriptions/some-subscription-id",
"createTime": "2023-07-05T12:34:56Z",
"updateTime": "2023-07-05T12:34:56Z",
"active": true,
"willRenew": true,
"lastBillingTime": "2023-07-05T12:34:56Z",
"nextRenewTime": "2023-07-05T12:34:56Z",
"expireTime": "2023-07-05T12:34:56Z",
"state": "STATE_UNSPECIFIED",
"expirationDetails": {
"reason": "EXPIRATION_REASON_UNSPECIFIED"
},
"purchasePlatform": "PURCHASE_PLATFORM_UNSPECIFIED",
"paymentProvider": "PAYMENT_PROVIDER_UNSPECIFIED",
"user": "users/123"
}