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.

29 lines (28 loc) 995 B
/** * Get Updated Estimates * @param this - The Estimate API * @param lastUpdatedDate - The last updated date * @returns The Estimates */ export async function getUpdatedEstimates(lastUpdatedDate, options = {}) { // Get the Query Builder const queryBuilder = await this.getQueryBuilder(); // Setup the Last Updated Date Filter queryBuilder.whereLastUpdatedAfter(lastUpdatedDate); // Setup the Search Options (if provided) if (options.searchOptions) queryBuilder.setSearchOptions(options.searchOptions); // Setup the URL const url = queryBuilder.build(); // Get the Estimates const response = await this.apiClient.runRequest(url, { method: 'GET' }); // Format the Response const estimates = this.formatResponse(response); // Setup the Search Response const searchResponse = { results: estimates, hasNextPage: await this.hasNextPage(queryBuilder), }; // Return the Estimates return searchResponse; }