@ryanforever/invoice-generator
v1.0.6
Published
invoice-generator API wrapper
Downloads
69
Maintainers
Readme
invoice-generator
A wrapper for the API of https://invoice-generator.com
Requires an API key.
quickstart
const InvoiceGenerator = require("@ryanforever/invoice-generator")
const invoice = new InvoiceGenerator({
key: process.env.KEY // key from invoice-generator.com
// SET INVOICE DEFAULTS
name: "Ryan Forever",
address: "1234 Paradise Rd\nHollywood, CA, 94510",
phone: "555-555-5555",
logo: "https://example.com/my-logo.jpg",
})
invoice.generate({
title: "My Invoice",
clientName: "Apple, Inc",
clientAddress: "One Apple Park Way, Cupertino, California, 95014",
fields: {
poNumber: "0004501244",
},
items: [
{
name: "Hard Work",
rate: 10000,
description: "did alot of hard work"
}
]
})
/*
{
invoice: {
// invoice details
},
data: <Array Buffer to save as PDF>
}
*/