Skip to content

Serbia Ministry of Finance

Serbia Ministry of Finance integration provides connectivity to the Serbian fiscal system, including receipt extraction from QR codes, SEF (Sistem Elektronskih Faktura) support, and invoice lifecycle events for workflow automation.

Note

This integration is geolocked to Serbia (RS).


Overview

Key characteristics:

  • Receipt extraction — extract receipt data from a fiscal QR code URL or QR code image
  • SEF integration — connects with the Serbian Electronic Invoicing System for inbound/outbound invoices
  • Invoice events — publishes workflow events when sales or purchase invoices are created or updated
  • VPFR support — sub-client for fiscal receipt verification

Extracting a Receipt from URL

Extract structured receipt data from the URL obtained by scanning a fiscal QR code.

import { Integrations } from "@ptkl/sdk/beta"

const integrations = new Integrations()
const minfin = integrations.getSerbiaMinFin()

const receipt = await minfin.getReceiptFromUrl(
  "https://suf.purs.gov.rs/v/?vl=...",
  "qr-scan"
)

console.log(receipt) // structured receipt fields
curl -X POST https://lemon.protokol.io/luma/integrations/v1/karadjordje/minfin/receipt-url \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "url": "https://suf.purs.gov.rs/v/?vl=...",
    "source": "qr-scan"
  }'

Extracting a Receipt from QR Code Image

Extract receipt data from a QR code image (base64-encoded).

import { Integrations } from "@ptkl/sdk/beta"

const integrations = new Integrations()
const minfin = integrations.getSerbiaMinFin()

const receipt = await minfin.getReceiptFromQrCode(
  "iVBORw0KGgoAAAANSUhEUg...",  // base64 image
  "camera"
)
curl -X POST https://lemon.protokol.io/luma/integrations/v1/karadjordje/minfin/receipt-qr \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "qrCodeImage": "iVBORw0KGgoAAAANSUhEUg...",
    "source": "camera"
  }'

Getting Conto List

Retrieve the list of accounting contos from the Ministry of Finance.

import { Integrations } from "@ptkl/sdk/beta"

const integrations = new Integrations()
const minfin = integrations.getSerbiaMinFin()

const contos = await minfin.getContoList()

VPFR (Fiscal Receipt Verification)

The VPFR sub-client provides access to the PFR (Procesor Fiskalnih Racuna) for fiscal receipt operations.

import { Integrations } from "@ptkl/sdk/beta"

const integrations = new Integrations()
const minfin = integrations.getSerbiaMinFin()
const vpfr = minfin.vpfr()

// Make VPFR-specific requests
const result = await vpfr.request("POST", "/endpoint", { data: "..." })

Workflow Integration

Invoice Events

The integration publishes lifecycle events when invoices are created or updated in SEF:

Event When
integration.invoicing.invoice.sales.created A new sales (outbound) invoice is created
integration.invoicing.invoice.purchase.created A new purchase (inbound) invoice is created
integration.invoicing.invoice.sales.updated An existing sales invoice is updated
integration.invoicing.invoice.purchase.updated An existing purchase invoice is updated

These events can trigger workflows to automate invoice approval, notification, or synchronization with accounting systems.


Permissions

Permission Description
accept_reject_invoice Accept or reject purchase invoices
inbound_invoices View and manage inbound (purchase) invoices
outbound_invoices View and manage outbound (sales) invoices

Using in Platform Functions

const { Integrations } = $sdk.version('0.10')
const integrations = new Integrations()
const minfin = integrations.getSerbiaMinFin()

// Extract receipt from QR code URL scanned by mobile app
const receipt = await minfin.getReceiptFromUrl(
  $input.body.fiscal_url,
  "mobile-scan"
)

response.json({
  success: true,
  receipt: receipt,
})

SDK Reference

The MinFin class is available via the Integrations facade:

import { Integrations } from "@ptkl/sdk/beta"
const integrations = new Integrations()
const minfin = integrations.getSerbiaMinFin()
Method Description
minfin.getReceiptFromUrl(url, source) Extract receipt data from a fiscal QR code URL
minfin.getReceiptFromQrCode(qrCodeImage, source) Extract receipt from a QR code image (base64)
minfin.getContoList() Get the list of accounting contos
minfin.vpfr() Get the VPFR sub-client for fiscal receipt verification