@accounty/billit
v0.6.3
Published
<img src="https://cdn.jsdelivr.net/npm/@accounty/billit/banner.png" alt="Accounty — Many providers. One interface." />
Readme
@accounty/billit
Customers and sales invoices from Billit.
Installation
yarn add @accounty/billitUsage
Authentication: OAuth 2.0.
import Billit from '@accounty/billit'
const provider = new Billit({})
await provider.setCredentials({ accessToken: '<access-token>' })
const { data: invoices } = await provider.fetchInvoices()For OAuth authorization and token refresh, pass clientId, clientSecret, and redirectUri
to the constructor. Persist credentials returned by getOauthToken() or
setCredentials(). See the OAuth guide.
Supported behavior
fetchCompanies(),fetchInvoices(), andfetchInvoicesWithCompany()return normalized records.fetchCompanies({ version })andfetchInvoices({ version })use modification-date filters.- Pass
isSandbox: truein the constructor options to use the sandbox endpoints. downloadInvoice()is not implemented and throws.
Fetch methods return { data, version? }. Amounts are integer cents, dates are
Date objects, and remoteData preserves provider records. Filter support varies
by provider.
