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

Update a branch

Admin only. Patches a branch’s name, city, address, VAT number, flag, or currency. Closing a branch is done by setting is_active false, and the code itself is fixed once the branch exists.

PUT/api/v1/branches/{branchId}
Authorization
AuthorizationBearer token (JWT) · headerrequired

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

Path parameters
branchIdstringrequired

The branch being updated.

Request body
requiredapplication/json
namestring
citystring
vat_numberstring
addressstring
is_activeboolean
currency_codestring
Responses
200

Branch updated

idstringrequired
codestringrequired
namestringrequired
citystringrequired
vat_numberstringrequired
addressstringrequired
currency_codestringrequired
image_urlstringrequired
is_activebooleanrequired
is_deletedintegerrequired
min -9007199254740991 · max 9007199254740991
created_atstringrequired
updated_atstringrequired
400

No valid fields to update, or the currency is unknown

detailstringrequired
401

Not authenticated

detailstringrequired
403

Caller is not an admin

detailstringrequired
404

Branch not found

detailstringrequired
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X PUT 'http://localhost:8000/api/v1/branches/string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "city": "string",
  "vat_number": "string",
  "address": "string",
  "is_active": true,
  "currency_code": "string"
}'
Response
{
  "id": "string",
  "code": "string",
  "name": "string",
  "city": "string",
  "vat_number": "string",
  "address": "string",
  "currency_code": "string",
  "image_url": "string",
  "is_active": true,
  "is_deleted": -9007199254740991,
  "created_at": "string",
  "updated_at": "string"
}