Furnizori
Furnizorii sunt firmele externe ale căror produse le stochezi și le vinzi. Se leagă de produse prin seller_id.
Endpoint-uri
| Metodă | Cale | Descriere |
|---|---|---|
| GET | /api/v1/sellers | Listă paginată; filtre search, status. |
| GET | /api/v1/sellers/{id} | Citește un furnizor (cu numărul de produse). |
| POST | /api/v1/sellers | Creează un furnizor. |
| PUT | /api/v1/sellers/{id} | Actualizează un furnizor (parțial). |
| DELETE | /api/v1/sellers/{id} | Șterge un furnizor (doar dacă nu are produse). |
Filtre la listare
| Parametru | Tip | Note |
|---|---|---|
search | string | Caută în supplier_name, supplier_code, cif. |
status | enum | active | inactive. |
per_page | integer | Implicit 50. |
Schema unui furnizor
Câmpuri acceptate la POST / PUT. La POST, supplier_name este obligatoriu; restul sunt opționale. La PUT, toate sunt opționale.
| Câmp | Tip | Note |
|---|---|---|
supplier_name | string ≤ 255 | Obligatoriu la POST. Numele afișat al furnizorului (nu name). |
supplier_code | string ≤ 50 | Cod intern. |
cif | string ≤ 20 | Cod de identificare fiscală. |
registration_number | string ≤ 50 | Nr. înregistrare la Registrul Comerțului. |
address | string ≤ 255 | |
city | string ≤ 100 | |
county | string ≤ 100 | Județ. |
country | string ≤ 100 | |
email | email ≤ 255 | |
phone | string ≤ 20 | |
contact_person | string ≤ 255 | |
bank_name | string ≤ 255 | |
iban | string ≤ 50 | |
notes | text | |
status | enum | active | inactive. Implicit active. |
La GET /api/v1/sellers/{id}, răspunsul include în plus products_count.
Exemplu — creare furnizor
bash
curl -X POST https://tenant.notsowms.ro/api/v1/sellers \
-H "Authorization: Bearer tenant.7c4a8d09ca3762af61e59520943dc26494f8941b" \
-H "Content-Type: application/json" \
-d '{
"supplier_name": "Auto Parts SRL",
"cif": "RO12345678",
"city": "Cluj-Napoca",
"county": "Cluj",
"email": "office@autoparts.ro",
"phone": "+40264123456"
}'Răspuns 201:
json
{
"data": {
"id": 57,
"supplier_name": "Auto Parts SRL",
"cif": "RO12345678",
"city": "Cluj-Napoca",
"county": "Cluj",
"email": "office@autoparts.ro",
"phone": "+40264123456",
"status": "active",
"created_at": "2026-06-11T08:42:11.000000Z",
"updated_at": "2026-06-11T08:42:11.000000Z"
}
}Ștergere
bash
curl -X DELETE https://tenant.notsowms.ro/api/v1/sellers/57 \
-H "Authorization: Bearer tenant.7c4a8d09ca3762af61e59520943dc26494f8941b"Dacă furnizorul are produse asociate, ștergerea este refuzată cu 422:
json
{ "error": "Cannot delete seller with associated products." }