A product of NPOST, open to everyone DevelopersGuidesHelp Shqip English Srpski

Developers

REST API reference

Fiscalise sales, cancellations and returns, deliver receipts and read reports over HTTPS and JSON. Sandbox and live use the same calls.

Overview

The FISKALIX REST API fiscalises sales, cancellations and returns, delivers receipts to buyers, and reads reports. It is JSON over HTTPS. A call answers at once with the signed receipt and its QR code; ATK's confirmation follows within moments and arrives as a webhook or on the next read.

EnvironmentBase URLKeysReceipts go to
Sandboxhttps://sandbox.fiskalix.com/api/v1fx_test_…ATK test environment
Livehttps://app.fiskalix.com/api/v1fx_live_…ATK production, after verification
  • Requests and answers are application/json. Send Accept: application/json.
  • Amounts are decimal text in euro, for example "19.95". Item prices include VAT. An item price may have up to four decimals, a quantity up to three.
  • Times are UTC in ISO 8601, for example 2026-11-09T09:14:07Z. Reports use whole days in Kosovo time.
  • A test key only reaches test receipts and the ATK test host; a live key only reaches production. Neither can see the other's data.

Quickstart

  1. Create a sandbox account and add a point of sale (see the guide).
  2. In the panel open Integrations, add an integration and issue a test key. It is shown once.
  3. Fiscalise a sale:
curl
curl -X POST https://sandbox.fiskalix.com/api/v1/receipts \
  -H "Authorization: Bearer fx_test_YOUR_KEY" \
  -H "Content-Type: application/json" -H "Accept: application/json" \
  -d '{
    "reference": "ORDER-1001",
    "operator": "webshop",
    "items": [
      {"name": "Cotton shirt", "unit_price": "19.95", "quantity": "1", "vat": "E"},
      {"name": "Bread", "unit_price": "0.80", "quantity": "2", "vat": "D"}
    ],
    "payments": [{"type": "card", "amount": "21.55"}]
  }'

The answer is 201 with the receipt. Sending the same reference again answers 200 with the same receipt and issues nothing new.

JSON
{
  "id": 1,
  "merchant": "811397703",
  "reference": "ORDER-1001",
  "type": "sale",
  "status": "queued",
  "coupon_id": 1788912345,
  "verification_no": "K7Q2M9XD4PA1B6ZE",
  "issued_at": "2026-11-09T09:14:07Z",
  "original_receipt_id": null,
  "total": "21.55",
  "total_tax": "3.04",
  "total_no_tax": "18.51",
  "total_discount": "0.00",
  "returned_total": "0.00",
  "items": [
    {"line": 1, "name": "Cotton shirt", "quantity": "1", "unit": "CP", "unit_price": "19.95",
     "vat": "E", "category": "TT", "discount": "0.00", "total": "19.95", "tax": "3.04",
     "returned_quantity": "0"}
  ],
  "payments": [{"type": "card", "amount": "21.55"}],
  "tax_groups": [{"vat": "E", "base": "16.91", "tax": "3.04"}],
  "qr": "...",
  "atk": {"environment": "test", "transaction_id": null, "accepted_at": null, "attempts": 0, "error": null},
  "deliveries": [],
  "links": {
    "self": "https://sandbox.fiskalix.com/api/v1/receipts/1",
    "page": "https://sandbox.fiskalix.com/receipts/1",
    "public": "https://fiska.li/x/K7Q2M9XD",
    "pdf": "https://fiska.li/x/K7Q2M9XD.pdf"
  }
}

Authentication

Every call carries the key in the Authorization header: Authorization: Bearer fx_test_…. Keys are issued per integration in the panel and stored only as hashes: they cannot be shown again, only revoked and replaced.

Integration kindActs forMerchant in the call
MerchantIts own merchantOptional. If given, it must be that merchant's NUI.
Platform (for example NPORTAL)The merchants a FISKALIX administrator linked to itRequired: "merchant": "811397703" in the body, or ?merchant=811397703 on reads.

GET /merchants shows what a key can reach.

Errors

Errors answer with a JSON body {"message": "..."}. A 422 for a field adds "errors": {"field": ["..."]}.

StatusMeaning
401The key is missing or wrong.
403The integration is suspended, the merchant is suspended, or the key cannot act for that merchant.
404The receipt, delivery or endpoint does not exist for this key. A receipt of another merchant or environment answers exactly like one that was never issued, so an id cannot be probed.
422The call is invalid: a missing field, a payment total that does not match, an unknown payment type, a return of more than was sold, a platform key without merchant, or a merchant without an onboarded point of sale in this environment.
5xxTry again with the same reference.

Idempotency and retries

Send your own order or shipment number as reference on sales, cancellations, returns and deliveries. Repeating a call with the same reference never issues a second receipt: it answers 200 with the first one. Therefore a timeout is always safe to retry. Without a reference a retry would fiscalise the sale twice, because receipts are never merged or deleted.

Merchants

GET/merchants

The merchants this key may act for, with their points of sale in the key's environment. Use points_of_sale[].id as pos when a merchant has more than one.

JSON
{
  "integration": {
    "name": "NPORTAL",
    "kind": "platform"
  },
  "environment": "test",
  "merchants": [
    {
      "nui": "811397703",
      "name": "Shop",
      "business_name": "Shop L.L.C.",
      "status": "active",
      "points_of_sale": [
        {
          "id": 1,
          "name": "Webshop",
          "branch_id": 1,
          "pos_id": 1,
          "location": "Prishtinë"
        }
      ]
    }
  ]
}

Receipts

Create a sale

POST/receipts

FieldTypeNotes
merchantstringNUI. Required for a platform key.
posintegerPoint of sale id. Default: the merchant's first active one in this environment.
referencestring, 100Your own id. Makes the call idempotent.
operatorstring, 50Required. Who made the sale.
itemsarray, 1–500Required. Each: name (200), unit_price (VAT included), vat (A exempt, C 0%, D 8%, E 18%); optional quantity (default 1), unit (ATK unit code, default CP), category (ATK code, default TT), discount.
paymentsarray, 1–10Required. Each: type (cash, card, voucher, cheque, crypto, other) and amount. They must add up to the total.
notifyobjectDeliver the receipt electronically: email, sms (+383…), name, reference. See Deliveries.

Answers 201 with the receipt object, or 200 when the reference had been used.

Read a receipt

GET/receipts/{id}

Returns the receipt object. Poll this, or use webhooks, until status is accepted.

The receipt object

FieldMeaning
idFISKALIX receipt id, used in URLs.
typesale, cancel or return.
statusqueued (signed, not yet confirmed by ATK), accepted or rejected. Receipts are never edited or deleted.
coupon_id, verification_noThe fiscal coupon number and the verification number (NUIKF) printed on the receipt.
original_receipt_idOn a cancel or return: the sale it refers to.
total, total_tax, total_no_tax, total_discountTotals in EUR.
returned_totalOn a sale: how much has been returned so far.
items[]Lines numbered from 1, with total and tax; on a sale also returned_quantity; on a return original_line.
tax_groups[]Base and VAT per class.
qrThe text of the QR code to print or render.
atkenvironment, transaction_id, accepted_at, attempts, error.
deliveries[]E-mails and SMS sent for this receipt.
linksself, page (panel), public (the buyer's page) and pdf.

If ATK does not answer, the receipt stays queued and is reported again with growing pauses for 48 hours.

Cancel a sale

POST/receipts/{id}/cancel

Issues a linked Cancel receipt for the whole sale. Body: operator (required), reference, notify. Answers 201. Only a sale that ATK has accepted can be cancelled (a queued one answers 422: wait for receipt.accepted), and not once items of it have been returned.

curl
curl -X POST https://sandbox.fiskalix.com/api/v1/receipts/1/cancel \
  -H "Authorization: Bearer fx_test_YOUR_KEY" \
  -H "Content-Type: application/json" -H "Accept: application/json" \
  -d '{"operator": "sorter", "reference": "CANCEL-1001"}'

Return items

POST/receipts/{id}/return

Issues a linked Return receipt for named lines. Body: operator (required), reference, notify, and optionally:

  • items: [{"line": 1, "quantity": "1"}]. A line without quantity returns what is left of it. Without items, everything that is left of the sale is returned.
  • payments: how the money goes back. Without it the refund follows the way the sale was paid; one payment may leave out amount and then takes the whole refund.
curl
curl -X POST https://sandbox.fiskalix.com/api/v1/receipts/1/return \
  -H "Authorization: Bearer fx_test_YOUR_KEY" \
  -H "Content-Type: application/json" -H "Accept: application/json" \
  -d '{
    "operator": "sorter",
    "reference": "RMA-1",
    "items": [{"line": 1, "quantity": "1"}],
    "payments": [{"type": "cash"}]
  }'

Rules: only an accepted sale that is not cancelled can have items returned; a line never returns more than was sold, counting earlier returns that ATK did not reject; the returned part carries its share of the discount. An exchange is a return followed by a new sale.

Deliveries (e-mail and SMS)

Deliver a receipt to the buyer with notify on the sale, or later for an existing receipt:

POST/receipts/{id}/deliveries

Body: channel (email or sms), recipient (an address or +383 number), optional name and reference (idempotent). Answers 201, or 200 for a repeated reference.

curl
curl -X POST https://sandbox.fiskalix.com/api/v1/receipts/1/deliveries \
  -H "Authorization: Bearer fx_test_YOUR_KEY" \
  -H "Content-Type: application/json" -H "Accept: application/json" \
  -d '{"channel": "sms", "recipient": "+383 44 123 456", "reference": "TASK-77"}'

GET/deliveries/{id}

Fields: status (queued, held, sent, delivered, failed, suppressed, expired), reason (why it is held), error, cost, sent_at, delivered_at.

E-mail and SMS are charged to the merchant's wallet when the provider accepts the message; test deliveries are free and reach only the merchant's own contacts. On cancel and return, leaving notify out sends the correction to the addresses the sale went to; "notify": null sends nothing. A wrong address never stops a receipt: the receipt is issued and deliveries is empty.

Reports and wallet

GET/reports/summary

Query: from and to (whole days, 2026-11-05, both included; default the current month to date), pos (one point of sale), merchant (platform keys).

curl
curl "https://sandbox.fiskalix.com/api/v1/reports/summary?from=2026-11-01&to=2026-11-09&merchant=811397703" \
  -H "Authorization: Bearer fx_test_YOUR_KEY"

The answer has totals (sales, cancellations, returns with counts and amounts, plus net_total, net_no_tax, net_tax, net_discount), by_vat, by_payment, by_day, by_pos, waiting_for_atk and rejected_count. Receipts count on the day they are issued; cancellations and returns are subtracted on the day they are issued; rejected receipts are left out.

GET/wallet

Balance, credit limit, whether the balance is low, the tariff and this month's usage. Platform keys add ?merchant=<NUI>. Receipts are never refused for a low balance.

Webhooks

Instead of polling, register an endpoint. The key's environment is the endpoint's environment: a test key never registers a live endpoint. The endpoint must be a public https address.

POST/webhooks

curl
curl -X POST https://sandbox.fiskalix.com/api/v1/webhooks \
  -H "Authorization: Bearer fx_test_YOUR_KEY" \
  -H "Content-Type: application/json" -H "Accept: application/json" \
  -d '{"url": "https://shop.example.com/fiskalix/webhook",
       "events": ["receipt.accepted", "receipt.rejected", "delivery.failed"]}'

The answer includes the secret, shown once. Other calls: GET /webhooks (lists the endpoints and the event names), GET /webhooks/{id} (with the last 20 calls), POST /webhooks/{id}/test (sends a ping), DELETE /webhooks/{id}. Endpoints can also be managed on the integration's page in the panel.

EventWhen
receipt.acceptedATK accepted a receipt.
receipt.rejectedATK rejected a receipt.
delivery.sentAn e-mail or SMS was handed to the provider.
delivery.deliveredThe provider reported delivery.
delivery.failedA delivery failed, bounced or expired.
delivery.heldA delivery is held for lack of wallet balance.
wallet.low_balanceThe wallet dropped below its low-balance mark.

Each event is a JSON POST; data is the same JSON as GET /receipts/{id} or GET /deliveries/{id}:

JSON
{
  "id": "evt_...",
  "event": "receipt.accepted",
  "created_at": "2026-11-09T09:14:09Z",
  "merchant": "811397703",
  "environment": "test",
  "data": { "id": 1, "status": "accepted", "reference": "ORDER-1001" }
}

Verify the signature

The header X-Fiskalix-Signature: t=<unix time>,v1=<hex> carries an HMAC-SHA256 of t + "." + raw body with your secret. Compute it over the raw body, compare in constant time, and reject a t older than five minutes. Answer 2xx within ten seconds; otherwise FISKALIX retries after 1, 5 and 30 minutes, then after 2, 6 and 24 hours. An event can arrive more than once: treat the event id as the key.

PHP
<?php
// $body is the raw request body, exactly as received; $header is X-Fiskalix-Signature.
function fiskalixSignatureValid(string $body, string $header, string $secret, int $tolerance = 300): bool
{
    $parts = [];
    foreach (explode(',', $header) as $part) {
        [$k, $v] = array_pad(explode('=', trim($part), 2), 2, '');
        $parts[$k] = $v;
    }
    if (!isset($parts['t'], $parts['v1']) || abs(time() - (int) $parts['t']) > $tolerance) {
        return false;
    }
    $expected = hash_hmac('sha256', $parts['t'] . '.' . $body, $secret);

    return hash_equals($expected, $parts['v1']);
}
Node.js
const crypto = require('crypto');

// rawBody: the request body as a Buffer or string, before any JSON parsing.
function fiskalixSignatureValid(rawBody, header, secret, tolerance = 300) {
  const parts = Object.fromEntries(header.split(',').map(p => p.trim().split('=')));
  if (!parts.t || !parts.v1) return false;
  if (Math.abs(Date.now() / 1000 - Number(parts.t)) > tolerance) return false;
  const expected = crypto.createHmac('sha256', secret)
    .update(parts.t + '.' + rawBody).digest('hex');
  const a = Buffer.from(expected), b = Buffer.from(parts.v1);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

A receiver inside a private network is reached by declaring its address ranges on the integration's page, or by requesting a WireGuard link there.

ARBK registry

Read-only access to FISKALIX's copy of ARBK's business registry, for checking who a business is before issuing for it. 120 calls a minute per key.

GET/registry/businesses?q=<number or words>&limit=

GET/registry/businesses/{number}

Both answer with registry_updated_at, the age of the copy, and the business with its status (active, passive, closed, in liquidation).

Going live

  1. Verify the business on app.fiskalix.com (certificate, owner's ID, agreement) and onboard the production point of sale. See the guides.
  2. Issue a fx_live_ key, store it in your secret store and switch the base URL to https://app.fiskalix.com/api/v1.
  3. Register a live webhook endpoint; test and live endpoints are separate.
  4. Check your first live receipts in the panel and at ATK before you open to customers.