---
title: Get Payment Method
---

[Skip to content](#_top)

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

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

[Payment Methods](https://developers.cloudflare.com/api/python/resources/accounts/subresources/payment_methods)

Copy Markdown

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

---

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

# Get Payment Method

accounts.payment\_methods.get(strpayment\_method\_id, PaymentMethodGetParams\*\*kwargs) -> [PaymentMethodGetResponse](<https://developers.cloudflare.com/api/python/resources/accounts#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)>)

GET/accounts/{account\_id}/payment-methods/{payment\_method\_id}

Gets a specific payment method for an account.

##### 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``Billing Read`

##### ParametersExpand Collapse

account\_id: str

Identifier

maxLength32

[Link to this property](<#(resource)%20accounts.payment_methods%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20account_id%20%3E%20(schema)>)

payment\_method\_id: str

Identifier

maxLength32

[Link to this property](<#(resource)%20accounts.payment_methods%20%3E%20(method)%20get%20%3E%20(params)%20default%20%3E%20(param)%20payment_method_id%20%3E%20(schema)>)

##### ReturnsExpand Collapse

<details>

<summary>

class PaymentMethodGetResponse: …

</summary>

id: Optional\[str]

Payment method identifier.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20id">Link to this property</a>

address: Optional\[str]

Billing address line 1.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20address">Link to this property</a>

address2: Optional\[str]

Billing address line 2.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20address2">Link to this property</a>

bank\_account\_type: Optional\[str]

Bank account type.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20bank_account_type">Link to this property</a>

bank\_code: Optional\[str]

Bank code.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20bank_code">Link to this property</a>

bank\_country: Optional\[str]

Bank country.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20bank_country">Link to this property</a>

bank\_name: Optional\[str]

Bank name for bank-based payment methods.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20bank_name">Link to this property</a>

bank\_routing\_number: Optional\[str]

Bank routing number.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20bank_routing_number">Link to this property</a>

cashapp\_cash\_tag: Optional\[str]

Cash App cash tag.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20cashapp_cash_tag">Link to this property</a>

city: Optional\[str]

Billing city.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20city">Link to this property</a>

country: Optional\[str]

Billing country.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20country">Link to this property</a>

default: Optional\[bool]

Whether this is the default payment method.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20default">Link to this property</a>

device\_data: Optional\[str]

Device data for fraud prevention.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20device_data">Link to this property</a>

expiration\_date: Optional\[str]

Card expiration date.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20expiration_date">Link to this property</a>

first\_name: Optional\[str]

Billing first name.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20first_name">Link to this property</a>

last\_four: Optional\[str]

Last four digits of the card number.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20last_four">Link to this property</a>

last\_name: Optional\[str]

Billing last name.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20last_name">Link to this property</a>

nick\_name: Optional\[str]

A nickname for the payment method.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20nick_name">Link to this property</a>

payment\_account\_email: Optional\[str]

Email associated with the payment account.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20payment_account_email">Link to this property</a>

payment\_email: Optional\[str]

Payment email address.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20payment_email">Link to this property</a>

payment\_gateway: Optional\[str]

The payment gateway used.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20payment_gateway">Link to this property</a>

payment\_nonce: Optional\[str]

Payment nonce for tokenized payments.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20payment_nonce">Link to this property</a>

state: Optional\[str]

Billing state.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20state">Link to this property</a>

<details>

<summary>

type: Optional\[Literal\["CREDIT\_CARD", "PAYPAL", "CASHAPP", 3 more]]

The payment method type.

</summary>

One of the following:

"CREDIT\_CARD"

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%200">Link to this property</a>

"PAYPAL"

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%201">Link to this property</a>

"CASHAPP"

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%202">Link to this property</a>

"SEPA\_DEBIT"

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%203">Link to this property</a>

"LINK"

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%204">Link to this property</a>

"ACH\_DIRECT\_DEBIT"

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20type%20%3E%20(member)%205">Link to this property</a>

</details>

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20type">Link to this property</a>

zipcode: Optional\[str]

Billing zip code.

<a href="#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)%20%3E%20(property)%20zipcode">Link to this property</a>

</details>

[Link to this property](<#(resource)%20accounts.payment_methods%20%3E%20(model)%20payment_method_get_response%20%3E%20(schema)>)

### Get Payment Method

Python

HTTPTypeScriptPythonGoTerraform

```
import os
from cloudflare import Cloudflare

client = Cloudflare(
    api_token=os.environ.get("CLOUDFLARE_API_TOKEN"),  # This is the default and can be omitted
)
payment_method = client.accounts.payment_methods.get(
    payment_method_id="023e105f4ecef8ad9ca31a8372d0c353",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
print(payment_method.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": "id",
    "address": "address",
    "address2": "address2",
    "bank_account_type": "bank_account_type",
    "bank_code": "bank_code",
    "bank_country": "bank_country",
    "bank_name": "bank_name",
    "bank_routing_number": "bank_routing_number",
    "cashapp_cash_tag": "cashapp_cash_tag",
    "city": "city",
    "country": "country",
    "default": true,
    "expiration_date": "expiration_date",
    "first_name": "first_name",
    "last_four": "4242",
    "last_name": "last_name",
    "nick_name": "nick_name",
    "payment_account_email": "payment_account_email",
    "payment_email": "payment_email",
    "state": "state",
    "type": "CREDIT_CARD",
    "zipcode": "zipcode"
  },
  "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": "id",
    "address": "address",
    "address2": "address2",
    "bank_account_type": "bank_account_type",
    "bank_code": "bank_code",
    "bank_country": "bank_country",
    "bank_name": "bank_name",
    "bank_routing_number": "bank_routing_number",
    "cashapp_cash_tag": "cashapp_cash_tag",
    "city": "city",
    "country": "country",
    "default": true,
    "expiration_date": "expiration_date",
    "first_name": "first_name",
    "last_four": "4242",
    "last_name": "last_name",
    "nick_name": "nick_name",
    "payment_account_email": "payment_account_email",
    "payment_email": "payment_email",
    "state": "state",
    "type": "CREDIT_CARD",
    "zipcode": "zipcode"
  },
  "success": true
}
```