economic-api-client
TypeScript icon, indicating that this package has built-in type declarations

1.1.6 • Public • Published

economic-api-client

An API client that interfaces with the Visma E-conomic REST API. Uses the ZOD library to validate responses and ensure type safety, trying to stay as true as possible to the JSON schemas provided by e-conomic, although some assumptions are made about the responses such as always expecting some values that are not specified as required in the JSON schema but are always present, such as customerNumber, draftInvoiceNumber and bookedInvoiceNumber.

Currently implemented endpoints

/customers

  • GET /customers
  • GET /customers/:customerNumber
  • POST /customers
  • DELETE /customers/:customerNumber

/invoices/drafts

  • GET /invoices/drafts
  • GET /invoices/drafts/:draftInvoiceNumber
  • GET /invoices/drafts/:draftInvoiceNumber/pdf
  • POST /invoices/drafts
  • PUT /invoices/drafts
  • DELETE /invoices/drafts/:draftInvoiceNumber

/invoices/booked

  • GET /invoices/booked
  • GET /invoices/booked/:bookedInvoiceNumber
  • GET /invoices/booked/:bookedInvoiceNumber/pdf
  • POST /invoices/booked/

Usage example

const economicClient = new EconomicClient(process.env.X_APP_SECRET_TOKEN, process.env.X_AGREEMENT_GRANT_TOKEN);

economicClient.customers.get().then((res) => {
  console.log(res);
});

Readme

Keywords

none

Package Sidebar

Install

npm i economic-api-client

Weekly Downloads

5

Version

1.1.6

License

MIT

Unpacked Size

290 kB

Total Files

11

Last publish

Collaborators

  • lakkenlak