UNPKG

quickbooks-api

Version:

A modular TypeScript SDK for seamless integration with Intuit QuickBooks APIs. Provides robust authentication handling and future-ready foundation for accounting, payments, and commerce operations.

26 lines (25 loc) 813 B
/** * Get All Accounts * @param this - The Account API * @returns The Accounts */ export async function getAllAccounts(options = {}) { // Get the Query Builder const queryBuilder = await this.getQueryBuilder(); // Setup the Search Options (if provided) if (options.searchOptions) queryBuilder.setSearchOptions(options.searchOptions); // Setup the URL const url = queryBuilder.build(); // Get the Accounts const response = await this.apiClient.runRequest(url, { method: 'GET' }); // Format the Response const accounts = this.formatResponse(response); // Setup the Search Response const searchResponse = { results: accounts, hasNextPage: await this.hasNextPage(queryBuilder), }; // Return the Accounts return searchResponse; }