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/create

This action creates an invoice for a work order. Only one invoice can be created for a work order; use the /invoice/update action to update an existing invoice.

WARNING: This endpoint is deprecated. Please use the invoice/update endpoint to make changes to Invoices. All Work Orders will now always have an Invoice, so there’s no lorger a need to manually create one.

Request

FieldDescriptionTypeRequired
report_idUnique identifier for the work ordernumberYes
contractor_itemsContractor invoice itemsarrayNo
client_itemsClient invoice itemsarrayNo

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

FieldDescriptionTypeRequired
invoice_item_idUnique identifier for the invoice item. See /bid/invoice/itemsnumberYes, if creating an invoice item
invoice_item_otherInvoice item stringstringYes, if creating 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,
  "contractor_items": [{
    "invoice_item_id": 42921,
    "qty": 1,
    "uom_id": 1,
    "price": 7.77,
    "flat_fee": true
  }],
  "client_items": [{
    "invoice_item_id": 42921,
    "qty": 2,
    "uom_id": 1,
    "price": 9.88
  }]
}
curl -H 'Content-Type: application/json' \
     -H 'Authorization: Bearer ACCESS_TOKEN' \
     -d '{"report_id":3850,"contractor_items":[{"invoice_item_id":42921,"qty":1,"uom_id":1,"price":7.77,"flat_fee":true}],"client_items":[{"invoice_item_id":42921,"qty":2,"uom_id":1,"price":9.88}]}' \
     https://ppw.web/svc/invoice/create

Response

FieldDescriptionType
invoice_idUnique identifier for the work order’s invoicenumber

Example successful response:

{
  "invoice_id": 427
}

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_existsInvoice already exists400
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