import { QBOSaleItem, QBOService, QBOCustomer, QBOInvoice, QBOBatchItemRequest, QBOBatchItemResponse, QBOTerms } from './models'; declare class QBOClient { private sandboxUrl; private productionUrl; private baseUrl; private clientId; private clientSecret; private companyId; private accessToken; private refreshToken; private environment; private minorversion; private onRefreshListener; constructor(clientId: string, clientSecret: string, companyId: string, sandbox?: boolean); setAccessToken(token: string, refreshToken?: string): void; getAccessToken(): string; getEnvironment(): string; getCompanyId(): string; setOnRefreshToken(listener: (token: string, refreshToken: string) => void): void; private getRefreshToken; private endPoint; /** * Sends a request to QuickBooks Server. * This method checks for the response. If it responds with 401, * then tries to refresh the Access Token and the retries the request. */ private sendRequest; /** * Creates a new Invoice in QBO. * @link https://developer.intuit.com/docs/api/accounting/invoice * @param customerId * @param items * @param extra */ createInvoice(customerId: number, items: QBOSaleItem[], extra?: any): Promise; /** * Retrieves the full list of Customers from QuickBooks API. * @link https://developer.intuit.com/docs/api/accounting/customer */ getAllCustomers(): Promise; /** * Retrieves the list of Customers that are marked as 'active' from QuickBooks API. * @link https://developer.intuit.com/docs/api/accounting/customer */ getActiveCustomers(): Promise; /** * Retrieves the list of Customers that are marked as 'archived' from QuickBooks API. * @link https://developer.intuit.com/docs/api/accounting/customer */ getArchivedCustomers(): Promise; /** * Retrieves a Customer by name from QuickBooks API. * @link https://developer.intuit.com/docs/api/accounting/customer */ getCustomer(name: string): Promise; getCustomerById(customerId: number): Promise; /** * Gets a company's hierarchy based on parent/children relationship between them. * @todo parent/children relationship is hardcoded for Allen & Co */ getCustomerHierarchy(name: string): Promise; /** * Gets a service given its id. * @param serviceId */ getServiceItemById(serviceId: number): Promise; /** * Get a list of items whose parent category is the specified. * Useful for finding the developer's service which share a common parent category. * @param categoryId */ getServicesByCategory(categoryId: number): Promise; /** * Retrieves a Service by SKU from QuickBooks API. * @link https://developer.intuit.com/docs/api/accounting/item */ getServiceBySKU(sku: string): Promise; /** * Get the last invoice created for a Customer. * @param clientId */ getLastClientInvoice(clientId: number): Promise; getCustomerInvoices(clientId: number, startDate?: string, endDate?: string): Promise; batchQueries(requests: QBOBatchItemRequest[]): Promise; /** * Retrieves the list of Terms for the Invoices. * @link https://developer.intuit.com/docs/api/accounting/term */ getTerms(): Promise; /** * Retrieves the report of Profit and Loss. * @link https://developer.intuit.com/docs/api/accounting/profit-and-loss-detail * @param startDate * @param endDate */ getProfitAndLoss(startDate: string, endDate: string): Promise; } export { QBOClient };