fature.al eshte platforma e faturimit dhe fiskalizimit per bizneset ne Shqiperi. Hap nje llogari
Skip to content
fature.al API Menu

Lista e produkteve

GET /api/v1/products Requires authentication Rate limited by the `api-global` limiter v1

Send a bearer token in the Authorization header.

Katalogu i produkteve te kompanise. Perjashtohen produktet e fshira dhe ato qe nuk jane per shitje, prandaj kjo eshte lista qe mund ta perdorni per te ndertuar nje arke ose nje katalog.

Filtrat#

Te gjithe parametrat jane opsionale dhe kombinohen me njeri-tjetrin. Nje kerkese pa asnje parameter kthen te gjithe katalogun, njesoj si me pare.

Parametri Cfare ben
query Kerkim ne emer, kod ose pershkrim. Perputhja eshte e pjesshme dhe nuk dallon shkronjat e medha
id_category Vetem produktet e nje kategorie, sipas id nga GET /product/categories
service true kthen vetem sherbimet, false vetem artikujt e inventarit
limit dhe offset Faqosja. Pa limit kthehet i gjithe rezultati dhe offset nuk zbatohet

Faqosja#

data mbetet lista e produkteve, ashtu si ka qene gjithmone. Numeruesit vijne ne pagination krahas saj dhe jo brenda saj, qe nje program i shkruar para filtrave te vazhdoje te lexoje data si me pare, pa asnje ndryshim.

pagination.total eshte numri i produkteve qe i pergjigjen filtrave, ndersa pagination.records eshte sa u kthyen ne kete faqe. Kur nuk dergoni limit, te dyja jane te njejta, pagination.limit kthehet null dhe offset nuk merret parasysh: faqosja ka kuptim vetem kur i dergoni te dy bashke.

Per te marre faqen e dyte me nga 50 produkte: ?limit=50&offset=50. Vazhdoni derisa offset + records te arrije total.

GET /products?query=kafe&id_category=3&limit=50

Kur limiti i kerkesave arrihet ose ndodh nje gabim i papritur, pergjigja kthehet me HTTP 200 dhe status: false, prandaj lexoni status dhe jo vetem kodin HTTP.

Full URL: https://fature.al/api/v1/products

Query parameters

Name Type Required Description
query string no Kerkim ne emer, kod ose pershkrim te produktit.
id_category integer no Vetem produktet e kesaj kategorie, nga GET /product/categories.
service boolean no true kthen vetem sherbimet, false vetem artikujt e inventarit. Pa te kthehen te dyja.
limit integer no Sa produkte te kthehen, deri ne 500. Pa te kthehet i gjithe katalogu.
offset integer no Nga cili produkt te fillohet. Zbatohet vetem bashke me `limit`. Defaults to `0`.

Responses

200 OK

Field Type Description
status boolean
data array
data[].id integer
data[].code string, nullable Unique product code
data[].name string
data[].description string, nullable
data[].unit string, nullable Unit of measure, derived from unit_code
data[].unit_code string, nullable Unit of measure code, e.g. C62, XPP, LTR
data[].last_price number Sale price
data[].cost_price number, nullable Purchase price, when one is recorded
data[].vat_rate number VAT rate percent: 0, 6, 10 or 20
data[].vat_exempt_type string, nullable VAT exemption type, when the product is exempt
data[].vat_exempt_description string, nullable The exemption type spelled out in the account language
data[].currency string, nullable
data[].id_category integer, nullable
pagination object
pagination.records integer
pagination.total integer
pagination.limit integer, nullable
pagination.offset integer

Example request

cURL
curl -X GET 'https://fature.al/api/v1/products' \
  -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/products');

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

$client = new Client();

$response = $client->request('GET', 'https://fature.al/api/v1/products', [
    '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/products', {
  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();

Example response

200
{
    "status": true,
    "data": [
        {
            "id": 1,
            "code": "code",
            "name": "Jane Doe",
            "description": "A short description.",
            "unit": "unit",
            "unit_code": "unit code",
            "last_price": 1999,
            "cost_price": 1999,
            "vat_rate": 19.99,
            "vat_exempt_type": "vat exempt type",
            "vat_exempt_description": "A short description.",
            "currency": "USD",
            "id_category": 1
        }
    ],
    "pagination": {
        "records": 1,
        "total": 4200,
        "limit": 25,
        "offset": 0
    }
}

Regjistrimi eshte falas.

Regjistrohu ne fature.al

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