---
title: Get Subscription
---

[Skip to content](#%5Ftop) 

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

[Accounts](https://developers.cloudflare.com/api/python/resources/accounts)

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

Copy Markdown

Open in **Claude**

Open in **ChatGPT**

Open in **Cursor**

---

**Copy Markdown**

**View as Markdown**

# Get Subscription

accounts.subscriptions.get\_by\_identifier(strsubscription\_identifier, SubscriptionGetByIdentifierParams\*\*kwargs)  \-> [Subscription](https://developers.cloudflare.com/api/python/resources/$shared#%28resource%29%20%24shared%20%3E%20%28model%29%20subscription%20%3E%20%28schema%29)

GET/accounts/{account\_id}/subscriptions/{subscription\_identifier}

Gets an account subscription by identifier.

##### Security

API Token

The preferred authorization scheme for interacting with the Cloudflare API. [Create a token](https://developers.cloudflare.com/fundamentals/api/get-started/create-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 Write` `Billing Read`

##### ParametersExpand Collapse 

account\_id: str

Identifier

maxLength32

subscription\_identifier: str

Subscription identifier tag.

maxLength32

##### ReturnsExpand Collapse 

class Subscription: …

id: Optional\[str\]

Subscription identifier tag.

maxLength32

currency: Optional\[str\]

The monetary unit in which pricing information is displayed.

current\_period\_end: Optional\[datetime\]

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

formatdate-time

current\_period\_start: Optional\[datetime\]

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

formatdate-time

frequency: Optional\[Literal\["weekly", "monthly", "quarterly", "yearly"\]\]

How often the subscription is renewed automatically.

One of the following:

"weekly"

"monthly"

"quarterly"

"yearly"

price: Optional\[float\]

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

rate\_plan: Optional\[RatePlan\]

The rate plan applied to the subscription.

id: Optional\[Literal\["free", "lite", "pro", 7 more\]\]

The ID of the rate plan.

One of the following:

"free"

"lite"

"pro"

"pro\_plus"

"business"

"enterprise"

"partners\_free"

"partners\_pro"

"partners\_business"

"partners\_enterprise"

currency: Optional\[str\]

The currency applied to the rate plan subscription.

externally\_managed: Optional\[bool\]

Whether this rate plan is managed externally from Cloudflare.

is\_contract: Optional\[bool\]

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

public\_name: Optional\[str\]

The full name of the rate plan.

scope: Optional\[str\]

The scope that this rate plan applies to.

sets: Optional\[List\[str\]\]

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

state: Optional\[Literal\["Trial", "Provisioned", "Paid", 4 more\]\]

The state that the subscription is in.

One of the following:

"Trial"

"Provisioned"

"Paid"

"AwaitingPayment"

"Cancelled"

"Failed"

"Expired"

### Get Subscription

Python

HTTPHTTP

TypeScriptTypeScript

PythonPython

GoGo

TerraformTerraform

```
import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
subscription = client.accounts.subscriptions.get_by_identifier(
    subscription_identifier="506e3185e9c882d175a2d0cb0093d9f2",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
print(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
}
```