---
title: "Create an invoice from the composer (server-owned totals)"
method: POST
path: "/companies/{companyId}/ar/compose"
tags: ["AR/AP"]
---

# Create an invoice from the composer (server-owned totals)

`POST /companies/{companyId}/ar/compose`

## Request

- Base URL: `https://api.medianfi.com/api/v1`
- URL: `https://api.medianfi.com/api/v1/companies/{companyId}/ar/compose`
- Auth: HTTP bearer

DARK — 404s unless ar_ap_items_enabled. Line items carry revenue category, quantity, unit price, tax bps, and a per-line service period; every line subtotal/tax/total and the item amount_cents are recomputed server-side (client totals are rejected by the strict schema). dueDate derives from terms when not supplied; status "sent" composes and sends in one call.

## Response `201`

Invoice created (item with lines and availableTransitions)

## Other responses

- `401`: Authentication required
- `404`: AR/AP items not enabled for this company
- `422`: Validation error (including client-supplied totals)

---

[API](https://skmtc.dev/medianfi/apis/median-api.md) · [All operations](https://skmtc.dev/medianfi/apis/median-api/llms.txt) · [OpenAPI document](https://skmtc.dev/medianfi/apis/median-api/revisions/20090ea32b0d?raw)
