If invoicing is enabled for your account, you can add invoice line items to an asset.
To do so, you need to specify the following XML in a POST or PUT to the asset.
vWork will then include these line items in any jobs for the asset where invoicing is enabled.
<?xml version="1.0" encoding="utf-8"?>
<asset>
<invoice>
<line_items type="array">
<line_item>
<code>foo</code>
<description>bar</description>
<unit_cost>100.0</unit_cost>
<requested_quantity>1.0</requested_quantity>
<actual_quantity>1.0</actual_quantity>
</line_item>
</line_items>
</invoice>
</asset> If you wish to edit an existing item, please submit the full array of invoice line items with the updated information, like so:
<?xml version="1.0" encoding="utf-8"?>
<asset>
<invoice>
<line_items type="array">
<line_item>
<code>foo</code>
<description>bar2</description>
<unit_cost>100.0</unit_cost>
<requested_quantity>1.0</requested_quantity>
<actual_quantity>1.0</actual_quantity>
</line_item>
<line_item>
<code>bar</code>
<description>whatsit2</description>
<unit_cost>100.0</unit_cost>
<requested_quantity>1.0</requested_quantity>
<actual_quantity>1.0</actual_quantity>
</line_item>
</line_items>
</invoice>
</asset> If you wish to remove one line item from an asset, please submit the full array minus the line item you wish to remove as per the example above.
If you wish to remove all line items from an asset, please use the destroy command in a POST as per the example below, and include the specific IDs:
<?xml version="1.0" encoding="utf-8"?>
<asset>
<invoice>
<id>1865860</id>
<line_items type="array">
<line_item>
<id>3550124</id>
<_destroy>true</_destroy>
</line_item>
<line_item>
<id>3550125</id>
<_destroy>true</_destroy>
</line_item>
</line_items>
</invoice>
</asset>