dinero-client
v1.2.4
Published
Node.js Api wrapper for Dinero.dk
Downloads
2
Readme
DineroClient
Node.js Api wrapper for Dinero.dk
Made like the api.dinero.dk documentation, use the body schemas and names of the endpoints.
Installation
Using NPM:
npm install dinero-client
Usage
Import and initalize
import DineroClient from 'dinero-client';
const dinero = new DineroClient("clientId","clientSecret");
//the company to access, call before every request, token expire after 1 hour
const org = await dinero.requestToken("orgApiKey","orgId");
Use the requested token of the Organization
List all invoices
org.invoices.list().then((invoices)=>{
console.log(invoices);
})
Create product
let new_product = {
"ProductNumber": "string",
"Name": "skrewdriver",
"BaseAmountValue": 20,
"Quantity": 5,
"AccountNumber": 1000,
"Unit": "parts",
"ExternalReference": "Fx. WebShopID:42",
"Comment": "Mix in a highball glass with ice."
}
org.products.create(new_product).then((create_response)=>{
console.log(create_response);
/*
Response => {
"ProductGuid": "f5a6eb71-e25c-4c30-baff-8e2cc43a9ff2"
}
*/
})