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

Create a branch

Admin only. Registers a branch with its code, name, and city, active on creation. The code has to be unique, and the trade currency must already exist in the registry or the branch is refused.

POST/api/v1/branches
Authorization
AuthorizationBearer token (JWT) · headerrequired

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

Request body
requiredapplication/json
codestringrequired
namestringrequired
citystringrequired
vat_numberstring
addressstring
currency_codestring
Responses
201

Branch created

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

A required field is missing, the branch code already exists, or the currency is unknown

detailstringrequired
401

Not authenticated

detailstringrequired
403

Caller is not an admin

detailstringrequired
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST 'http://localhost:8000/api/v1/branches' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "code": "string",
  "name": "string",
  "city": "string",
  "vat_number": "string",
  "address": "string",
  "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"
}