Skip to content
PharmaFlow Knowledgebase
Esc
↑↓navigate↵open⌘Jpreview

Update a supplier

Admin or branch manager. Patches the contact, type, lead time, reliability, or active flag. Fields outside that set are ignored, and a payload holding none of them is refused.

PUT/api/v1/suppliers/{supplierId}
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT from POST /api/v1/auth/login sent as Authorization Bearer.

Path parameters
supplierIdstringrequired

The supplier being updated.

Request body
requiredapplication/json
namestring
tax_numberstring
contact_personstring
phonestring
emailstring
addressstring
supplier_typestring
lead_time_daysinteger
min -9007199254740991 · max 9007199254740991
reliability_scorenumber
is_activeboolean
Responses
200

Supplier updated

idstringrequired
namestringrequired
tax_numberstringrequired
contact_personstringrequired
phonestringrequired
emailstringrequired
addressstringrequired
supplier_typestringrequired
lead_time_daysintegerrequired
min -9007199254740991 · max 9007199254740991
reliability_scorenumberrequired
is_activebooleanrequired
created_atstringrequired
updated_atstringrequired
400

No valid field is supplied to update

detailstringrequired
401

Not authenticated

detailstringrequired
403

Caller is not an admin, inventory manager, or branch manager

detailstringrequired
404

Supplier not found

detailstringrequired
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X PUT 'http://localhost:8000/api/v1/suppliers/string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "tax_number": "string",
  "contact_person": "string",
  "phone": "string",
  "email": "string",
  "address": "string",
  "supplier_type": "string",
  "lead_time_days": -9007199254740991,
  "reliability_score": 0,
  "is_active": true
}'
Response
{
  "id": "string",
  "name": "string",
  "tax_number": "string",
  "contact_person": "string",
  "phone": "string",
  "email": "string",
  "address": "string",
  "supplier_type": "string",
  "lead_time_days": -9007199254740991,
  "reliability_score": 0,
  "is_active": true,
  "created_at": "string",
  "updated_at": "string"
}