> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lavaflo.app/llms.txt
> Use this file to discover all available pages before exploring further.

# API reference

> Use an API key to work with products, categories, stock, orders, reports and imports over JSON.

Create a key in Settings → Developer and send it as `Authorization: Bearer lfa_...`. Keys act as an admin of their account. JSON in, JSON out. Errors return `{ "error": code, "message": text }`.

| Method | Path | Purpose |
| - | - | - |
| GET | `/api/products?q=&status=&category=&sort=&dir=&limit=&offset=` | List products |
| GET | `/api/products/:id` | One product with variations, images, stock |
| POST | `/api/products` | Create |
| PATCH | `/api/products/:id` | Update fields |
| PUT | `/api/products/:id/variations` | Replace variations |
| POST | `/api/products/bulk` | Bulk actions |
| GET/POST/PATCH/DELETE | `/api/categories[/:id]` | Category tree |
| GET | `/api/inventory` | Stock levels |
| POST | `/api/inventory/adjust` | `{ items: [{ productId, variationId, delta? , setTo? }], reason }` |
| GET | `/api/orders` | Orders |
| GET | `/api/reports/sales?from=&to=&groupBy=&format=csv` | Sales & margin |
| POST | `/api/feeds/:id/run` | Run an import (multipart file for uploads) |
| GET | `/api/import-runs/:id/rows` | Preview rows |
| POST | `/api/import-runs/:id/apply` | Apply |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.