---
title: "Krijo njesi biznesi (Branch)"
operation_id: "api.v1.on-boarding.branch-create"
method: POST
path: "/api/v1/on-boarding/branch"
group: "Regjistrimi"
api_version: "v1"
authenticated: true
canonical: "https://fature.al/api-reference/endpoints/api-v1-on-boarding-branch-create.html"
---

# Krijo njesi biznesi (Branch)

Part of the [fature.al API](/api-reference/index.html) documentation.

## POST /api/v1/on-boarding/branch

Krijoni nje njesi biznesi te re per kompanine tuaj. Lloji jepet ne fushen `type` si enum:
`main` per seline qendrore dhe `secondary` per nje njesi dytesore. Kompania mund te kete
vetem nje seli qendrore, prandaj `main` refuzohet nese ajo ekziston (kodi 409).

Numri i njesive varet nga abonimi. Kur limiti eshte arritur kerkesa refuzohet me kodin 403.

Kodi i biznesit (`businessUnitCode`) mund te dergohet me vone me `POST /on-boarding/branch/{id}`,
por eshte i domosdoshem per leshimin e faturave nga kjo njesi.

Full URL: `https://fature.al/api/v1/on-boarding/branch`

API version: `v1`.

Authentication: required (bearer token).

### Body parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string, maxLength 255 | yes | Emri i njesise se biznesit, ai qe del ne fature. |
| `type` | string | yes | Lloji i njesise: `main` per seline qendrore, `secondary` per nje seli dytesore. |
| `administrator` | string, maxLength 255 | yes | Emri i personit pergjegjes per njesine. |
| `address` | string, maxLength 255 | yes | Adresa e njesise, e cila shkon ne sistemin fiskal. |
| `businessUnitCode` | string, maxLength 50, nullable | no | Kodi i njesise se biznesit nga tatimet. Pa te, njesia merr nje kod te ri. |

### Example request

```bash
curl -X POST 'https://fature.al/api/v1/on-boarding/branch' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'X-Client-Id: YOUR_CLIENT_ID' \
  -H 'X-Client-Secret: YOUR_CLIENT_SECRET' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Dega Tirane",
    "type": "main",
    "administrator": "Festim Peposhi",
    "address": "Rruga e Kavajes 12, Tirane",
    "businessUnitCode": "bb123bb123"
}'
```

### Responses

**200** — Kur krijimi deshton per nje arsye tjeter, pergjigja kthehet me HTTP 200 dhe `status: false`.

**201** — Created

| Field | Type | Description |
| --- | --- | --- |
| `status` | boolean |  |
| `data` | object |  |
| `data.branch` | object |  |
| `data.branch.id` | integer |  |
| `data.branch.name` | string |  |
| `data.branch.type` | string |  |
| `data.branch.administrator` | string |  |
| `data.branch.address` | string |  |
| `data.branch.businessUnitCode` | string |  |

```json
{
    "status": true,
    "data": {
        "branch": {
            "id": 1,
            "name": "Jane Doe",
            "type": "type",
            "administrator": "administrator",
            "address": "1 Example Street",
            "businessUnitCode": "businessUnitCode"
        }
    }
}
```

**403** — Abonimi nuk lejon me njesi biznesi.

| Field | Type | Description |
| --- | --- | --- |
| `status` | boolean | Always false. A successful response carries `status: true` and a `data` object instead |
| `message` | string | The exception message. Empty when the failure carries no exception of its own |
| `errors` | array | Messages to show the operator or to log. Absent when the failure has nothing to add beyond `message` |

```json
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
```

**409** — Kompania ka tashme nje seli qendrore.

| Field | Type | Description |
| --- | --- | --- |
| `status` | boolean | Always false. A successful response carries `status: true` and a `data` object instead |
| `message` | string | The exception message. Empty when the failure carries no exception of its own |
| `errors` | array | Messages to show the operator or to log. Absent when the failure has nothing to add beyond `message` |

```json
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
```

**422** — Te dhenat nuk kaluan validimin. Kjo pergjigje perdor fushen `success`, jo `status`.

| Field | Type | Description |
| --- | --- | --- |
| `success` | boolean | Always false |
| `message` | string | A single summary line, the same for every validation failure |
| `errors` | object | The failing fields, each with the messages for it. Dotted keys point into nested objects and array items, e.g. `lines.0.quantity` |

```json
{
    "success": true,
    "message": "Hello there",
    "errors": []
}
```
