invoices
Create invoice
Changed onPOST /api/v1/invoices
Creates an invoice for a client.
Triggered actions are available when updating or creating an invoice.
These are query parameters that can be chained in order to perform additional actions on the entity, these include:
?send_email=true [Saves and sends the invoice]
?mark_sent=true [Saves and marks the invoice as sent]
?paid=true [Saves and marks the invoice as paid]
?amount_paid=100 [Saves and marks the invoice as paid with the given amount]
?cancel=true [Saves and marks the invoice as cancelled]
?save_default_footer=true [Saves the current footer as the default footer]
?save_default_terms=true [Saves the current terms as the default terms]
?retry_e_send=true [Saves and retries the e-send for the invoice]
?redirect=https://example.com [Saves and redirects to the given url]
post/api/v1/invoices
Request
- Base URLhttps://demo.invoiceninja.com
- Authnone declared. Required headers: X-API-TOKEN, X-Requested-With
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
includestring
Example:first_load
Includes child relationships in the response, format is comma separated. Check each model for the list of associated includes
Headers
X-API-TOKENstring required
Example:TOKEN
The API token to be used for authentication
X-Requested-Withstring required
Example:XMLHttpRequest
Used to send the XMLHttpRequest header
Request body
Example request
{
"user_id": "AxP7K9nY5z",
"assigned_user_id": "Bw2M8vR4qL",
"client_id": "Ht5N9cX3jK",
"location_id": "Opnel5aKBz",
"number": "INV-2024-0001",
"po_number": "PO-2024-0123",
"terms": "Net 30 - Payment is due within 30 days of invoice date",
"public_notes": "Thank you for your business. Please include invoice number with payment.",
"private_notes": "Client requested expedited delivery - premium rates apply",
"footer": "Payment accepted via bank transfer or credit card",
"custom_value1": "Department: Sales",
"custom_value2": "Region: North America",
"custom_value3": "Contract: C-2024-156",
"custom_value4": "Priority: High",
"tax_name1": "VAT",
"tax_name2": "GST",
"tax_rate1": 20,
"tax_rate2": 5,
"tax_name3": "State Tax",
"tax_rate3": 8.5,
"line_items": [
{
"quantity": 1,
"cost": 10,
"product_key": "Product key",
"tags": "Retail,Priority Customer",
"product_cost": 10,
"notes": "Item notes",
"discount": 5,
"tax_name1": "GST",
"tax_rate1": 10,
"tax_name2": "VAT",
"tax_rate2": 5,
"tax_name3": "CA Sales Tax",
"tax_rate3": 3,
"sort_id": "0",
"line_total": 10,
"gross_line_total": 15,
"tax_amount": 1,
"custom_value1": "Custom value 1",
"custom_value2": "Custom value 2",
"custom_value3": "Custom value 3",
"custom_value4": "Custom value 4",
"type_id": "1",
"tax_id": "1"
}
],
"invitations": [
{
"id": "Opnel5aKBz",
"client_contact_id": "Opnel5aKBz",
"key": "Opnel5aKBz4343343566236gvbb",
"link": "https://www.example.com/invitations/Opnel5aKBz4343343566236gvbb",
"updated_at": 1434342123,
"archived_at": 1434342123,
"email_error": "The email error"
}
],
"discount": 15,
"partial": 250,
"is_amount_discount": true,
"uses_inclusive_taxes": true,
"date": "2024-03-15",
"partial_due_date": "2024-03-29",
"due_date": "2024-04-14",
"custom_surcharge1": 25,
"custom_surcharge2": 35,
"custom_surcharge3": 45,
"custom_surcharge4": 55,
"custom_surcharge_tax1": true,
"custom_surcharge_tax2": true,
"custom_surcharge_tax3": true,
"custom_surcharge_tax4": true,
"project_id": "Opnel5aKBz"
}Response
Returns the saved invoice entity
Example response
{
"id": "Opnel5aKBz",
"user_id": "Opnel5aKBz",
"assigned_user_id": "Opnel5aKBz",
"client_id": "Opnel5aKBz",
"status_id": "4",
"number": "INV_101",
"po_number": "PO-1234",
"terms": "These are invoice terms",
"public_notes": "These are some public notes",
"private_notes": "These are some private notes",
"custom_value1": "2022-10-01",
"custom_value2": "Something custom",
"tax_rate1": 10,
"tax_rate2": 10,
"tax_rate3": 10,
"total_taxes": 10,
"line_items": [
{
"quantity": 1,
"cost": 10,
"product_key": "Product key",
"tags": "Retail,Priority Customer",
"product_cost": 10,
"notes": "Item notes",
"discount": 5,
"tax_name1": "GST",
"tax_rate1": 10,
"tax_name2": "VAT",
"tax_rate2": 5,
"tax_name3": "CA Sales Tax",
"tax_rate3": 3,
"sort_id": "0",
"line_total": 10,
"gross_line_total": 15,
"tax_amount": 1,
"custom_value1": "Custom value 1",
"custom_value2": "Custom value 2",
"custom_value3": "Custom value 3",
"custom_value4": "Custom value 4",
"type_id": "1",
"tax_id": "1"
}
],
"invitations": [
{
"id": "Opnel5aKBz",
"client_contact_id": "Opnel5aKBz",
"key": "Opnel5aKBz4343343566236gvbb",
"link": "https://www.example.com/invitations/Opnel5aKBz4343343566236gvbb",
"updated_at": 1434342123,
"archived_at": 1434342123,
"email_error": "The email error"
}
],
"amount": 10,
"balance": 10,
"paid_to_date": 10,
"discount": 10,
"partial": 10,
"is_amount_discount": true,
"is_deleted": true,
"uses_inclusive_taxes": true,
"date": "1994-07-30",
"last_sent_date": "1994-07-30",
"next_send_date": "1994-07-30",
"partial_due_date": "1994-07-30",
"due_date": "1994-07-30",
"last_viewed": 1434342123,
"updated_at": 1434342123,
"archived_at": 1434342123,
"custom_surcharge1": 10,
"custom_surcharge2": 10,
"custom_surcharge3": 10,
"custom_surcharge4": 10,
"custom_surcharge_tax1": true,
"custom_surcharge_tax2": true,
"custom_surcharge_tax3": true,
"custom_surcharge_tax4": true,
"project_id": "Opnel5aKBz",
"auto_bill_tries": 1,
"auto_bill_enabled": true,
"subscription_id": "Opnel5aKBz",
"location_id": "Opnel5aKBz",
"design_id": "Opnel5aKBz",
"exchange_rate": 1,
"vendor_id": "Opnel5aKBz"
}Changes
- info
added the new optional request property
// - info
added the optional property
//to the response with the status
- info
- info
added the optional property
//to the response with the status
- info