Edit an Invoice
PUT/api/invoices/{id}
Parameters
| Field | Type | Description |
|---|---|---|
| id | Number | Invoice unique ID |
| invoice_bill_date | string | Optional Invoice Bill Date |
| invoice_due_date | string | Mandatory Invoice Due Date |
| invoice_client_id | string | Mandatory Invoice Client id |
| invoice_project_id | string | Optional Invoice Project id |
| tax_id | string | Optional Invoice Tax id |
| tax_id2 | string | Optional Invoice Tax id2 |
| tax_id3 | string | Optional Invoice Tax id3 |
| recurring | string | Optional Invoice Recurring |
| invoice_note | string | Optional Invoice note |
| labels | string | Optional Invoice Label |
| items | Object[] | optional Optional replacement invoice lines, in the same shape GET /api/invoices/:id/items returns. When present the existing lines are replaced and the totals recalculated; when absent the lines are left untouched. An empty array is rejected with a 400 instead of clearing the invoice. |
| items.title | String | Mandatory line title. A description is accepted instead. |
| items.description | String | optional Optional line description |
| items.quantity | Number | Mandatory quantity, numeric |
| items.rate | Number | Mandatory unit rate, numeric |
| items.unit_type | String | optional Optional unit type, maximum 20 characters |
| items.sort | Number | optional Optional display order. Defaults to the array position. |
| items.item_id | Number | optional Optional items library ID |
| items.taxable | Number | optional Optional, 1 (default) or 0 |
curl -X PUT "https://yoursite.com/api/invoices/123" \
-H "authtoken: YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "invoice_bill_date": "...", "invoice_due_date": "...", "invoice_client_id": "...", "invoice_project_id": "...", "tax_id": "...", "tax_id2": "...", "tax_id3": "...", "recurring": "...", "invoice_note": "...", "labels": "...", "items.title": "...", "items.quantity": "...", "items.rate": "..." }' Success-Response:
HTTP/1.1 200 OK
{
"status": true,
"message": "Invoice Update Successful."
}
HTTP/1.1 404 Not Found
{
"status": false,
"message": "Invoice Update Fail."
}