/invoice/get
This action returns the invoice associated with a work order. Use the
/invoice/id action to get the invoice_id of the
invoice associated with the work order.
Request
| Field | Description | Type | Required |
|---|---|---|---|
invoice_id | Unique identifier for the work order’s invoice | number | Yes |
Example:
{
"invoice_id": 427
}
curl -H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-d '{"invoice_id":427}' \
https://ppw.web/svc/invoice/get
Response
| Field | Description | Type |
|---|---|---|
invoice_id | Unique identifier for the work order’s invoice | number |
invoice_date | Invoice date | string |
insert_by | Unique identifier of the user that created the invoice | number |
insert_date | Date when invoice was first created | string |
update_by | Unique identifier of the user that last updated the invoice | number |
update_date | Date when invoice was last updated | string |
complete | 1 indicates invoice is complete: 0 otherwise | number |
contractor_total_adj | Total contractor price after discounts and adjustments | number |
client_total_adj | Total client price after discounts and adjustments | number |
contractor_items | Contractor invoice items | array |
client_items | Client invoice items | array |
Each item in the contractor_items / client_items array can have
the following fields:
| Field | Description | Type |
|---|---|---|
line_id | Unique identifier for the invoice item in the invoice | number |
invoice_item_id | Unique identifier for the invoice item. | number |
invoice_item_desc | Invoice item description for saved PPW items | string |
invoice_item_other | Invoice item description for other items | string |
qty | Invoice item quantity | number |
uom_id | Unique identifier for the Unit of Measure (UOM). | number |
price | Invoice item price | number |
flat_fee | true if Flat Fee should be enabled; false otherwise | bool |
price_sub_adj | Contractor line item adjustment (contractor_items only) | number |
adj_comment | Comment for line item adjustment (contractor_items only) | string |
Example successful response:
{
"invoice_id": 427,
"invoice_date": "2021-04-14",
"insert_by": 47080,
"insert_date": "2021-04-12",
"contractor_total_adj": 40.04,
"client_total_adj": 19.78,
"complete": 1,
"update_by": 47080,
"update_date": "2021-04-14",
"contractor_items": [{
"line_id": 866,
"billing_code": "TN839486",
"invoice_item_id": 42921,
"invoice_item_desc": "Locks-Padlocks",
"qty": 2,
"uom_id": 1,
"price": 7.78,
"price_adj": 10.00,
"adj_comment": "Adjust line item price to 10",
"insert_date": "2021-04-12 16:21:25",
"insert_by": 47080
}, {
"line_id": 874,
"billing_code": "TN9283",
"invoice_item_id": 42933,
"invoice_item_desc": "Locks",
"qty": 3,
"uom_id": 2,
"price": 6.68,
"price_adj": null,
"adj_comment": "",
"insert_date": "2021-04-14 11:05:24",
"insert_by": 47080
}],
"client_items": [{
"line_id": 867,
"billing_code": "TN839486",
"invoice_item_id": 42921,
"invoice_item_desc": "Locks-Padlocks",
"qty": 2,
"uom_id": 1,
"price": 9.89,
"insert_date": "2021-04-14 11:05:24",
"insert_by": 47080
}]
}
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 |
invoice_id_required | Invoice Id is required | 400 |
invoice_not_found | Invoice not found | 400 |