/api/v1/on-boarding/user/{id}
Requires authentication
Rate limited by the `api-global` limiter
v1
Send a bearer token, plus the X-Client-Id and X-Client-Secret headers in the Authorization header.
Vendos emrin, njësinë, kodin e operatorit dhe pajisjen fiskale të një përdoruesi. Këtu lidhet
përdoruesi i parë, ai që krijoi POST /register, me operatorCode dhe, për fatura cash, me
fiscalTcrCode.
operatorCodeështë kodi i operatorit që merret nga self-care; pa të përdoruesi nuk lëshon fatura.fiscalTcrCodeështë kodi që ktheuPOST /on-boarding/fiscal-devicedhe duhet dërguar në çdo thirrje: pa të, ose me një kod që nuk gjendet mes pajisjeve të kompanisë, përdoruesi mbetet pa pajisje fiskale, pa gabim.branchIdduhet të jetë njësi e kompanisë suaj; ndryshe kërkesa refuzohet me200dhestatus: false.name,branchIddheoperatorCodeqë nuk dërgohen mbeten siç janë.- Body nuk validohet veçmas, prandaj nuk ka përgjigje
422.
URL-ja e plotë: https://fature.al/api/v1/on-boarding/user/{id}
Path parameters
| Name | Tipi | E detyrueshme | Përshkrimi |
|---|---|---|---|
| id | integer | yes | Id-ja e përdoruesit. |
Body parameters
| Name | Tipi | E detyrueshme | Përshkrimi |
|---|---|---|---|
| fiscalTcrCode | string | no | Kodi TCR i pajisjes fiskale që do të përdorë përdoruesi, nga `POST /on-boarding/fiscal-device`. Vetëm për fatura cash. |
| name | string | no | Emri i përdoruesit. Pa të mbetet ai ekzistues. |
| branchId | integer | no | Id-ja e njësisë së biznesit ku punon përdoruesi. Pa të mbetet ajo ekzistuese. |
| operatorCode | string | no | Kodi i operatorit, i marrë nga self-care. I domosdoshëm për lëshimin e faturave. |
Përgjigjet
200 Kur përdoruesi ose njësia nuk gjendet, ose ruajtja dështon, përgjigja kthehet me HTTP 200 dhe `status: false`; arsyeja është te `message` ose te `errors`.
| Field | Tipi | Përshkrimi |
|---|---|---|
| status | boolean | |
| data | object | |
| data.user | object | |
| data.user.id | integer | Id-ja e përdoruesit në fature.al |
| data.user.name | string | Emri i përdoruesit pas ruajtjes |
| data.user.operatorCode | string | Kodi i operatorit pas ruajtjes |
401 Unauthenticated
| Field | Tipi | Përshkrimi |
|---|---|---|
| message | string |
Shembull kërkese
curl -X POST 'https://fature.al/api/v1/on-boarding/user/7' \
-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 '{
"fiscalTcrCode": "ab123ab123",
"name": "Ana Hoxha",
"branchId": 12,
"operatorCode": "aa123aa123"
}'
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/user/7', [
'fiscalTcrCode' => 'ab123ab123',
'name' => 'Ana Hoxha',
'branchId' => 12,
'operatorCode' => 'aa123aa123',
]);
$data = $response->json();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('POST', 'https://fature.al/api/v1/on-boarding/user/7', [
'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' => [
'fiscalTcrCode' => 'ab123ab123',
'name' => 'Ana Hoxha',
'branchId' => 12,
'operatorCode' => 'aa123aa123',
],
]);
$data = json_decode((string) $response->getBody(), true);
const response = await fetch('https://fature.al/api/v1/on-boarding/user/7', {
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({
"fiscalTcrCode": "ab123ab123",
"name": "Ana Hoxha",
"branchId": 12,
"operatorCode": "aa123aa123"
})
});
const data = await response.json();
Shembull përgjigjeje
{
"status": true,
"data": {
"user": {
"id": 7,
"name": "Ana Hoxha",
"operatorCode": "aa123aa123"
}
}
}
{
"message": "Unauthenticated."
}