# \_invoiceGet

Retrieve a Job's invoice. If an invoice does not already exist for that Job, then one will be created and then returned.

### Parameters

#### id

The ID of the Job.

### Example

```
FM_api('Job_invoiceGet', ['id' => '222402']);
```

### Result

#### On Success

```
{'id':'206976',
 'appointment_id':'222402',
 'cdate':'2015-11-02',
 'customer_id':'100831',
 'total':'0',
 'paid':'2',
 'rows':'[]',
 'notes':'',
 'num':'5',
 'type':'0',
 'status':'2',
 'discount':'0',
 'pandp':'0',
 'doc_no':null,
 'order_no':null,
 'discount_vat':'0',
 'pandp_vat':'0',
 'total_net':'0.0000'}
```

The ID returned here is the database ID of the invoice row.

Note the Status, which starts as '-1', meaning 'Draft'. Common Status values are:

* -1: Draft
* 0: Quoted
* 1: Invoiced
* 2: Paid
* 3: Cancelled


---

# Agent Instructions: 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:

```
GET https://docs.fieldmotion.com/fieldmotion-api-docs/job/_invoiceget.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
