Authentication
This endpoint requires a valid Bearer token with admin/superuser privileges.
Request Body
Type of inventory item
Medicamento - Medication
Insumo - Supply
Equipamento - Equipment
Name of the inventory itemExample: Paracetamol
Quantity available in stockExample: 100
Unit of measurementExample: mg, ml, unidade
Expiration date in ISO format (YYYY-MM-DD)Example: 2025-12-31
Response
Unique identifier of the created inventory item
Type of inventory item (Medicamento, Insumo, or Equipamento)
Name of the inventory item
Quantity available in stock
curl -X POST https://api.vidaplus.com/estoque/ \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"tipo_item": "Medicamento",
"nome": "Paracetamol",
"quantidade": 100,
"unidade": "mg",
"data_validade": "2025-12-31"
}'
{
"id": 1,
"tipo_item": "Medicamento",
"nome": "Paracetamol",
"quantidade": 100,
"unidade": "mg",
"data_validade": "2025-12-31"
}
Error Codes
| Status Code | Description |
|---|
| 201 | Inventory item created successfully |
| 401 | Authentication token missing or invalid |
| 403 | User does not have admin/superuser privileges |
| 409 | An inventory item with the same name already exists |