fature.al është platforma e faturimit dhe fiskalizimit për bizneset në Shqipëri. Hap një llogari
Skip to content
fature.al API Menu

Shkarko PDF-në e fletës shoqëruese

GET /api/v1/invoice/wtn/pdf/{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.

Kthen fletën shoqëruese si PDF, të njëjtin dokument që printon paneli i fature.al: kompaninë, transportuesin, nisjen dhe mbërritjen, rreshtat e mallit, kodet fiskale dhe kodin QR të verifikimit.

Me format=thermal kthehet kuponi termik, me gjerësinë e kuponit të caktuar te konfigurimi i kompanisë. Pa format, ose me një vlerë tjetër, kthehet dokumenti A4.

Skedari quhet WTN-<numri>.pdf, me / të numrit të kthyer në -. Kur ju duhen vetëm të dhënat për ta formatuar vetë dokumentin, përdorni GET /invoice/wtn/print/{id}.

URL-ja e plotë: https://fature.al/api/v1/invoice/wtn/pdf/{id}

Path parameters

Name Tipi E detyrueshme Përshkrimi
id integer yes Id-ja e fletës shoqëruese në fature.al.

Query parameters

Name Tipi E detyrueshme Përshkrimi
format string no `a4` (parazgjedhja) ose `thermal` për kuponin termik.

Përgjigjet

200 PDF-ja e fletës shoqëruese.

Field Tipi Përshkrimi
status boolean
message any

401 Unauthenticated

Field Tipi Përshkrimi
message string

404 Fleta nuk u gjet, ose nuk i përket kompanisë suaj.

Field Tipi Përshkrimi
status boolean Gjithmonë false. Një përgjigje e suksesshme mban `status: true` dhe objektin `data`
message string Përshkrimi i gabimit. Bosh kur dështimi nuk mban ndonjë mesazh të vetin
errors array Mesazhe për t'u shfaqur te përdoruesi ose për t'u ruajtur në log. Mungon kur nuk ka gjë për të shtuar përtej `message`

500 Dokumenti nuk u krijua dot. Problemi raportohet automatikisht.

Field Tipi Përshkrimi
status boolean Gjithmonë false. Një përgjigje e suksesshme mban `status: true` dhe objektin `data`
message string Përshkrimi i gabimit. Bosh kur dështimi nuk mban ndonjë mesazh të vetin
errors array Mesazhe për t'u shfaqur te përdoruesi ose për t'u ruajtur në log. Mungon kur nuk ka gjë për të shtuar përtej `message`

Shembull kërkese

cURL
curl -X GET 'https://fature.al/api/v1/invoice/wtn/pdf/403' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'X-Client-Id: YOUR_CLIENT_ID' \
  -H 'X-Client-Secret: YOUR_CLIENT_SECRET' \
  -H 'Accept: application/json'
PHP (Laravel)
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',
])->get('https://fature.al/api/v1/invoice/wtn/pdf/403');

$data = $response->json();
PHP (Guzzle)
use GuzzleHttp\Client;

$client = new Client();

$response = $client->request('GET', 'https://fature.al/api/v1/invoice/wtn/pdf/403', [
    'headers' => [
        'Authorization' => 'Bearer YOUR_TOKEN',
        'X-Client-Id' => 'YOUR_CLIENT_ID',
        'X-Client-Secret' => 'YOUR_CLIENT_SECRET',
        'Accept' => 'application/json',
    ],
]);

$data = json_decode((string) $response->getBody(), true);
JavaScript
const response = await fetch('https://fature.al/api/v1/invoice/wtn/pdf/403', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'X-Client-Id': 'YOUR_CLIENT_ID',
    'X-Client-Secret': 'YOUR_CLIENT_SECRET',
    'Accept': 'application/json'
  }
});

const data = await response.json();

Shembull përgjigjeje

200
{
    "status": false,
    "message": "Hello there"
}
401
{
    "message": "Unauthenticated."
}
404
{
    "status": false,
    "message": "Te dhenat jo te sakta.",
    "errors": [
        "errors"
    ]
}
500
{
    "status": false,
    "message": "Te dhenat jo te sakta.",
    "errors": [
        "errors"
    ]
}

Regjistrimi është falas.

Regjistrohu në fature.al

This page as Markdown, or the whole API as OpenAPI.