Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

/invoice/update

This action updates the invoice for a work order.

Request

FieldDescriptionTypeRequired
report_idUnique identifier for the work ordernumberYes
invoice_idUnique identifier for the work order’s invoicenumberYes
contractor_itemsContractor invoice itemsarrayNo
client_itemsClient invoice itemsarrayNo
completetrue to mark invoice complete; false otherwiseboolNo
client_discount_percentageClient invoice discount percentage 25.00floatNo
contractor_discount_percentageContractor invoice discount percentage 25.00floatNo
sent_to_client_dateSet Sent to Client Date 11/05/2024dateNo

Each item in the contractor_items / client_items array can have the following fields:

FieldDescriptionTypeRequired
line_idUnique identifier for the invoice item in the invoicenumberYes, if updating an existing item
invoice_item_idUnique identifier for the invoice item. See /bid/invoice/itemsnumberYes, if creating/updating an invoice item
invoice_item_otherInvoice item stringstringYes, if creating/updating a custom invoice item
qtyInvoice item quantitynumberYes
uom_idUnique identifier for the Unit of Measure (UOM). See /bid/uomnumberNo
priceInvoice item pricenumberYes
flat_feetrue if Flat Fee should be enabled; false otherwiseboolNo
price_sub_adjContractor line item adjustmentnumberNo, only valid in contractor_items
adj_commentComment for line item adjustmentstringNo, 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

FieldDescriptionType
resultInvoice update result stringstring

Example successful response:

{
  "result": "Invoice updated"
}

Errors

Error TypeDescriptionStatus Code
access_deniedAccess token is invalid or expired401
scope_invalidClient app does not have the required OAuth scope403
wo_invalidWork order is invalid400
invoice_id_requiredInvoice Id is required400
invoice_not_foundInvoice not found400
invoice_item_id_not_allowedinvoice_item_id cannot be set400
invoice_item_id_requiredinvoice_item_id is required400
invoice_item_id_invalidInvoice item is invalid400
qty_requiredQuantity is not in the request400
qty_invalidQuantity is invalid400
uom_invalidUnit of Measure (UOM) is invalid400
uom_not_allowedUnit of Measure (UOM) cannot be set400
price_requiredPrice is required400
price_invalidPrice is invalid400
flat_fee_invalidFlat Fee is invalid400
invalid_fieldsSome fields in the request are invalid400
complete_invalidComplete field is invalid400
sent_to_client_dateDate is not in a valid format422
client_discount_percentageDiscount is not a float422
contractor_discount_percentageDiscount is not a float422