/api/v1/on-boarding/certificate
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.
Ngarkon certifikatën elektronike të kompanisë (.p12 ose .pfx) bashkë me fjalëkalimin e saj.
Me të nënshkruhet çdo dokument që shkon te CIS-i, prandaj është hapi i parë pas regjistrimit.
certificate_fileështë skedari i certifikatës dhepasswordfjalëkalimi i saj.- Fjalëkalimi duhet ta hapë certifikatën.
- NIPT-i brenda certifikatës duhet të përputhet me NIPT-in e kompanisë.
Përgjigja kthen expiresAt, datën e skadimit të certifikatës. Ruajeni: pas asaj date
fiskalizimi ndalon derisa të ngarkohet një certifikatë e re.
Në sandbox pranohet çdo certifikatë dhe çdo fjalëkalim, dhe expiresAt është një vit nga sot.
URL-ja e plotë: https://fature.al/api/v1/on-boarding/certificate
Body parameters
| Name | Tipi | E detyrueshme | Përshkrimi |
|---|---|---|---|
| certificate_file | string<binary>, nullable | no | Certifikata elektronike e biznesit si skedar (.p12 ose .pfx). Me të nënshkruhet çdo faturë që shkon në fiskalizim; pa një certifikatë të vlefshme nuk lëshohet dot faturë. |
| password | string, nullable | no | Fjalëkalimi i certifikatës. Pa të skedari nuk hapet dhe nënshkrimi dështon. |
Përgjigjet
200 Kur fjalëkalimi është i gabuar, kur NIPT-i i certifikatës nuk përputhet me kompaninë, ose kur 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.cert | object | |
| data.cert.expiresAt | string | Data e skadimit të certifikatës, `YYYY-MM-DD`. Pas saj fiskalizimi ndalon derisa të ngarkohet një certifikatë e re. Në sandbox është një vit nga sot |
401 Unauthenticated
| Field | Tipi | Përshkrimi |
|---|---|---|
| message | string |
422 Të dhënat nuk kaluan validimin. Kjo përgjigje përdor fushën `success`, jo `status`, dhe `errors` është objekt sipas fushës.
| Field | Tipi | Përshkrimi |
|---|---|---|
| success | boolean | Gjithmonë false |
| message | string | Një rresht përmbledhës, i njëjtë për çdo dështim validimi |
| errors | object | Fushat që nuk kaluan validimin, secila me mesazhet e veta. Çelësat me pikë tregojnë brenda objekteve dhe elementëve të array-ve, p.sh. `lines.0.quantity` |
Shembull kërkese
curl -X POST 'https://fature.al/api/v1/on-boarding/certificate' \
-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 '{
"certificate_file": "certificate file",
"password": "correct-horse-battery"
}'
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/certificate', [
'certificate_file' => 'certificate file',
'password' => 'correct-horse-battery',
]);
$data = $response->json();
use GuzzleHttp\Client;
$client = new Client();
$response = $client->request('POST', 'https://fature.al/api/v1/on-boarding/certificate', [
'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' => [
'certificate_file' => 'certificate file',
'password' => 'correct-horse-battery',
],
]);
$data = json_decode((string) $response->getBody(), true);
const response = await fetch('https://fature.al/api/v1/on-boarding/certificate', {
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({
"certificate_file": "certificate file",
"password": "correct-horse-battery"
})
});
const data = await response.json();
Shembull përgjigjeje
{
"status": true,
"data": {
"cert": {
"expiresAt": "2027-09-13"
}
}
}
{
"message": "Unauthenticated."
}
{
"success": false,
"message": "Te dhena jo te sakta",
"errors": []
}