Manage subscriptions
Once your customer has a zone provisioned, you can add zone and account-level subscriptions.
Zone subscriptions
Create zone subscription
To create a zone subscription, 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
Request (without `component_values`)curl -X POST 'https://api.cloudflare.com/client/v4/zones/<ZONE_ID>/subscription' \
-H 'Content-Type: application/json' \
-H 'x-auth-email: <EMAIL>' \
-H 'x-auth-key: <API_KEY>' \
-d '{ "rate_plan": { "id": "<RATE_PLAN>" }, "frequency": "annual"}'
Request (with `component_values`)curl -X POST 'https://api.cloudflare.com/client/v4/zones/<ZONE_ID>/subscription' \
-H 'Content-Type: application/json' \
-H 'x-auth-email: <EMAIL>' \
-H 'x-auth-key: <API_KEY>' \
-d '{ "rate_plan":{ "id":"PARTNERS_BIZ" }, "component_values":[ { "name": "page_rules", "value": 50 } ]
}
Get zone subscription details
To get the details of a zone subscription, send a GET
request to the /zones/<ZONE_ID>/subscription
endpoint.
Update zone subscription
To get the details of a zone subscription, send a PUT
request to the /zones/<ZONE_ID>/subscription
endpoint.
Account subscriptions
Depending on your agreement, you may be allowed to resell other add-on services. These are provisioned as account-level subscriptions.
Create account 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"
)
- How often the subscription is renewed automatically (defaults to
Requestcurl -X POST 'https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/subscriptions' \
-H 'Content-Type: application/json' \
-H 'x-auth-email: <EMAIL>' \
-H 'x-auth-key: <API_KEY>' \
-d '{ "rate_plan": { "id": "<rate plan name>" }}'
Get account subscription details
To get all subscriptions for an account, send a GET
request to the /accounts/<ACCOUNT_ID>/subscriptions
endpoint.
Update account subscription
To update a subscription on an account, send a PUT
request to the /accounts/<ACCOUNT_ID>/subscriptions/<SUBSCRIPTION_ID>
endpoint.
Delete account subscription
To delete a subscription on an account, send a DELETE
request to the /accounts/<ACCOUNT_ID>/subscriptions/<SUBSCRIPTION_ID>
endpoint.