/api/v1/on-boarding/branch
Requires authentication
Rate limited by the `api-global` limiter
v1
Send a bearer token in the Authorization header.
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
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. |
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 |
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` |
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` |
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` |
Example request
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"
}'
use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
'Authorization' => 'Bearer YOUR_TOKEN',
'X-Client-Id' => 'YOUR_CLIENT_ID',
'X-Client-Secret' => 'YOUR_CLIENT_SECRET',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
])->post('https://fature.al/api/v1/on-boarding/branch', [
'name' => 'Dega Tirane',
'type' => 'main',
'administrator' => 'Festim Peposhi',
'address' => 'Rruga e Kavajes 12, Tirane',
'businessUnitCode' => 'bb123bb123',
]);
$data = $response->json();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('POST', 'https://fature.al/api/v1/on-boarding/branch', [
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'X-Client-Id' => 'YOUR_CLIENT_ID',
'X-Client-Secret' => 'YOUR_CLIENT_SECRET',
'Accept' => 'application/json',
'Content-Type' => 'application/json',
],
'json' => [
'name' => 'Dega Tirane',
'type' => 'main',
'administrator' => 'Festim Peposhi',
'address' => 'Rruga e Kavajes 12, Tirane',
'businessUnitCode' => 'bb123bb123',
],
]);
$data = json_decode((string) $response->getBody(), true);
const response = await fetch('https://fature.al/api/v1/on-boarding/branch', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'X-Client-Id': 'YOUR_CLIENT_ID',
'X-Client-Secret': 'YOUR_CLIENT_SECRET',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"name": "Dega Tirane",
"type": "main",
"administrator": "Festim Peposhi",
"address": "Rruga e Kavajes 12, Tirane",
"businessUnitCode": "bb123bb123"
})
});
const data = await response.json();
Example response
{
"status": true,
"data": {
"branch": {
"id": 1,
"name": "Jane Doe",
"type": "type",
"administrator": "administrator",
"address": "1 Example Street",
"businessUnitCode": "businessUnitCode"
}
}
}
{
"status": true,
"message": "Hello there",
"errors": [
"errors"
]
}
{
"status": true,
"message": "Hello there",
"errors": [
"errors"
]
}
{
"success": true,
"message": "Hello there",
"errors": []
}