Skip to content
Start here

List Payment Methods

client.Accounts.PaymentMethods.List(ctx, params) (*V4PagePaginationArray[PaymentMethodListResponse], error)
GET/accounts/{account_id}/payment-methods

Lists all payment methods for an account.

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
params PaymentMethodListParams
AccountID param.Field[string]

Path param: Identifier

maxLength32
Page param.Field[int64]Optional

Query param: Page number of paginated results.

minimum1
PerPage param.Field[int64]Optional

Query param: Number of items per page.

minimum1
ReturnsExpand Collapse
type PaymentMethodListResponse struct{…}
ID stringOptional

Payment method identifier.

Address stringOptional

Billing address line 1.

Address2 stringOptional

Billing address line 2.

BankAccountType stringOptional

Bank account type.

BankCode stringOptional

Bank code.

BankCountry stringOptional

Bank country.

BankName stringOptional

Bank name for bank-based payment methods.

BankRoutingNumber stringOptional

Bank routing number.

CashappCashTag stringOptional

Cash App cash tag.

City stringOptional

Billing city.

Country stringOptional

Billing country.

Default boolOptional

Whether this is the default payment method.

DeviceData stringOptional

Device data for fraud prevention.

ExpirationDate stringOptional

Card expiration date.

FirstName stringOptional

Billing first name.

LastFour stringOptional

Last four digits of the card number.

LastName stringOptional

Billing last name.

NickName stringOptional

A nickname for the payment method.

PaymentAccountEmail stringOptional

Email associated with the payment account.

PaymentEmail stringOptional

Payment email address.

PaymentGateway stringOptional

The payment gateway used.

PaymentNonce stringOptional

Payment nonce for tokenized payments.

State stringOptional

Billing state.

Type PaymentMethodListResponseTypeOptional

The payment method type.

One of the following:
const PaymentMethodListResponseTypeCreditCard PaymentMethodListResponseType = "CREDIT_CARD"
const PaymentMethodListResponseTypePaypal PaymentMethodListResponseType = "PAYPAL"
const PaymentMethodListResponseTypeCashapp PaymentMethodListResponseType = "CASHAPP"
const PaymentMethodListResponseTypeSepaDebit PaymentMethodListResponseType = "SEPA_DEBIT"
const PaymentMethodListResponseTypeLink PaymentMethodListResponseType = "LINK"
const PaymentMethodListResponseTypeACHDirectDebit PaymentMethodListResponseType = "ACH_DIRECT_DEBIT"
Zipcode stringOptional

Billing zip code.

List Payment Methods

package main

import (
  "context"
  "fmt"

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

func main() {
  client := cloudflare.NewClient(
    option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"),
  )
  page, err := client.Accounts.PaymentMethods.List(context.TODO(), accounts.PaymentMethodListParams{
    AccountID: 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": "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,
  "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": "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,
  "result_info": {
    "count": 1,
    "page": 1,
    "per_page": 20,
    "total_count": 2000
  }
}