Skip to content
Start here

List Available Rate Plans

client.Zones.RatePlans.Get(ctx, query) (*SinglePage[RatePlanGetResponse], error)
GET/zones/{zone_id}/available_rate_plans

Lists all rate plans the zone can subscribe to.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Accepted Permissions (at least one required)
Billing WriteBilling Read
ParametersExpand Collapse
query RatePlanGetParams
ZoneID param.Field[string]

Identifier

maxLength32
ReturnsExpand Collapse
type RatePlanGetResponse struct{…}
ID stringoptional

Plan identifier tag.

Components []RatePlanGetResponseComponentoptional

Array of available components values for the plan.

Default float64optional

The default amount allocated.

Name RatePlanGetResponseComponentsNameoptional

The unique component.

One of the following:
const RatePlanGetResponseComponentsNameZones RatePlanGetResponseComponentsName = "zones"
const RatePlanGetResponseComponentsNamePageRules RatePlanGetResponseComponentsName = "page_rules"
const RatePlanGetResponseComponentsNameDedicatedCertificates RatePlanGetResponseComponentsName = "dedicated_certificates"
const RatePlanGetResponseComponentsNameDedicatedCertificatesCustom RatePlanGetResponseComponentsName = "dedicated_certificates_custom"
UnitPrice float64optional

The unit price of the addon.

Currency stringoptional

The monetary unit in which pricing information is displayed.

Duration float64optional

The duration of the plan subscription.

Frequency RatePlanGetResponseFrequencyoptional

The frequency at which you will be billed for this plan.

One of the following:
const RatePlanGetResponseFrequencyWeekly RatePlanGetResponseFrequency = "weekly"
const RatePlanGetResponseFrequencyMonthly RatePlanGetResponseFrequency = "monthly"
const RatePlanGetResponseFrequencyQuarterly RatePlanGetResponseFrequency = "quarterly"
const RatePlanGetResponseFrequencyYearly RatePlanGetResponseFrequency = "yearly"
Name stringoptional

The plan name.

maxLength80

List Available Rate Plans

package main

import (
  "context"
  "fmt"

  "github.com/cloudflare/cloudflare-go"
  "github.com/cloudflare/cloudflare-go/option"
  "github.com/cloudflare/cloudflare-go/zones"
)

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.Zones.RatePlans.Get(context.TODO(), zones.RatePlanGetParams{
    ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {
      "id": "free",
      "components": [
        {
          "default": 5,
          "name": "page_rules",
          "unit_price": 1
        }
      ],
      "currency": "USD",
      "duration": 1,
      "frequency": "monthly",
      "name": "Free Plan"
    }
  ],
  "success": true,
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": [
    {
      "id": "free",
      "components": [
        {
          "default": 5,
          "name": "page_rules",
          "unit_price": 1
        }
      ],
      "currency": "USD",
      "duration": 1,
      "frequency": "monthly",
      "name": "Free Plan"
    }
  ],
  "success": true,
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}