# Billing # History ## Billing History Details `client.User.Billing.History.List(ctx, query) (*V4PagePaginationArray[BillingHistory], error)` **get** `/user/billing/history` Accesses your billing history object. ### Parameters - `query BillingHistoryListParams` - `Action param.Field[string]` The billing item action. - `OccurredAt param.Field[Time]` When the billing item was created. - `Order param.Field[BillingHistoryListParamsOrder]` Field to order billing history by. - `const BillingHistoryListParamsOrderType BillingHistoryListParamsOrder = "type"` - `const BillingHistoryListParamsOrderOccurredAt BillingHistoryListParamsOrder = "occurred_at"` - `const BillingHistoryListParamsOrderAction BillingHistoryListParamsOrder = "action"` - `Page param.Field[float64]` Page number of paginated results. - `PerPage param.Field[float64]` Number of items per page. - `Type param.Field[string]` The billing item type. ### Returns - `type BillingHistory struct{…}` - `ID string` Billing item identifier tag. - `Action string` The billing item action. - `Amount float64` The amount associated with this billing item. - `Currency string` The monetary unit in which pricing information is displayed. - `Description string` The billing item description. - `OccurredAt Time` When the billing item was created. - `Type string` The billing item type. - `Zone BillingHistoryZone` - `Name string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" "github.com/cloudflare/cloudflare-go/user" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) page, err := client.User.Billing.History.List(context.TODO(), user.BillingHistoryListParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", page) } ``` #### Response ```json { "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": "b69a9f3492637782896352daae219e7d", "action": "subscription", "amount": 20.99, "currency": "USD", "description": "The billing item description", "occurred_at": "2014-03-01T12:21:59.3456Z", "type": "charge", "zone": { "name": "name" } } ], "success": true, "result_info": { "count": 1, "page": 1, "per_page": 20, "total_count": 2000 } } ``` ## Domain Types ### Billing History - `type BillingHistory struct{…}` - `ID string` Billing item identifier tag. - `Action string` The billing item action. - `Amount float64` The amount associated with this billing item. - `Currency string` The monetary unit in which pricing information is displayed. - `Description string` The billing item description. - `OccurredAt Time` When the billing item was created. - `Type string` The billing item type. - `Zone BillingHistoryZone` - `Name string` # Profile ## Billing Profile Details `client.User.Billing.Profile.Get(ctx) (*BillingProfileGetResponse, error)` **get** `/user/billing/profile` Accesses your billing profile object. ### Returns - `type BillingProfileGetResponse struct{…}` - `ID string` Billing item identifier tag. - `AccountType string` - `Address string` - `Address2 string` - `Balance string` - `CardExpiryMonth int64` - `CardExpiryYear int64` - `CardNumber string` - `City string` - `Company string` - `Country string` - `CreatedOn Time` - `DeviceData string` - `EditedOn Time` - `EnterpriseBillingEmail string` - `EnterprisePrimaryEmail string` - `FirstName string` - `IsPartner bool` - `LastName string` - `NextBillDate Time` - `PaymentAddress string` - `PaymentAddress2 string` - `PaymentCity string` - `PaymentCountry string` - `PaymentEmail string` - `PaymentFirstName string` - `PaymentGateway string` - `PaymentLastName string` - `PaymentNonce string` - `PaymentState string` - `PaymentZipcode string` - `PrimaryEmail string` - `State string` - `TaxIDType string` - `Telephone string` - `UseLegacy bool` - `ValidationCode string` - `Vat string` - `Zipcode string` ### Example ```go package main import ( "context" "fmt" "github.com/cloudflare/cloudflare-go" "github.com/cloudflare/cloudflare-go/option" ) func main() { client := cloudflare.NewClient( option.WithAPIToken("Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY"), ) profile, err := client.User.Billing.Profile.Get(context.TODO()) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", profile.ID) } ``` #### Response ```json { "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": "b69a9f3492637782896352daae219e7d", "account_type": "type", "address": "123 Main Street", "address2": "Apt 1", "balance": "0", "card_expiry_month": 12, "card_expiry_year": 2099, "card_number": "4242424242424242", "city": "Anytown", "company": "Company", "country": "Anycountry", "created_on": "2014-03-01T12:21:59.3456Z", "device_data": "sample_data", "edited_on": "2014-03-01T12:21:59.3456Z", "enterprise_billing_email": "johndoe@gmail.com", "enterprise_primary_email": "johndoe@gmail.com", "first_name": "John", "is_partner": false, "last_name": "Doe", "next_bill_date": "2014-03-01T12:21:59.3456Z", "payment_address": "123 Main Street", "payment_address2": "Apt 1", "payment_city": "Anytown", "payment_country": "Anycountry", "payment_email": "johndoe@gmail.com", "payment_first_name": "John", "payment_gateway": "gateway", "payment_last_name": "Doe", "payment_nonce": "abc123", "payment_state": "state", "payment_zipcode": "12345", "primary_email": "johndoe@gmail.com", "state": "AnyState", "tax_id_type": "type", "telephone": "1234567899", "use_legacy": false, "validation_code": "1111", "vat": "GB123456789", "zipcode": "12345" }, "success": true } ```