> For the complete documentation index, see [llms.txt](https://docs.fieldmotion.com/fieldmotion-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fieldmotion.com/fieldmotion-api-docs/job/_invoiceupdate.md).

# \_invoiceUpdate

Update an invoice.

### Parameters

#### id

The ID of the Job.

#### discount

Float value to discount.

#### pandp

Float value of Postage and Packaging.

#### discount\_vat

Float value how much VAT to discount.

#### pandp\_vat

Float value how much VAT is on Postage and Packaging.

#### doc\_no

Number of the invoice.

#### order\_no

Optional. If this invoice is for a PurchaseOrder, what is the PurchaseOrder's number.

#### rows

Array of invoice rows. Each row has 6 columns:

* Text description.
* Net price of that item.
* Amount of items.
* Net total (net price \* amt).
* How much tax to apply.
* Gross total (net total + tax percentage).

#### invoice\_number

Optional text field.

#### notes

Optional text.

#### cdate

Date of the invoice.

### Example

```
FM_api('Job_invoiceUpdate',	['id' => '222402',
                                     'discount' => '.1',
                                     'pandp' => '13.99',
                                     'discount_vat' => '.05',
                                     'pandp_vat' => '2.99',
                                     'doc_no' => 'test001',
                                     'order_no' => '',
                                     'rows' => [['item 001',
                                                 '1.99',
                                                 '10',
                                                 '19.9',
                                                 '34.5',
                                                 '26.77']],
                                     'invoice_number' => '0001',
                                     'notes' => 'This is an invoice note',
                                     'cdate' => date('Y-m-d')]);
```

### Result

#### On Success

```
{'ok':1}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/job/_invoiceupdate.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
