### Line Item Parameters Example Source: https://github.com/invoice-generator/invoice-generator-api/blob/master/README.md This JSON example illustrates the structure for defining line items in an invoice. Each item can include a name, quantity, unit cost, and an optional description. ```json { "items": [ { "name": "Gizmo", "quantity": 10, "unit_cost": 99.99, "description": "The best gizmos there are around." }, { "name": "Gizmo v2", "quantity": 5, "unit_cost": 199.99 } ] } ``` -------------------------------- ### Subtotal Line Parameters Example Source: https://github.com/invoice-generator/invoice-generator-api/blob/master/README.md This JSON example shows how to configure subtotal lines for an invoice, specifically for tax and shipping. The 'fields' object controls the visibility of these lines, and 'tax' and 'shipping' parameters define their values. ```json { "fields": { "tax": "%", "discounts": false, "shipping": true }, "tax": 7, "shipping": 15 } ``` -------------------------------- ### Generate Invoice PDF with JSON Input Source: https://github.com/invoice-generator/invoice-generator-api/blob/master/README.md This example demonstrates generating an invoice PDF using the Invoice Generator API with JSON formatted data. It requires setting the 'Content-Type' header to 'application/json'. ```bash curl https://invoice-generator.com \ -H "Authorization: Bearer myApiKey" \ -H "Content-Type: application/json" \ -d '{"from":"Nikolaus Ltd","to":"Acme, Corp.","logo":"https://example.com/img/logo-invoice.png","number":1,"items":[{"name":"Starter plan","quantity":1,"unit_cost":99}],"notes":"Thanks for your business!"}' \ > invoice.pdf ``` -------------------------------- ### Generate Simple Invoice PDF Source: https://github.com/invoice-generator/invoice-generator-api/blob/master/README.md This example demonstrates how to generate a simple invoice PDF using the Invoice Generator API via cURL. It includes basic invoice details such as sender, recipient, logo, item information, notes, and terms. ```bash curl https://invoice-generator.com \ -H "Authorization: Bearer myApiKey" \ -d from="Nikolaus Ltd" \ -d to="Acme, Corp." \ -d logo="https://example.com/img/logo-invoice.png" \ -d number=1 \ -d date="Feb 9, 2015" \ -d due_date="Feb 16, 2015" \ -d "items[0][name]"="Starter plan monthly" \ -d "items[0][quantity]"=1 \ -d "items[0][unit_cost]"=99 \ -d notes="Thanks for being an awesome customer!" \ -d terms="Please pay by the due date." \ > invoice.pdf ``` -------------------------------- ### Generate Localized Invoice PDF Source: https://github.com/invoice-generator/invoice-generator-api/blob/master/README.md This example shows how to generate an invoice PDF with specific localization settings using the Invoice Generator API via cURL. The locale is specified using the 'Accept-Language' header. ```bash curl https://invoice-generator.com \ -H "Authorization: Bearer myApiKey" \ -H "Accept-Language: fr-FR" \ -d from="Nikolaus Ltd" \ -d to="Acme Corp." \ -d logo="https://example.com/img/logo-invoice.png" \ -d number=1 \ -d currency=eur \ -d date="Feb 9, 2015" \ -d due_date="Feb 16, 2015" \ -d "items[0][name]"="Starter plan monthly" \ -d "items[0][quantity]"=1 \ -d "items[0][unit_cost]"=99 \ > invoice.pdf ``` -------------------------------- ### Custom Field Parameters Example Source: https://github.com/invoice-generator/invoice-generator-api/blob/master/README.md This JSON example demonstrates how to add custom fields to an invoice. Custom fields allow for additional information to be displayed, such as purchase order numbers or account numbers, each with a specified name and value. ```json { "custom_fields": [ { "name": "Gizmo", "value": "PO-1234" }, { "name": "Account Number", "value": "CUST-456" } ] } ``` -------------------------------- ### Generate Invoice PDF with Custom Fields Source: https://github.com/invoice-generator/invoice-generator-api/blob/master/README.md This example demonstrates how to include custom fields in an invoice generated by the Invoice Generator API using cURL. Custom fields can be added as an array of objects with 'name' and 'value'. ```bash curl https://invoice-generator.com \ -H "Authorization: Bearer myApiKey" \ -d from="Nikolaus Ltd" \ -d to="My Customer" \ -d ship_to="Shipping Address" \ -d logo="https://example.com/img/logo-invoice.png" \ -d number=1 \ -d date="Feb 9, 2015" \ -d "custom_fields[0][name]"="My Custom Field" \ -d "custom_fields[0][value]"="Some Value" \ -d "items[0][name]"="Starter Plan Monthly" \ -d "items[0][quantity]"=1 \ -d "items[0][unit_cost]"=99 \ > invoice.custom_fields.pdf ``` -------------------------------- ### Generate VAT Invoice PDF Source: https://github.com/invoice-generator/invoice-generator-api/blob/master/README.md This example shows how to generate an invoice PDF with VAT information using the Invoice Generator API via cURL. It includes VAT IDs for sender and recipient, tax title, tax percentage, and specific payment terms. ```bash curl https://invoice-generator.com \ -H "Authorization: Bearer myApiKey" \ -d from="Nikolaus Ltd%0AVAT ID: 1234" \ -d to="Foster Moen%0AVAT ID: 4567" \ -d logo="https://example.com/img/logo-invoice.png" \ -d number=1 \ -d date="Feb 9, 2015" \ -d payment_terms="Charged - Do Not Pay" \ -d "items[0][name]"="Starter Plan Monthly" \ -d "items[0][quantity]"=1 \ -d "items[0][unit_cost]"=99 \ -d tax_title="VAT" \ -d "fields[tax]"="%" \ -d tax=8 \ -d notes="Thanks for being an awesome customer!" \ -d terms="No need to submit payment. You will be auto-billed for this invoice." \ > invoice.vat.pdf ``` -------------------------------- ### Create Invoice PDF API Endpoint Source: https://github.com/invoice-generator/invoice-generator-api/blob/master/README.md This specifies the API endpoint for creating a PDF invoice. It uses the POST method and targets the root URL of the invoice-generator.com service. ```text POST https://invoice-generator.com ``` -------------------------------- ### Create E-invoice API Endpoint Source: https://github.com/invoice-generator/invoice-generator-api/blob/master/README.md This specifies the API endpoint for creating an e-invoice in UBL format. It uses the POST method and targets the '/ubl' path on the invoice-generator.com service. ```text POST https://invoice-generator.com/ubl ``` -------------------------------- ### Generate E-invoice using cURL Source: https://github.com/invoice-generator/invoice-generator-api/blob/master/README.md This snippet demonstrates how to generate an e-invoice in UBL XML format using a cURL command. It includes parameters for sender, receiver, logo, invoice number, date, payment terms, items, tax, and notes. The output is redirected to an 'invoice.xml' file. ```bash curl https://invoice-generator.com/ubl \ -H "Authorization: Bearer myApiKey" \ -d from="Nikolaus Ltd%0AVAT ID: 1234" \ -d to="Foster Moen%0AVAT ID: 4567" \ -d logo="https://example.com/img/logo-invoice.png" \ -d number=1 \ -d date="Feb 9, 2015" \ -d date="Mar 9, 2015" \ -d payment_terms="NET 30" \ -d "items[0][name]"="Starter Plan Monthly" \ -d "items[0][quantity]"=1 \ -d "items[0][unit_cost]"=99 \ -d tax_title="VAT" \ -d "fields[tax]"="%" \ -d tax=8 \ -d notes="Thanks for being an awesome customer!" \ > invoice.xml ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.