---
search:
  tags:
    - Branches
    - POST
seo:
  description: >-
    Admin only. Registers a branch with its code, name, and city, active on
    creation. The… Reference for the POST /api/v1/branches endpoint in the
    PharmaFlow API.
sidebar:
  label: Create a branch
  badge: POST
title: Create a branch
type: openapi-operation
---
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`

**Request body** (`application/json`, required)

- `code` (string, required)
- `name` (string, required)
- `city` (string, required)
- `vat_number` (string)
- `address` (string)
- `currency_code` (string)

Request body example:

```json
{
  "code": "string",
  "name": "string",
  "city": "string",
  "vat_number": "string",
  "address": "string",
  "currency_code": "string"
}
```

**Responses**

- `201` — Branch created
- `400` — A required field is missing, the branch code already exists, or the currency is unknown
- `401` — Not authenticated
- `403` — Caller is not an admin

Response example, 201:

```json
{
  "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"
}
```
