Embedding Invoice Generator
This is an example of how to embed the Invoice Generator in your website using the API.
Embedded Invoice Form
How It Works
This example demonstrates how to embed the Invoice Generator API in your website. Here's how it works:
- Fill out the form with company and customer information
- Add items with descriptions, quantities, and prices
- Click "Generate Invoice" to create an invoice using the API
- The generated invoice data will be displayed
- Click "Download PDF" to get a PDF version of the invoice
Implementation Steps:
- Include our JavaScript library in your page
- Create an HTML form for invoice data
- Handle form submission to send data to the API
- Process the API response to display or download the invoice
See our API Documentation for full details.
JavaScript Example
// Create and download an invoice
async function createInvoice() {
const response = await fetch('/api/create-invoice', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
company_name: "Your Company",
customer_name: "Client Name",
items: [
{
description: "Web Design",
quantity: 1,
unit_price: 1000
}
]
})
});
const data = await response.json();
console.log(data.invoice);
}