Socket
Socket
Sign inDemoInstall

@invoicedesk/client

Package Overview
Dependencies
13
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @invoicedesk/client

This is the official SDK for the Invoice Desk API. If you would like to learn more about Inovice Desk, please visit https://inovicedesk.app.


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Official SDK for Invoice Desk API

This is the official SDK for the Invoice Desk API. If you would like to learn more about Inovice Desk, please visit https://inovicedesk.app.

This SDK is available on NPM at https://npmjs.com/@invoicedesk/sdk

This SDK allows you to easily interact with invoice desk's APIs. It fully typed requests, responses and entity objects so you don't have to refer to the documentation to get things rights.

Installation

npm
$ npm install @invoicedesk/sdk
yarn
$ yarn add @invoicedesk/sdk
pnpm
$ pnpm add @invoicedesk/sdk

Usage

All invocations requires a JWT token to authenticate requests with the server. The client accepts the following parameters on initialization. You can find the full documentation at Invoice Desk Docs page

ParameterDescriptionRequired?Default Value
hostInvoice Desk API hostNohttps://api.invoicedesk.app
versionThe version of the API to useNov1
import { InvoiceDesk } from '@invoicedesk/sdk';

const inoviceDesk = new InvoiceDesk();

Examples

Companies
async function listCompanies() {
  const companies = await invoiceDesk.companies.listCompanies({
    accountId: '...'
  });

  return companies;
}
Invoices
async function createInvoice(data) {
  const { data: invoice } = await invoiceDesk.invoices.createInvoice({
    createInvoicePayload: {
      clientId: "id-of-client-being-invoiced",
      date: "2021-01-01",
      currency: "USD",
      lineItems: [{
        title: "Nike Air",
        quantity: 1,
        price: 10000, // price in cents
        sortOrder: 0 // order the line item appears in the invoice
      }]
    },
    accountId: "...",
    companyId: "..."
  });

  return invoice;
}

Keywords

FAQs

Last updated on 31 Jul 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc