REST endpoint docs from a route spec
Consistent OpenAPI-style docs for every endpoint without copy-paste
Ver prévia de entrada e saída
Entrada
- Method
- POST
- Path
- /v1/invoices
- Summary
- Create a draft invoice
- Auth
- Bearer token
Saída (trecho)
### POST /v1/invoices
Create a draft invoice for a customer. Drafts can be finalised later via `POST /v1/invoices/{id}/finalize`.
**Auth:** Bearer token (scope: `invoices:write`).
**Request body:**
```json
{ "customer_id": "cus_123", "currency": "usd", "line_items": [{"description": "Q3 retainer", "amount": 250000}] }
```
**Response 201:** the full Invoice object with `status: "draft"`. **400** on missing customer_id. **402** when the customer has past-due invoices. **429** with `Retry-After` header above 100 req/min.