/invoice/update
This action updates the invoice for a work order.
Request
| Field | Description | Type | Required |
|---|---|---|---|
report_id | Unique identifier for the work order | number | Yes |
invoice_id | Unique identifier for the work order’s invoice | number | Yes |
contractor_items | Contractor invoice items | array | No |
client_items | Client invoice items | array | No |
complete | true to mark invoice complete; false otherwise | bool | No |
client_discount_percentage | Client invoice discount percentage 25.00 | float | No |
contractor_discount_percentage | Contractor invoice discount percentage 25.00 | float | No |
sent_to_client_date | Set Sent to Client Date 11/05/2024 | date | No |
Each item in the contractor_items / client_items array can have
the following fields:
| Field | Description | Type | Required |
|---|---|---|---|
line_id | Unique identifier for the invoice item in the invoice | number | Yes, if updating an existing item |
invoice_item_id | Unique identifier for the invoice item. See /bid/invoice/items | number | Yes, if creating/updating an invoice item |
invoice_item_other | Invoice item string | string | Yes, if creating/updating a custom invoice item |
qty | Invoice item quantity | number | Yes |
uom_id | Unique identifier for the Unit of Measure (UOM). See /bid/uom | number | No |
price | Invoice item price | number | Yes |
flat_fee | true if Flat Fee should be enabled; false otherwise | bool | No |
price_sub_adj | Contractor line item adjustment | number | No, only valid in contractor_items |
adj_comment | Comment for line item adjustment | string | No, only valid in contractor_items |
Example:
{
"report_id": 3850,
"invoice_id": 427,
"contractor_items": [{
"line_id": 874,
"invoice_item_id": 42933,
"qty": 3,
"uom_id": 2,
"price": 6.68
}],
"complete": false
}
curl -H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-d '{"report_id":3850,"invoice_id":427,"client_discount_percentage":25.00,"sent_to_client_date":"11/05/2024","contractor_items":[{"line_id":874,"invoice_item_id":42933,"qty":3,"uom_id":2,"price":6.68}],"complete":false}' \
https://ppw.web/svc/invoice/update
Response
| Field | Description | Type |
|---|---|---|
result | Invoice update result string | string |
Example successful response:
{
"result": "Invoice updated"
}
Errors
| Error Type | Description | Status Code |
|---|---|---|
access_denied | Access token is invalid or expired | 401 |
scope_invalid | Client app does not have the required OAuth scope | 403 |
wo_invalid | Work order is invalid | 400 |
invoice_id_required | Invoice Id is required | 400 |
invoice_not_found | Invoice not found | 400 |
invoice_item_id_not_allowed | invoice_item_id cannot be set | 400 |
invoice_item_id_required | invoice_item_id is required | 400 |
invoice_item_id_invalid | Invoice item is invalid | 400 |
qty_required | Quantity is not in the request | 400 |
qty_invalid | Quantity is invalid | 400 |
uom_invalid | Unit of Measure (UOM) is invalid | 400 |
uom_not_allowed | Unit of Measure (UOM) cannot be set | 400 |
price_required | Price is required | 400 |
price_invalid | Price is invalid | 400 |
flat_fee_invalid | Flat Fee is invalid | 400 |
invalid_fields | Some fields in the request are invalid | 400 |
complete_invalid | Complete field is invalid | 400 |
sent_to_client_date | Date is not in a valid format | 422 |
client_discount_percentage | Discount is not a float | 422 |
contractor_discount_percentage | Discount is not a float | 422 |