Documentazione di endpoint REST da una specifica di route
Documentazione coerente in stile OpenAPI per ogni endpoint senza copia-incolla
Mostra anteprima di input e output
Input
- Method
- POST
- Path
- /v1/invoices
- Summary
- Create a draft invoice
- Auth
- Bearer token
Output (estratto)
### POST /v1/invoices
Crea una fattura in bozza per un cliente. Le bozze possono essere finalizzate in seguito tramite `POST /v1/invoices/{id}/finalize`.
**Auth:** token Bearer (scope: `invoices:write`).
**Corpo della richiesta:**
```json
{ "customer_id": "cus_123", "currency": "usd", "line_items": [{"description": "Retainer Q3", "amount": 250000}] }
```
**Risposta 201:** l'oggetto Invoice completo con `status: "draft"`. **400** se manca customer_id. **402** quando il cliente ha fatture scadute. **429** con header `Retry-After` oltre i 100 req/min.