Options
All
  • Public
  • Public/Protected
  • All
Menu

Class QBOClient

Hierarchy

  • QBOClient

Index

Constructors

constructor

  • new QBOClient(clientId: string, clientSecret: string, companyId: string, sandbox?: boolean): QBOClient
  • Parameters

    • clientId: string
    • clientSecret: string
    • companyId: string
    • Default value sandbox: boolean = true

    Returns QBOClient

Properties

Private accessToken

accessToken: string = ""

Private baseUrl

baseUrl: string = ""

Private clientId

clientId: string = ""

Private clientSecret

clientSecret: string = ""

Private companyId

companyId: string = ""

Private environment

environment: string = "sandbox"

Private minorversion

minorversion: string = "8"

Private onRefreshListener

onRefreshListener: null | function = null

Private productionUrl

productionUrl: string = "https://quickbooks.api.intuit.com"

Private refreshToken

refreshToken: string = ""

Private sandboxUrl

sandboxUrl: string = "https://sandbox-quickbooks.api.intuit.com"

Methods

batchQueries

createInvoice

Private endPoint

  • endPoint(path: string, includeMinorVersion?: boolean): string
  • Parameters

    • path: string
    • Default value includeMinorVersion: boolean = true

    Returns string

getAccessToken

  • getAccessToken(): string

getActiveCustomers

getAllCustomers

getArchivedCustomers

getCompanyId

  • getCompanyId(): string

getCustomer

getCustomerHierarchy

  • getCustomerHierarchy(name: string): Promise<QBOCustomer>
  • Gets a company's hierarchy based on parent/children relationship between them.

    todo

    parent/children relationship is hardcoded for Allen & Co

    Parameters

    • name: string

    Returns Promise<QBOCustomer>

getCustomerInvoices

  • getCustomerInvoices(clientId: number, startDate?: string, endDate?: string): Promise<QBOInvoice[]>
  • Parameters

    • clientId: number
    • Default value startDate: string = ""
    • Default value endDate: string = ""

    Returns Promise<QBOInvoice[]>

getEnvironment

  • getEnvironment(): string

getLastClientInvoice

  • getLastClientInvoice(clientId: number): Promise<QBOInvoice | null>

Private getRefreshToken

  • getRefreshToken(): Promise<any>

getServiceBySKU

  • getServiceBySKU(sku: string): Promise<QBOService | null>

getServiceItemById

  • getServiceItemById(serviceId: number): Promise<QBOService | null>

getServicesByCategory

  • getServicesByCategory(categoryId: number): Promise<QBOService[]>

getTerms

Private sendRequest

  • 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.

    Parameters

    Returns Promise<any>

setAccessToken

  • setAccessToken(token: string, refreshToken?: string): void
  • Parameters

    • token: string
    • Default value refreshToken: string = ""

    Returns void

setOnRefreshToken

  • setOnRefreshToken(listener: function): void
  • Parameters

    • listener: function
        • (token: string, refreshToken: string): void
        • Parameters

          • token: string
          • refreshToken: string

          Returns void

    Returns void

Generated using TypeDoc