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.

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