---
title: Update Zone Subscription
---

[Skip to content](#_top)

[API Reference](https://developers.cloudflare.com/api/go)

[Zones](https://developers.cloudflare.com/api/go/resources/zones)

[Subscriptions](https://developers.cloudflare.com/api/go/resources/zones/subresources/subscriptions)

Copy Markdown

Open in **Claude**Open in **ChatGPT**Open in **Cursor**

---

**Copy Markdown****View as Markdown**

# Update Zone Subscription

client.Zones.Subscriptions.Update(ctx, params) (\*[SubscriptionUpdateResponse](<https://developers.cloudflare.com/api/go/resources/zones#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)>), error)

PUT/zones/{zone\_id}/subscription

Updates zone subscriptions, either plan or add-ons.

##### Security

<details>

<summary>API Token</summary>



The preferred authorization scheme for interacting with the Cloudflare API. <a href="https://developers.cloudflare.com/fundamentals/api/get-started/create-token/">Create a token</a>.

**Example:**<code>Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY</code>

</details>

<details>

<summary>API Email + API Key</summary>



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

**Example:**<code>X-Auth-Email: user@example.com</code>

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

**Example:**<code>X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194</code>

</details>

##### Accepted Permissions (at least one required)

`Billing Write`

##### ParametersExpand Collapse

<details>

<summary>

params SubscriptionUpdateParams

</summary>

ZoneID param.Field\[string]

Path param: Identifier

maxLength32

<a href="#(resource)%20zones.subscriptions%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20zone_id">Link to this property</a>

Subscription param.Field\[<a href="https://developers.cloudflare.com/api/go/resources/$shared#(resource)%20%24shared%20%3E%20(model)%20subscription%20%3E%20(schema)">Subscription</a>]

Body param

<a href="#(resource)%20zones.subscriptions%20%3E%20(method)%20update%20%3E%20(params)%20default%20%3E%20(param)%20subscription">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zones.subscriptions%20%3E%20(method)%20update%20%3E%20(params)%20default>)

##### ReturnsExpand Collapse

<details>

<summary>

type SubscriptionUpdateResponse struct{…}

</summary>

ID stringOptional

Subscription identifier tag.

maxLength32

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

Currency stringOptional

The monetary unit in which pricing information is displayed.

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20currency">Link to this property</a>

CurrentPeriodEnd TimeOptional

The end of the current period and also when the next billing is due.

formatdate-time

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20current_period_end">Link to this property</a>

CurrentPeriodStart TimeOptional

When the current billing period started. May match initial\_period\_start if this is the first period.

formatdate-time

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20current_period_start">Link to this property</a>

<details>

<summary>

Frequency SubscriptionUpdateResponseFrequencyOptional

How often the subscription is renewed automatically.

</summary>

One of the following:

const SubscriptionUpdateResponseFrequencyWeekly SubscriptionUpdateResponseFrequency = "weekly"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20frequency%20%3E%20(member)%200">Link to this property</a>

const SubscriptionUpdateResponseFrequencyMonthly SubscriptionUpdateResponseFrequency = "monthly"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20frequency%20%3E%20(member)%201">Link to this property</a>

const SubscriptionUpdateResponseFrequencyQuarterly SubscriptionUpdateResponseFrequency = "quarterly"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20frequency%20%3E%20(member)%202">Link to this property</a>

const SubscriptionUpdateResponseFrequencyYearly SubscriptionUpdateResponseFrequency = "yearly"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20frequency%20%3E%20(member)%203">Link to this property</a>

const SubscriptionUpdateResponseFrequencyNotApplicable SubscriptionUpdateResponseFrequency = "not-applicable"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20frequency%20%3E%20(member)%204">Link to this property</a>

</details>

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20frequency">Link to this property</a>

Price float64Optional

The price of the subscription that will be billed, in US dollars.

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20price">Link to this property</a>

<details>

<summary>

RatePlan <a href="https://developers.cloudflare.com/api/go/resources/$shared#(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)">RatePlan</a>Optional

The rate plan applied to the subscription.

</summary>

<details>

<summary>

ID RatePlanIDOptional

The ID of the rate plan.

</summary>

One of the following:

const RatePlanIDFree RatePlanID = "free"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20id%20%3E%20(member)%200">Link to this property</a>

const RatePlanIDLite RatePlanID = "lite"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20id%20%3E%20(member)%201">Link to this property</a>

const RatePlanIDPro RatePlanID = "pro"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20id%20%3E%20(member)%202">Link to this property</a>

const RatePlanIDProPlus RatePlanID = "pro\_plus"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20id%20%3E%20(member)%203">Link to this property</a>

const RatePlanIDBusiness RatePlanID = "business"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20id%20%3E%20(member)%204">Link to this property</a>

const RatePlanIDEnterprise RatePlanID = "enterprise"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20id%20%3E%20(member)%205">Link to this property</a>

const RatePlanIDPartnersFree RatePlanID = "partners\_free"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20id%20%3E%20(member)%206">Link to this property</a>

const RatePlanIDPartnersPro RatePlanID = "partners\_pro"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20id%20%3E%20(member)%207">Link to this property</a>

const RatePlanIDPartnersBusiness RatePlanID = "partners\_business"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20id%20%3E%20(member)%208">Link to this property</a>

const RatePlanIDPartnersEnterprise RatePlanID = "partners\_enterprise"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20id%20%3E%20(member)%209">Link to this property</a>

</details>

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

Currency stringOptional

The currency applied to the rate plan subscription.

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20currency">Link to this property</a>

ExternallyManaged boolOptional

Whether this rate plan is managed externally from Cloudflare.

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20externally_managed">Link to this property</a>

IsContract boolOptional

Whether a rate plan is enterprise-based (or newly adopted term contract).

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20is_contract">Link to this property</a>

PublicName stringOptional

The full name of the rate plan.

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20public_name">Link to this property</a>

Scope stringOptional

The scope that this rate plan applies to.

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20scope">Link to this property</a>

Sets \[]stringOptional

The list of sets this rate plan applies to. Returns array of strings.

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan%20%2B%20(resource)%20%24shared%20%3E%20(model)%20rate_plan%20%3E%20(schema)%20%3E%20(property)%20sets">Link to this property</a>

</details>

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20rate_plan">Link to this property</a>

<details>

<summary>

State SubscriptionUpdateResponseStateOptional

The state that the subscription is in.

</summary>

One of the following:

const SubscriptionUpdateResponseStateTrial SubscriptionUpdateResponseState = "Trial"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20state%20%3E%20(member)%200">Link to this property</a>

const SubscriptionUpdateResponseStateProvisioned SubscriptionUpdateResponseState = "Provisioned"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20state%20%3E%20(member)%201">Link to this property</a>

const SubscriptionUpdateResponseStatePaid SubscriptionUpdateResponseState = "Paid"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20state%20%3E%20(member)%202">Link to this property</a>

const SubscriptionUpdateResponseStateAwaitingPayment SubscriptionUpdateResponseState = "AwaitingPayment"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20state%20%3E%20(member)%203">Link to this property</a>

const SubscriptionUpdateResponseStateCancelled SubscriptionUpdateResponseState = "Cancelled"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20state%20%3E%20(member)%204">Link to this property</a>

const SubscriptionUpdateResponseStateFailed SubscriptionUpdateResponseState = "Failed"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20state%20%3E%20(member)%205">Link to this property</a>

const SubscriptionUpdateResponseStateExpired SubscriptionUpdateResponseState = "Expired"

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20state%20%3E%20(member)%206">Link to this property</a>

</details>

<a href="#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)%20%3E%20(property)%20state">Link to this property</a>

</details>

[Link to this property](<#(resource)%20zones.subscriptions%20%3E%20(model)%20SubscriptionUpdateResponse%20%3E%20(schema)>)

### Update Zone Subscription

Go

HTTPTypeScriptPythonGoTerraform

```
package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  subscription, err := client.Zones.Subscriptions.Update(context.TODO(), zones.SubscriptionUpdateParams{
    ZoneID: cloudflare.F("023e105f4ecef8ad9ca31a8372d0c353"),
    Subscription: shared.SubscriptionParam{

    },
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", subscription.ID)
}
```

200 example

```
{
  "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": "506e3185e9c882d175a2d0cb0093d9f2",
    "currency": "USD",
    "current_period_end": "2014-03-31T12:20:00Z",
    "current_period_start": "2014-05-11T12:20:00Z",
    "frequency": "monthly",
    "price": 20,
    "rate_plan": {
      "id": "free",
      "currency": "USD",
      "externally_managed": false,
      "is_contract": false,
      "public_name": "Business Plan",
      "scope": "zone",
      "sets": [
        "string"
      ]
    },
    "state": "Paid"
  },
  "success": true
}
```

##### Returns Examples

200 example

```
{
  "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": "506e3185e9c882d175a2d0cb0093d9f2",
    "currency": "USD",
    "current_period_end": "2014-03-31T12:20:00Z",
    "current_period_start": "2014-05-11T12:20:00Z",
    "frequency": "monthly",
    "price": 20,
    "rate_plan": {
      "id": "free",
      "currency": "USD",
      "externally_managed": false,
      "is_contract": false,
      "public_name": "Business Plan",
      "scope": "zone",
      "sets": [
        "string"
      ]
    },
    "state": "Paid"
  },
  "success": true
}
```