# POST /invoices

**Resource:** [Invoices](./invoices.md)  
**MCP tool:** `create_invoice`  
**Scopes:** `invoices:write`  
**Write operation:** yes

Create a native invoice, optionally linked to an opportunity and with inline line_items (header totals are computed from the lines). Pass external_order_id to link an ecommerce order.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `opportunity_id` | body | string | no |  |
| `customer_id` | body | string | no |  |
| `external_order_id` | body | string | no |  |
| `invoice_number` | body | string | no |  |
| `status` | body | string | no |  |
| `issue_date` | body | string | no |  |
| `due_date` | body | string | no |  |
| `currency_code` | body | string | no |  |
| `reference` | body | string | no |  |
| `contact_name` | body | string | no |  |
| `line_items` | body | array | no |  |
| `require_approval` | body | boolean | no | Optional. Set true to route this write into the approval queue for human review instead of executing it immediately (returns 202 + an approval_id). Works even when your key/token has permission to execute directly. |

## Request example

```bash
curl -X POST   "https://api.trustpager.com/functions/v1/api/v1/invoices"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"opportunity_id":"...","customer_id":"...","external_order_id":"..."}'
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`