コンテンツにスキップ

サブスクリプションの管理

顧客がゾーンをプロビジョニングしたら、ゾーンおよびアカウントレベルのサブスクリプションを追加できます。

ゾーンサブスクリプション

ゾーンサブスクリプションの作成

To create a zone subscription, typically used to upgrade a zone’s plan from PARTNERS_FREE to a paid Zone plan, send a POST request to the /zones/{zone_id}/subscription endpoint and include the following values:

  • rate_plan object

    • Contains the zone plan corresponding to what customers would order in the dashboard. For a list of available values, refer to Zone subscriptions.
  • component_values array

    • Additional services depending on your reseller agreement, such as additional page_rules.
  • frequency string

    • How often the subscription is renewed automatically (defaults to "monthly").
Request (without `component_values`)
curl 'https://api.cloudflare.com/client/v4/zones/{zone_id}/subscription' \
--header "Authorization: Bearer <API_TOKEN>" \
--header "Content-Type: application/json" \
--data '{
"rate_plan": {
"id": "<RATE_PLAN>"
},
"frequency": "annual"
}'
Request (with `component_values`)
curl 'https://api.cloudflare.com/client/v4/zones/{zone_id}/subscription' \
--header "Authorization: Bearer <API_TOKEN>" \
--header "Content-Type: application/json" \
--data '{
"rate_plan": {
"id": "PARTNERS_BIZ"
},
"component_values": [
{
"name": "page_rules",
"value": 50
}
]
}

ゾーンサブスクリプションの詳細を取得

ゾーンサブスクリプションの詳細を取得するには、GETリクエストを/zones/<ZONE_ID>/subscriptionエンドポイントに送信します。

ゾーンサブスクリプションの更新

ゾーンのサブスクリプションを更新するには、通常は既存のサブスクリプションの’component_values’を更新するか、ゾーンのサブスクリプションをダウングレードするために、PUTリクエストを/zones/<ZONE_ID>/subscriptionエンドポイントに送信します。


アカウントサブスクリプション

契約に応じて、他のアドオンサービスを再販することが許可される場合があります。これらはアカウントレベルのサブスクリプションとしてプロビジョニングされます。

アカウントサブスクリプションの作成

To create an account subscription, send a POST request to the /accounts/{account_id}/subscriptions endpoint and include the following values:

  • rate_plan object

    • Contains the account subscription corresponding to a specific add-on service. For a list of available values, refer to Available subscriptions.
  • component_values array

    • Additional services depending on your reseller agreement, such as additional endpoints for load balancing or additional seats for Cloudflare Zero Trust. If not included, the subscription includes the default values associated with each purchase.
  • frequency string

    • How often the subscription is renewed automatically (defaults to "monthly").
Request
curl 'https://api.cloudflare.com/client/v4/accounts/{account_id}/subscriptions' \
--header "Authorization: Bearer <API_TOKEN>" \
--header "Content-Type: application/json" \
--data '{
"rate_plan": {
"id": "<RATE_PLAN_NAME>"
}
}'

アカウントサブスクリプションの詳細を取得

アカウントのすべてのサブスクリプションを取得するには、GETリクエストを/accounts/<ACCOUNT_ID>/subscriptionsエンドポイントに送信します。

アカウントサブスクリプションの更新

アカウントのサブスクリプションを更新するには、PUTリクエストを/accounts/<ACCOUNT_ID>/subscriptions/<SUBSCRIPTION_ID>エンドポイントに送信します。

アカウントサブスクリプションの削除

アカウントのサブスクリプションを削除するには、DELETEリクエストを/accounts/<ACCOUNT_ID>/subscriptions/<SUBSCRIPTION_ID>エンドポイントに送信します。