REST API

FISCALIZATION API · REST

Your own site or app?
One API call per receipt.

A custom-built shop, SaaS or app connects directly: you send the items and amount, and the response brings back the receipt number, QR code and verification link. No module and no SDK — it works from any language that can send an HTTP request. Integration is free; you pay only for issued receipts.

  • Approved ESIR · ID 1609
  • JSON over HTTPS
  • Free test key
POST /api/racuni
Buyer pays

Request

{
  "transactionId": "porudzbina-1042",
  "paymentType": "Card",
  "items": [
    { "name": "T-shirt", "quantity": 1, "unitPrice": 2400,
      "totalAmount": 2400, "labels": ["Ђ"] }
  ]
}

Response

Click "Send request" to see what the API returns.

From key to first receipt

  1. 01

    Request a test key

    A key starting with fapi_test_ works right away — test receipts with no tax effect and no charge.

  2. 02

    Send your first receipt

    POST /api/racuni with an Authorization: Bearer header and the order items as JSON.

  3. 03

    Show the receipt to the buyer

    Put qrKod and verifikacija from the response into your order confirmation and buyer email.

  4. 04

    Switch to the live key

    Once your security element is in, replace the test key with the live one (fapi_live_). The code stays the same.

What you get through the API

  • Every receipt type

    Sale, advance, advance closing, refund and training receipt — each is a single call.

  • No duplicate receipts

    Send your own transactionId: a repeated request returns the same receipt instead of issuing another.

  • Split payments

    A payments array carries several payment methods on one receipt, for example a voucher and a card.

  • Buyer’s tax ID

    When a company buys, the buyerId field ("10:PIB") puts its tax ID on the fiscal receipt.

  • Test and live key

    The same code works in testing and live — only the key changes. Test receipts are not charged.

  • Reading and usage

    GET /api/racuni/{id} returns an issued receipt, GET /api/usage the month’s usage and cost.

Language
any that can send an HTTPS request — PHP, Node.js, Python, .NET…
Format
REST, JSON in request and response bodies
Authentication
an Authorization: Bearer header with your API key
Currency
Serbian dinar (RSD)
Account
a FiskalAPI key — the test key is free

Questions about connecting through the API

Approved ESIR · ID 1609

The API, documentation, test key and help with connecting are free. You pay only for issued fiscal receipts, tiered from 9 down to 1.5 RSD per receipt, with no subscription.

No. The API is plain REST with JSON, so it works from any language or environment that can send an HTTPS request. Call examples are in the public documentation, no account needed.

If you send your own transactionId, a repeated request returns the same receipt marked "ponovljen": true — no second receipt is issued. The same transactionId with changed items or amount is rejected.

The API then returns 502 with "statusRacuna": "nepoznato", because the receipt may already be issued. Do not retry automatically: until the case is resolved, the same transactionId gets 409, not a second receipt.

You do, from your own email and domain. The response contains qrKod and the verifikacija link — put them in your order confirmation. The API does not send email to the kupac.email address.

POST /api/racuni/refundacija with the original receipt number in referentDocumentNumber. An issued receipt is never changed — a refund is always a new document.

Read next

Connect your system today

Request a free test key and send your first test receipt in a few minutes.