/api/v2/cash-register/open-balance
Requires authentication
Rate limited by the `api-global` limiter
v2
Send a bearer token, plus the X-Client-Id and X-Client-Secret headers in the Authorization header.
Hap ditën e punës në pajisjen fiskale (TCR) të përdoruesit të token-it me gjendjen fillestare
balance, në ALL, dhe e regjistron si veprim OPEN_DAY.
Thirreni në fillim të turnit, para faturës së parë cash. Nuk është e detyrueshme: fatura e
parë cash, një hyrje, një dalje ose mbyllja e hapin vetë ditën me 0. Përdoreni kur dita
nis me para në arkë dhe doni që gjendja të jetë e saktë.
balanceështë opsional; pa të merret0. Një vlerë negative refuzohet.- Përdoruesi duhet të ketë një TCR.
Përgjigja kthen balance të rrumbullakosur në dy shifra pas presjes, siç u ruajt. Kur CIS-i
nuk arrihet, hapja ruhet dhe fiskalizohet vetë më vonë; përgjigja është e njëjtë.
URL-ja e plotë: https://fature.al/api/v2/cash-register/open-balance
Body parameters
| Name | Tipi | E detyrueshme | Përshkrimi |
|---|---|---|---|
| balance | number | no | Gjendja me të cilën nis dita, në lekë. Pa të merret `0`. Një vlerë negative refuzohet. |
Përgjigjet
200 Kur përdoruesi nuk ka pajisje fiskale, kur `balance` është negative, ose kur ruajtja dështon, përgjigja kthehet me HTTP 200 dhe `status: false`; arsyeja është te `message`.
| Field | Tipi | Përshkrimi |
|---|---|---|
| status | boolean | |
| data | object | |
| data.balance | number | Gjendja fillestare e ditës, në lekë, ashtu siç u pranua nga `balance` e kërkesës; `0` kur `balance` nuk u dërgua |
401 Unauthenticated
| Field | Tipi | Përshkrimi |
|---|---|---|
| message | string |
Shembull kërkese
curl -X POST 'https://fature.al/api/v2/cash-register/open-balance' \
-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 '{
"balance": 5000
}'
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/v2/cash-register/open-balance', [
'balance' => 5000,
]);
$data = $response->json();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('POST', 'https://fature.al/api/v2/cash-register/open-balance', [
'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' => [
'balance' => 5000,
],
]);
$data = json_decode((string) $response->getBody(), true);
const response = await fetch('https://fature.al/api/v2/cash-register/open-balance', {
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({
"balance": 5000
})
});
const data = await response.json();
Shembull përgjigjeje
{
"status": true,
"data": {
"balance": 5000
}
}
{
"message": "Unauthenticated."
}