@accounty/wefact
v1.1.3
Published
<img src="https://cdn.jsdelivr.net/npm/@accounty/wefact/banner.png" alt="Accounty — Many providers. One interface." />
Downloads
563
Readme
@accounty/wefact
Invoices and individual debtor records from WeFact.
Installation
yarn add @accounty/wefactUsage
Authentication: API key.
import WeFact from '@accounty/wefact'
const provider = new WeFact()
await provider.setCredentials({ apiKey: '<api-key>' })
const { data: invoices } = await provider.fetchInvoices()Supported behavior
fetchInvoices()returns normalized invoices.fetchCompany(remoteId)retrieves one debtor by its identifier.fetchCompanies()currently returns an empty array. The inheritedfetchInvoicesWithCompany()therefore does not populate company details; fetch debtors explicitly withfetchCompany(invoice.companyId).downloadInvoice(remoteId)expects the WeFact invoice code and returns a PDFBuffer, ornullwhen no PDF is returned.
Fetch methods return { data, version? }. Amounts are integer cents, dates are
Date objects, and remoteData preserves provider records. Filter support varies
by provider.
