# Method: accounts.customers.queryEligibleBillingAccounts

- [HTTP request](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#body.request_body)
- [Response body](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#body.QueryEligibleBillingAccountsResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#body.aspect)
- [SkuPurchaseGroup](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#SkuPurchaseGroup)
  - [JSON representation](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#SkuPurchaseGroup.SCHEMA_REPRESENTATION)
- [BillingAccountPurchaseInfo](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#BillingAccountPurchaseInfo)
  - [JSON representation](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#BillingAccountPurchaseInfo.SCHEMA_REPRESENTATION)
- [BillingAccount](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#BillingAccount)
  - [JSON representation](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#BillingAccount.SCHEMA_REPRESENTATION)
- [Try it!](https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#try-it)

Lists the billing accounts that are eligible to purchase particular SKUs for a given customer.

Possible error codes:

- PERMISSION_DENIED: The customer doesn't belong to the reseller.
- INVALID_ARGUMENT: Required request parameters are missing or invalid.

Return value: Based on the provided list of SKUs, returns a list of SKU groups that must be purchased using the same billing account and the billing accounts eligible to purchase each SKU group.

### HTTP request

`GET https://cloudchannel.googleapis.com/v1alpha1/{customer=accounts/*/customers/*}:queryEligibleBillingAccounts`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `customer` | `string` Required. The resource name of the customer to list eligible billing accounts for. Format: accounts/{account_id}/customers/{customer_id}. |

### Query parameters

| Parameters ||
|---|---|
| `skus[]` | `string` Required. List of SKUs to list eligible billing accounts for. At least one SKU is required. Format: products/{productId}/skus/{skuId}. |

### Request body

The request body must be empty.

### Response body

Response message for customers.queryEligibleBillingAccounts.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "skuPurchaseGroups": [ { object (`https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#SkuPurchaseGroup`) } ] } ``` |

| Fields ||
|---|---|
| `skuPurchaseGroups[]` | ``object (`https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#SkuPurchaseGroup`)`` List of SKU purchase groups where each group represents a set of SKUs that must be purchased using the same billing account. Each SKU from \[QueryEligibleBillingAccountsRequest.skus\] will appear in exactly one SKU group. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/apps.order`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

## SkuPurchaseGroup

Represents a set of SKUs that must be purchased using the same billing account.

| JSON representation |
|---|
| ``` { "skus": [ string ], "billingAccountPurchaseInfos": [ { object (`https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#BillingAccountPurchaseInfo`) } ] } ``` |

| Fields ||
|---|---|
| `skus[]` | `string` Resource names of the SKUs included in this group. Format: products/{productId}/skus/{skuId}. |
| `billingAccountPurchaseInfos[]` | ``object (`https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#BillingAccountPurchaseInfo`)`` List of billing accounts that are eligible to purhcase these SKUs. |

## BillingAccountPurchaseInfo

Represents a billing account that can be used to make a purchase.

| JSON representation |
|---|
| ``` { "billingAccount": { object (`https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#BillingAccount`) } } ``` |

| Fields ||
|---|---|
| `billingAccount` | ``object (`https://docs.cloud.google.com/channel/docs/reference/rest/v1alpha1/accounts.customers/queryEligibleBillingAccounts#BillingAccount`)`` The billing account resource. |

## BillingAccount

Represents a billing account.

| JSON representation |
|---|
| ``` { "name": string, "displayName": string, "createTime": string, "currencyCode": string, "regionCode": string } ``` |

| Fields ||
|---|---|
| `name` | `string` Output only. Resource name of the billing account. Format: accounts/{account_id}/billingAccounts/{billing_account_id}. |
| `displayName` | `string` Display name of the billing account. |
| `createTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Output only. The time when this billing account was created. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `currencyCode` | `string` Output only. The 3-letter currency code defined in ISO 4217. |
| `regionCode` | `string` Output only. The CLDR region code. |