GET /api/products
Restituisce la lista dei prodotti registrati per l’azienda collegata al token. È possibile filtrare per categoria.
Autenticazione
- Tipo: Bearer Token
- Header richiesto:
Authorization: Bearer {api_token}
Request
Headers
| Chiave | Valore |
|---|
| Authorization | Bearer {api_token} |
Query Parameters
| Parametro | Tipo | Obbligatorio | Descrizione |
|---|
category_id | integer | No | ID della categoria per filtrare i prodotti |
Esempio di richiesta
GET /api/products?category_id=5
Authorization: Bearer {api_token}
Response
{
"success": true,
"data": [
{
"id": 101,
"name": "Crostata di frutta",
"current_price": 8.5,
"category_item": {
"id": 4,
"category": {
"id": 5,
"name": "Pasticceria"
}
},
"calculation": {
"id": 12,
"cost": 4.3
},
"result": {
"id": 22,
"profit_margin": 50
}
},
{
"id": 102,
"name": "Plumcake",
"current_price": 5.0,
"category_item": null,
"calculation": null,
"result": null
}
]
}