> 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/invoice/_pay.md).

# \_pay

Pay an Invoice.

### Parameters

#### id

The ID of the Invoice to be paid.

#### amt

The amount that will be paid.

### Example

```
FM_api('Invoice_pay', ['id' => '1', 'amt' => 500]);
```

### Result

#### On Success

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

#### On Failure

If the User is not logged in:

```
{'error':'not logged in'}
```

If the amount is not set:

```
{'error':'amount is not set'}
```
