/api/v1/cash-register/withdraw
Requires authentication
Rate limited by the `api-global` limiter
v1
Send a bearer token in the Authorization header.
Regjistron para qe dalin nga arka, si nje pagese furnitori ose terheqje ne fund te dites.
Veprimi ruhet si MONEY_OUT.
amountduhet te jete gjithmone me e madhe se0. Shenja vjen nga endpoint-i qe thirret, jo nga numri.- Kerkon nje pajisje fiskale (TCR) te lidhur.
Full URL: https://fature.al/api/v1/cash-register/withdraw
Body parameters
| Name | Type | Required | Description |
|---|---|---|---|
| amount | number | yes | Vlera e veprimit, gjithmone me e madhe se 0. |
| description | string, maxLength 255, nullable | no | Pershkrimi i veprimit. |
| third_party | string, maxLength 255, nullable | no | Pala e trete per veprimin. |
| id_client | integer, nullable | no | ID e nje klienti tuaj, per ta lidhur veprimin me te. Kthehet me pas ne listen e veprimeve. Nje ID qe nuk i perket kompanise suaj refuzohet. |
Responses
200 Kur perdoruesi nuk ka pajisje fiskale ose arka nuk ka fonde te mjaftueshme, pergjigja kthehet me HTTP 200 dhe `status: false`.
201 Created
| Field | Type | Description |
|---|---|---|
| status | boolean | |
| data | object | |
| data.id | integer | |
| data.action_type | string | |
| data.amount | number | |
| data.currency | string | |
| data.transaction_date | string | |
| data.transaction_no | integer | |
| data.cash_action_no | string | |
| data.fiscal_status | string, nullable | |
| data.fiscal_uuid | string, nullable | |
| data.fiscal_fic | string, nullable | |
| data.description | string |
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/cash-register/withdraw' \
-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 '{
"amount": 1500,
"description": "Arketim nga klienti",
"third_party": "Klienti XYZ",
"id_client": 42
}'
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/cash-register/withdraw', [
'amount' => 1500,
'description' => 'Arketim nga klienti',
'third_party' => 'Klienti XYZ',
'id_client' => 42,
]);
$data = $response->json();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('POST', 'https://fature.al/api/v1/cash-register/withdraw', [
'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' => [
'amount' => 1500,
'description' => 'Arketim nga klienti',
'third_party' => 'Klienti XYZ',
'id_client' => 42,
],
]);
$data = json_decode((string) $response->getBody(), true);
const response = await fetch('https://fature.al/api/v1/cash-register/withdraw', {
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({
"amount": 1500,
"description": "Arketim nga klienti",
"third_party": "Klienti XYZ",
"id_client": 42
})
});
const data = await response.json();
Example response
{
"status": true,
"data": {
"id": 1,
"action_type": "action type",
"amount": 4200,
"currency": "USD",
"transaction_date": "transaction date",
"transaction_no": 1,
"cash_action_no": "cash action no",
"fiscal_status": "fiscal status",
"fiscal_uuid": "9f8c7b6a-5d4e-3f2a-1b0c-9d8e7f6a5b4c",
"fiscal_fic": "fiscal fic",
"description": "A short description."
}
}
{
"success": true,
"message": "Hello there",
"errors": []
}