Manage subscriptions
Once your customer has a zone provisioned, you can add zone and account-level subscriptions.
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
.
- Additional services depending on your reseller agreement, such as additional
-
frequency
string- How often the subscription is renewed automatically (defaults to
"monthly"
).
- How often the subscription is renewed automatically (defaults to
To get the details of a zone subscription, send a GET
request to the /zones/<ZONE_ID>/subscription
endpoint.
To update a subscription on a zone, typically used to update an existing subscription’s ‘component_values’ or to downgrade a zone’s subscription, send a PUT
request to the /zones/<ZONE_ID>/subscription
endpoint.
Depending on your agreement, you may be allowed to resell other add-on services. These are provisioned as account-level subscriptions.
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"
).
- How often the subscription is renewed automatically (defaults to
To get all subscriptions for an account, send a GET
request to the /accounts/<ACCOUNT_ID>/subscriptions
endpoint.
To update a subscription on an account, send a PUT
request to the /accounts/<ACCOUNT_ID>/subscriptions/<SUBSCRIPTION_ID>
endpoint.
To delete a subscription on an account, send a DELETE
request to the /accounts/<ACCOUNT_ID>/subscriptions/<SUBSCRIPTION_ID>
endpoint.