INTEGRITY Cloudflare Docs

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, 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:

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 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 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.


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:

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 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.