Update invoice data using a partial update (PATCH). Only provided fields are updated; omitted fields remain unchanged.
Important: The hash_id field is required for optimistic locking to prevent conflicting updates. Retrieve the current invoice first to obtain the hash_id.
Restrictions:
- Cannot update invoices that are fully approved
- Cannot update invoices that are rejected
Request Fields
| Field | Type | Description |
|---|---|---|
| hash_id | string | Invoice hash for optimistic locking. Required. |
| supplier_info | object | Supplier details (see below). |
| ship_to | object | Ship-to address (name, address). |
| bill_to | object | Bill-to address (name, address, memo, departmentId, entityId). |
| invoice_number | string | Invoice number. |
| po_number | string | Purchase order number. |
| invoice_terms | string | Payment terms (e.g., "Net 30"). |
| invoice_date | string | Invoice date (YYYY-MM-DD). |
| invoice_due | string | Payment due date (YYYY-MM-DD). |
| invoice_items | array | Line items (see below). |
| invoice_total | number | Total invoice amount. |
| tags | string | Comma-separated tags. |
Supplier Info fields: name, web, email, phone_number, address, supplierId
Ship To fields: name, address
Bill To fields: name, address, memo, departmentId, entityId
Line Item fields (all required except where noted):
id(string) - Line item identifier. Required.qty(number) - Quantity. Required.price(number) - Unit price. Required.total(number) - Line total. Required.description(string) - Item description. Required.sku(string) - Item SKU.itemId(string) - Reference to item master.customerId(string) - Customer reference for billable items.accountId(string) - GL account reference.classId(string) - Accounting class reference.poId(string) - Purchase order reference.poLineId(string) - Purchase order line reference.billable(boolean) - Mark as billable. Default: false.departmentId(string) - Department reference.entityId(string) - Entity reference.taxId(string) - Tax code reference.taxInclusive(boolean) - Price includes tax. Default: false.
Enter your API token.
The unique identifier of the invoice to update.
Update Basic Fields
{
"hash_id": "abc123def456",
"invoice_number": "INV-2024-001-REVISED",
"po_number": "PO-789",
"invoice_terms": "Net 45",
"invoice_date": "2024-01-15",
"invoice_due": "2024-03-01",
"invoice_total": 1500.0,
"tags": "revised,q1-2024"
}Update Supplier Info
{
"hash_id": "abc123def456",
"supplier_info": {
"name": "Acme Corporation",
"email": "billing@acme.com",
"phone_number": "+1-555-123-4567",
"address": "123 Main St, New York, NY 10001",
"supplierId": "SUP-001"
}
}Update Line Items
{
"hash_id": "abc123def456",
"invoice_items": [
{
"id": "1",
"qty": 10,
"price": 100.0,
"total": 1000.0,
"description": "Professional Services - January 2024",
"sku": "SVC-001",
"accountId": "EXP-100",
"classId": "CLASS-100",
"billable": true
},
{
"id": "2",
"qty": 5,
"price": 100.0,
"total": 500.0,
"description": "Consulting Hours",
"sku": "SVC-002",
"customerId": "CUST-001",
"billable": true
}
]
}Full Update
{
"hash_id": "abc123def456",
"supplier_info": {
"name": "Acme Corporation",
"web": "https://acme.com",
"email": "billing@acme.com",
"phone_number": "+1-555-123-4567",
"address": "123 Main St, New York, NY 10001",
"supplierId": "SUP-001"
},
"ship_to": {
"name": "Warehouse A",
"address": "456 Oak Ave, Los Angeles, CA 90001"
},
"bill_to": {
"name": "Accounts Payable",
"address": "789 Corporate Blvd, Chicago, IL 60601",
"memo": "Attn: John Smith",
"departmentId": "DEPT-100"
},
"invoice_number": "INV-2024-001",
"po_number": "PO-789",
"invoice_terms": "Net 30",
"invoice_date": "2024-01-15",
"invoice_due": "2024-02-14",
"invoice_items": [
{
"id": "1",
"qty": 10,
"price": 100.0,
"total": 1000.0,
"description": "Professional Services",
"sku": "SVC-001",
"itemId": "ITEM-001",
"accountId": "EXP-100",
"classId": "CLASS-100",
"billable": false
}
],
"invoice_total": 1000.0,
"tags": "verified,q1-2024"
}Invoice hash for optimistic locking. Required to prevent conflicting updates.
Supplier/vendor information.
Supplier name.
Supplier website URL.
Supplier email address.
Supplier phone number.
Supplier address.
External supplier/vendor ID reference.
Ship-to address information.
Ship-to name.
Ship-to address.
Bill-to address information.
Bill-to name.
Bill-to address.
Memo or notes for the bill-to.
Department reference ID.
Entity reference ID.
Invoice number from the document.
Purchase order number.
Payment terms (e.g., "Net 30").
Invoice date (YYYY-MM-DD).
Payment due date (YYYY-MM-DD).
Line items array.
Individual line item on an invoice.
Line item identifier.
Quantity.
Unit price.
Line total.
Item description.
Item SKU.
Reference to item master record.
Customer reference for billable items.
GL account reference ID.
Accounting class reference ID.
Purchase order reference ID.
Purchase order line reference ID.
Mark line item as billable.
Department reference ID.
Entity reference ID.
Tax code reference ID.
Price includes tax.
Total invoice amount.
Comma-separated tags.
Invoice updated successfully
Success
{
"status": "OK",
"msg": "Invoice updated",
"result": 12345
}Bad Request - Invalid data or hash_id mismatch
Missing hash_id
{
"status": "Error",
"msg": "A valid reference hash_id is required for update operation.",
"result": null
}Hash ID Mismatch
{
"status": "Error",
"msg": "hash_id does not match internal record.",
"result": null
}Invalid Data
{
"status": "Error",
"msg": "Value 'invalid' does not match type 'float' at path 'invoice_total'.",
"result": null
}Unauthorized - Missing or invalid API token
Missing Token
{
"status": "Error",
"msg": "Bearer token is not set.",
"result": null
}Invoice not found
Not Found
{
"status": "Error",
"msg": "Unable to reference invoice ID: 12345",
"result": null
}Method Not Allowed - Invoice is approved or rejected
Invoice Approved
{
"status": "Error",
"msg": "This invoice is fully approved. Update is not allowed.",
"result": null
}Invoice Rejected
{
"status": "Error",
"msg": "This invoice is rejected. Update is not allowed.",
"result": null
}