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

Anulo fature sipas Internal ID

POST /api/v1/invoice/cancel-by-internal-id/{internalId} Requires authentication Rate limited by the `api-global` limiter v1

Send a bearer token in the Authorization header.

Anulon faturen duke perdorur ID-ne tuaj interne qe keni derguar kur keni krijuar faturen.

Sillet njesoj si anulimi sipas ID, vetem se e gjen faturen me numrin tuaj:

  • pa trup anulohet e gjithe fatura;
  • me lines anulohet vetem nje pjese, e mundur vetem per faturat Cash;
  • rreshtat duhet te perputhen ne product_code dhe product_name, dhe sasia vetem ulet;
  • nje fature me zbritje mbi te gjithe faturen anulohet vetem e plote.

Perdoreni kur nuk doni te mbani id e fature.al prane shitjes tuaj.

Full URL: https://fature.al/api/v1/invoice/cancel-by-internal-id/{internalId}

Path parameters

Name Type Required Description
internalId string yes ID juaj interne, e derguar kur u krijua fatura.

Body parameters

Name Type Required Description
lines array no Rreshtat qe anulohen. Pa te anulohet e gjithe fatura; me te anulohet vetem pjesa e derguar, e mundur vetem per faturat Cash. Cdo rresht duhet te ekzistoje ne faturen origjinale me te njejtin `product_code` dhe `product_name`, dhe sasia mund vetem te ulet. Nje fature qe u leshua me zbritje mbi te gjithe faturen nuk pranon anulim te pjesshem: dergojeni kerkesen pa `lines` qe te anulohet e plote.
lines[].product_name string yes
lines[].product_code string yes
lines[].quantity number yes
lines[].price number, nullable no

Responses

201 Created

Field Type Description
status boolean
data object
data.invoice object
data.invoice.id integer Fatureal invoice id. Store it next to your own internalId
data.invoice.number string, nullable Fiscal invoice number
data.invoice.iic string, nullable IIC / NSLF
data.invoice.fic string, nullable FIC / NIVF. Null while the invoice waits for a deferred fiscalisation
data.invoice.tcrCode string, nullable TCR code of the fiscal device that issued it
data.invoice.businessCode string, nullable Business unit code the invoice was issued under
data.invoice.operatorCode string, nullable Operator code the invoice was issued under
data.invoice.fiscalizedAt string Creation timestamp (YYYY-MM-DD HH:MM:SS)
data.invoice.verifyURL string, nullable Government verification URL, the one behind the QR code
data.invoice.pdf string Direct download URL for the document. On an e-invoice that already has an EIC this points at the official e-invoice PDF instead of ours
data.invoice.eic string, nullable EIC. The key is present only on an e-invoice that already has one, so treat it as absent rather than null on every other invoice

404 Fatura nuk u gjet, ose nuk i perket kompanise suaj.

Field Type Description
status boolean Always false. A successful response carries `status: true` and a `data` object instead
message string The exception message. Empty when the failure carries no exception of its own
errors array Messages to show the operator or to log. Absent when the failure has nothing to add beyond `message`

422 Fatura nuk mund te anulohet ne gjendjen e saj aktuale.

Field Type Description
status boolean Always false. A successful response carries `status: true` and a `data` object instead
message string The exception message. Empty when the failure carries no exception of its own
errors array Messages to show the operator or to log. Absent when the failure has nothing to add beyond `message`

429 Kufiri i anulimeve u arrit. Pergjigja kthen vetem `message` bashke me header-in `Retry-After`.

Field Type Description
message string

500 Gabim i papritur ne server. Perfshin rastin kur anulimi nuk u regjistrua ne fiskalizim.

Field Type Description
status boolean Always false. A successful response carries `status: true` and a `data` object instead
message string The exception message. Empty when the failure carries no exception of its own
errors array Messages to show the operator or to log. Absent when the failure has nothing to add beyond `message`

Example request

cURL
curl -X POST 'https://fature.al/api/v1/invoice/cancel-by-internal-id/CASH-001' \
  -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 '{
    "lines": [
        {
            "product_name": "Jane Doe",
            "product_code": "product code",
            "quantity": 2,
            "price": 1999
        }
    ]
}'
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',
    'Content-Type' => 'application/json',
])->post('https://fature.al/api/v1/invoice/cancel-by-internal-id/CASH-001', [
    'lines' => [
        [
            'product_name' => 'Jane Doe',
            'product_code' => 'product code',
            'quantity' => 2,
            'price' => 1999,
        ],
    ],
]);

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

$client = new Client();

$response = $client->request('POST', 'https://fature.al/api/v1/invoice/cancel-by-internal-id/CASH-001', [
    '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' => [
        'lines' => [
            [
                'product_name' => 'Jane Doe',
                'product_code' => 'product code',
                'quantity' => 2,
                'price' => 1999,
            ],
        ],
    ],
]);

$data = json_decode((string) $response->getBody(), true);
JavaScript
const response = await fetch('https://fature.al/api/v1/invoice/cancel-by-internal-id/CASH-001', {
  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({
      "lines": [
          {
              "product_name": "Jane Doe",
              "product_code": "product code",
              "quantity": 2,
              "price": 1999
          }
      ]
  })
});

const data = await response.json();

Example response

201
{
    "status": true,
    "data": {
        "invoice": {
            "id": 1,
            "number": "number",
            "iic": "iic",
            "fic": "fic",
            "tcrCode": "tcrCode",
            "businessCode": "businessCode",
            "operatorCode": "operatorCode",
            "fiscalizedAt": "fiscalizedAt",
            "verifyURL": "https://example.com",
            "pdf": "pdf",
            "eic": "eic"
        }
    }
}
404
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
422
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
429
{
    "message": "Hello there"
}
500
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}

Regjistrimi eshte falas.

Regjistrohu ne fature.al

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