---
title: "Anulo fature sipas Internal ID"
operation_id: "post-api-v1-invoice-cancel-by-internal-id-internalid"
method: POST
path: "/api/v1/invoice/cancel-by-internal-id/{internalId}"
group: "Faturat"
api_version: "v1"
authenticated: true
canonical: "https://fature.al/api-reference/endpoints/post-api-v1-invoice-cancel-by-internal-id-internalid.html"
---

# Anulo fature sipas Internal ID

Part of the [fature.al API](/api-reference/index.html) documentation.

## POST /api/v1/invoice/cancel-by-internal-id/{internalId}

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}`

API version: `v1`.

Authentication: required (bearer token).

### 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 |  |

### Example request

```bash
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
        }
    ]
}'
```

### 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 |

```json
{
    "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** — 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` |

```json
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
```

**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` |

```json
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
```

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

| Field | Type | Description |
| --- | --- | --- |
| `message` | string |  |

```json
{
    "message": "Hello there"
}
```

**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` |

```json
{
    "status": true,
    "message": "Hello there",
    "errors": [
        "errors"
    ]
}
```
