サブスクリプションの管理
顧客がゾーンをプロビジョニングしたら、ゾーンおよびアカウントレベルのサブスクリプションを追加できます。
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_planobject- Contains the zone plan corresponding to what customers would order in the dashboard. For a list of available values, refer to Zone subscriptions.
-
component_valuesarray- Additional services depending on your reseller agreement, such as additional
page_rules.
- Additional services depending on your reseller agreement, such as additional
-
frequencystring- How often the subscription is renewed automatically (defaults to
"monthly").
- How often the subscription is renewed automatically (defaults to
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"}'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_planobject- Contains the account subscription corresponding to a specific add-on service. For a list of available values, refer to Available subscriptions.
-
component_valuesarray- 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.
-
frequencystring- How often the subscription is renewed automatically (defaults to
"monthly").
- How often the subscription is renewed automatically (defaults to
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>エンドポイントに送信します。