Skip to main content

List

Retrieves the list of customers associated with the specified reseller.

import { cloudApi, serviceClients, Session } from "@yandex-cloud/nodejs-sdk";

const ListCustomersRequest =
cloudApi.billing.customer_service.ListCustomersRequest;

(async () => {
const authToken = process.env["YC_OAUTH_TOKEN"];
const session = new Session({ oauthToken: authToken });
const client = session.client(serviceClients.CustomerServiceClient);

const result = await client.list(
ListCustomersRequest.fromPartial({
resellerId: "resellerId",
// pageSize: 0,
// pageToken: "pageToken"
})
);
console.log(result);
})();

ListCustomersRequest

resellerId : string

ID of the reseller.

pageSize : int64

The maximum number of results per page to return. If the number of available results is larger than page_size, the service returns a ListCustomersResponse.next_page_token that can be used to get the next page of results in subsequent list requests.

pageToken : string

Page token. To get the next page of results, set page_token to the ListCustomersResponse.next_page_token returned by a previous list request.

ListCustomersResponse

customers : Customer

List of customers.

nextPageToken : string

This token allows you to get the next page of results for list requests. If the number of results is larger than ListCustomersRequest.page_size, use next_page_token as the value for the ListCustomersRequest.page_token query parameter in the next list request. Each subsequent list request will have its own next_page_token to continue paging through the results.

Customer

A Customer resource.

id : string

ID of the customer.

billingAccountId : string

ID of the yandex.cloud.billing.v1.BillingAccount assigned to the customer.