Retrieves the count of found accounts, given the provided filters and search capabilities.
This endpoint can help find the total count of accounts when used alongside Search Accounts.
function countAccounts(
options: CountAccountsOptions,
): Promise<CountAccountsResponse>;
import { accounts } from "@wix/loyalty";
/* Sample options value:
* {
* "options": null
* }
*/
export async function countAccounts(options) {
try {
const result = await accounts.countAccounts(options);
return result;
} catch (error) {
console.error(error);
// Handle the error
}
}
/* Promise resolves to:
* {
* "count": 3
* }
*/
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.