Pređi na sadržaj
Referenca

Predračun i obuka

Ograničeni tok za predračun (Проформа) i obuku (Обука), sa refundacijom koja mora da ponovi ceo izvorni dokument.

2 operacija

Izdaj predračun ili račun za obuku

post/v1/proforma-training-workflows

Scopeproforma-training:writeZahteva Idempotency-Key

Predračun (Проформа) je ponuda bez poreskog efekta, obuka (Обука) je vežba. Prodaja obuke ne sme imati referencu; refundacija mora tačno da ponovi izvorni dokument i identifikuje kupca.

Beleške iz ugovora (OpenAPI, engleski)

Accepts only Proforma or Training transactions through the dedicated workflow scope. Training Sale forbids a reference. Training Refund must reference an exact Boka-issued Training Sale. Proforma Sale may omit a reference or reference a Boka-issued Proforma Sale or Refund; Proforma Refund must reference a Boka-issued Proforma Sale. Refunds must exactly reproduce every source item and payment, identify the buyer, and only one unresolved or completed full refund may reserve a source. External and legacy references remain outside this bounded workflow. An unknown PFR outcome is terminal for automatic submission and an idempotent replay never creates a second fiscal request.

Telo zahtevaapplication/json

createProformaTrainingWorkflow: Telo zahteva
PoljeOpis
taxpayerIdobaveznoTip: uuid
businessPremiseIdobaveznoTip: uuid
clientReferenceobaveznoTip: string

min 1max 200

invoiceTypeobaveznoTip: string

VrednostiPROFORMATRAINING

transactionTypeobaveznoTip: TransactionType

VrednostiSALEREFUND

cashierobaveznoTip: Cashier
idobaveznoTip: string
displayNameopcionoTip: string
buyeropcionoTip: Buyer
idopcionoTip: stringOfficial prefix and value, for example 10:123456789.
optionalFieldopcionoTip: stringOfficial buyer-cost-center prefix and value where applicable, printed as Опционо поље купца. Allowed only on a Normal Sale: any other invoice type or transaction type is rejected with 422, because the official manual testing procedure lists the field appearing on a receipt that is not a Промет Продаја as a reason to reject an ESIR. A Copy of a Normal Sale that carried it is issued without it for the same reason, and closing an advance case applies it only to the final Normal Sale, never to the closing Advance Refund.
originalopcionoTip: BokaDocumentReference
sourceobaveznoTip: const "BOKA"
fiscalDocumentIdobaveznoTip: uuid
itemsobaveznoTip: array<LineItem>

min 1 items

catalogProductIdopcionoTip: uuidOptional; arbitrary inline items are permitted.
nameobaveznoTip: string

min 1max 2048

unitOfMeasureopcionoTip: stringRequired on every item except the codebook advance literals (10: Аванс (Ђ) and siblings), which are prescribed verbatim without a unit. The API refuses any other item without one (422, Items.UnitOfMeasure) and composes it into the signed item name as name/unit.

min 1max 50

quantityobaveznoTip: numberV-PFR Decimal(14,3).

>= 0.001<= 99999999999.999step 0.001

unitPriceobaveznoTip: numberFinal gross unit price sent to V-PFR as Decimal(28,4). Boka applies the mandated fiscal rounding rules.

>= 0step 0.01

unitPriceBeforeDiscountopcionoTip: numberOptional Boka-local immutable gross unit price before discount. When present it must be greater than unitPrice; it is displayed outside the exact PFR journal and is never sent as a supplier field.

>= 0step 0.0001

gtinopcionoTip: string

min 8max 14

taxLabelsobaveznoTip: array<string>

min 1 itemsunique

paymentsobaveznoTip: array<Payment>

min 1 items

typeobaveznoTip: PaymentType

VrednostiOTHERCASHCARDCHECKWIRE_TRANSFERVOUCHERINSTANT_PAYMENT

amountobaveznoTip: numberAt most two decimals (the V-PFR rejects more with validation code 2804); the field type on the wire is Decimal(28,4).

>= 0step 0.01

commercialFooteropcionoTip: string

max 2000

metadataopcionoTip: objectNon-fiscal caller metadata.

Odgovori

createProformaTrainingWorkflow: Odgovori
200OKIdempotent replay of a completed workflowProformaTrainingWorkflow
201CreatedFiscalized Proforma or Training documentProformaTrainingWorkflow
202AcceptedThe request is durably reserved but has not been submittedProformaTrainingWorkflow
404Not FoundResource does not exist within the authenticated tenant scopeErrorCode
409ConflictIdempotency, source-reservation, or terminal workflow conflict
422Unprocessable ContentThe command violates a Boka or fiscal rule, or PFR definitively rejected the reserved operation
503Service UnavailableNo fiscal receipt is claimed; the workflow is unavailable or its outcome is unresolved

Primeri

training

POST/v1/proforma-training-workflows
curl -X POST "https://api.bokapos.rs/v1/proforma-training-workflows" \
  -H "Authorization: Bearer $BOKAPOS_TOKEN" \
  -H "Idempotency-Key: training-2026-09-02-1" \
  -H "Content-Type: application/json" \
  -d '{
  "taxpayerId": "3f9c2a8e-6b1d-4e5a-9c47-1d2b8e6f0a11",
  "businessPremiseId": "b7d4e2c1-9a3f-4c8e-8f21-6e5a0c9d3b22",
  "clientReference": "TRAINING-1",
  "invoiceType": "TRAINING",
  "transactionType": "SALE",
  "cashier": {
    "id": "operater-1"
  },
  "items": [
    {
      "name": "Test artikal",
      "unitOfMeasure": "kom",
      "quantity": 1,
      "unitPrice": 100,
      "taxLabels": [
        "F"
      ]
    }
  ],
  "payments": [
    {
      "type": "CASH",
      "amount": 100
    }
  ]
}'
201Created
{
  "id": "2c3d4e5f-6a7b-4c8d-9e0f-1a2b3c4d5e6f",
  "taxpayerId": "3f9c2a8e-6b1d-4e5a-9c47-1d2b8e6f0a11",
  "businessPremiseId": "b7d4e2c1-9a3f-4c8e-8f21-6e5a0c9d3b22",
  "clientReference": "TRAINING-1",
  "invoiceType": "TRAINING",
  "transactionType": "SALE",
  "state": "COMPLETED",
  "original": null,
  "document": {
    "id": "3d4e5f6a-7b8c-4d9e-8f0a-1b2c3d4e5f6a",
    "taxpayerId": "3f9c2a8e-6b1d-4e5a-9c47-1d2b8e6f0a11",
    "businessPremiseId": "b7d4e2c1-9a3f-4c8e-8f21-6e5a0c9d3b22",
    "idempotencyKey": "training-2026-09-02-1",
    "clientReference": "TRAINING-1",
    "invoiceType": "TRAINING",
    "transactionType": "SALE",
    "cashierId": "web-shop",
    "buyerId": null,
    "buyerDetails": null,
    "status": "FISCALIZED",
    "fiscalized": true,
    "failureCode": null,
    "retryable": false,
    "pfr": {
      "invoiceNumber": "JWX4K9PL-JWX4K9PL-1048",
      "sdcTime": "2026-09-01T10:15:32.483+02:00",
      "requestedBy": "JWX4K9PL",
      "signedBy": "JWX4K9PL",
      "transactionTypeCounter": 903,
      "totalCounter": 1048,
      "invoiceCounterExtension": "ОП",
      "totalAmount": 100,
      "totalTax": 9.9099,
      "verificationUrl": "https://sandbox.suf.purs.gov.rs/v/?vl=A0pXWDRLOVBMSldYNEs5UEwSBAAAEAQAAKCLPAAAAAAAAAABnAqJa1EAAAA...",
      "journal": "============ ФИСКАЛНИ РАЧУН ============\n...\nПФР број рачуна:      JWX4K9PL-JWX4K9PL-1048\nБројач рачуна:                903/1048ОП\n========================================\n======== КРАЈ ФИСКАЛНОГ РАЧУНА ========="
    },
    "receipt": {
      "textUrl": "/v1/fiscal-documents/3d4e5f6a-7b8c-4d9e-8f0a-1b2c3d4e5f6a/representations/official-text",
      "jsonUrl": "/v1/fiscal-documents/3d4e5f6a-7b8c-4d9e-8f0a-1b2c3d4e5f6a/representations/canonical-json",
      "pdfA4Url": "/v1/fiscal-documents/3d4e5f6a-7b8c-4d9e-8f0a-1b2c3d4e5f6a/representations/pdf-a4",
      "pdf80mmUrl": "/v1/fiscal-documents/3d4e5f6a-7b8c-4d9e-8f0a-1b2c3d4e5f6a/representations/pdf-80mm",
      "pdf58mmUrl": "/v1/fiscal-documents/3d4e5f6a-7b8c-4d9e-8f0a-1b2c3d4e5f6a/representations/pdf-58mm",
      "previewImageUrl": "/v1/fiscal-documents/3d4e5f6a-7b8c-4d9e-8f0a-1b2c3d4e5f6a/representations/preview-png",
      "qrImageUrl": "/v1/fiscal-documents/3d4e5f6a-7b8c-4d9e-8f0a-1b2c3d4e5f6a/representations/qr-svg",
      "verificationUrl": "https://sandbox.suf.purs.gov.rs/v/?vl=A0pXWDRLOVBMSldYNEs5UEwSBAAAEAQAAKCLPAAAAAAAAAABnAqJa1EAAAA...",
      "preferredPaperFormat": "a4"
    },
    "createdAt": "2026-09-01T08:15:31.902Z",
    "updatedAt": "2026-09-01T08:15:32.611Z"
  },
  "failureCode": null,
  "createdAt": "2026-09-02T07:10:00.000Z",
  "updatedAt": "2026-09-02T07:10:01.100Z"
}
Odgovor: ProformaTrainingWorkflow

Opisi polja su preuzeti iz OpenAPI ugovora i na engleskom su; nazivi polja i vrednosti su isti u oba jezika.

createProformaTrainingWorkflow: Odgovor
PoljeOpis
idobaveznoTip: uuid
taxpayerIdobaveznoTip: uuid
businessPremiseIdobaveznoTip: uuid
clientReferenceobaveznoTip: string
invoiceTypeobaveznoTip: string

VrednostiPROFORMATRAINING

transactionTypeobaveznoTip: TransactionType

VrednostiSALEREFUND

stateobaveznoTip: string

VrednostiPENDINGCOMPLETEDOUTCOME_UNKNOWNREJECTEDFAILED

originalopcionoTip: ProformaTrainingWorkflowOriginal | null (može biti null)
sourceobaveznoTip: const "BOKA"
fiscalDocumentIdobaveznoTip: uuid
pfrNumberobaveznoTip: string
pfrTimeobaveznoTip: date-time
invoiceTypeobaveznoTip: string

VrednostiPROFORMATRAINING

transactionTypeobaveznoTip: TransactionType

VrednostiSALEREFUND

documentobaveznoTip: FiscalDocument
idobaveznoTip: uuid
taxpayerIdobaveznoTip: uuid
businessPremiseIdobaveznoTip: uuid
idempotencyKeyobaveznoTip: string
clientReferenceobaveznoTip: string
invoiceTypeobaveznoTip: InvoiceType

VrednostiNORMALPROFORMACOPYTRAININGADVANCE

transactionTypeobaveznoTip: TransactionType

VrednostiSALEREFUND

cashierIdobaveznoTip: string
buyerIdopcionoTip: string | null (može biti null)
buyerDetailsopcionoTip: FiscalBuyerDetails | null (može biti null)The buyer's company-registry facts stored with the document at reservation and printed under the buyer identification. Null when the buyer is not a domestic company (prefixes 10, 12, 14 with a valid PIB) or the register could not answer at issuance.
legalNameobaveznoTip: string

max 350

taxIdentifierobaveznoTip: string

pattern ^[0-9]{9}$

registrationNumberopcionoTip: string | null (može biti null)

pattern ^[0-9]{8}$

addressopcionoTip: string | null (može biti null)

max 300

cityopcionoTip: string | null (može biti null)

max 100

sourceobaveznoTip: string

Vrednostinbs-jrr

resolvedAtobaveznoTip: date-time
statusobaveznoTip: FiscalDocumentStatus

VrednostiRECEIVEDVALIDATEDSUBMITTINGFISCALIZEDREJECTEDNOT_FISCALIZEDOUTCOME_UNKNOWNRECONCILING

fiscalizedobaveznoTip: boolean
failureCodeopcionoTip: string | null (može biti null)
pfrRejectionopcionoTip: object | null (može biti null)Present only on a single-document read of a REJECTED operation. The V-PFR's own validation result, bounded to the property path of the caller's request and the supplier's numeric codes (2310 invalid tax label; 2800 to 2808 required, length, range, value, format and list-size validation). Lists never carry it.
itemsobaveznoTip: array<object>

max 10 items

propertyobaveznoTip: string

max 120

codesobaveznoTip: array<string>

max 5 items

retryableobaveznoTip: boolean
pfropcionoTip: PfrResult | null (može biti null)
invoiceNumberobaveznoTip: string
sdcTimeobaveznoTip: date-time
requestedByobaveznoTip: string
signedByobaveznoTip: string
transactionTypeCounteropcionoTip: integer | null (može biti null)V-PFR transaction-type counter (the left half of the printed counter). Null when the stored receipt does not carry it; the printed counter is always in the journal text.
totalCounteropcionoTip: integer | null (može biti null)V-PFR total counter (the right half of the printed counter and the last segment of invoiceNumber). Null under the same condition as transactionTypeCounter.
invoiceCounterExtensionopcionoTip: string | null (može biti null)Official Cyrillic invoice/transaction type pair printed after the counter (ПП, ПР, АП, АР, КП, КР, ОП, ОР, РП, РР). Null under the same condition as transactionTypeCounter.
totalAmountobaveznoTip: number
totalTaxopcionoTip: number | null (može biti null)Sum of the V-PFR signed tax amounts of the document (the printed "Укупан износ пореза" before its two-decimal display rounding). Null under the same condition as transactionTypeCounter.
verificationUrlobaveznoTip: uri
journalobaveznoTip: string
receiptopcionoTip: ReceiptRepresentations | null (može biti null)
textUrlobaveznoTip: uri-reference
jsonUrlobaveznoTip: uri-reference
pdfA4UrlobaveznoTip: uri-reference
pdf80mmUrlobaveznoTip: uri-reference
pdf58mmUrlobaveznoTip: uri-reference
previewImageUrlobaveznoTip: uri-reference
qrImageUrlobaveznoTip: uri-reference
verificationUrlobaveznoTip: uri
preferredPaperFormatobaveznoTip: stringImmutable preferred print/PDF format captured when this fiscal operation was reserved.

Vrednosti80mm58mma4

referenceopcionoTip: ResolvedReference
fiscalDocumentIdopcionoTip: uuid
pfrNumberobaveznoTip: string
pfrTimeobaveznoTip: date-time
createdAtobaveznoTip: date-time
updatedAtobaveznoTip: date-time
failureCodeopcionoTip: string | null (može biti null)
createdAtobaveznoTip: date-time
updatedAtobaveznoTip: date-time

Pročitaj tok predračuna ili obuke

get/v1/proforma-training-workflows/{proformaTrainingWorkflowId}

Scopefiscal:read

Stanje toka i njegov dokument, uključujući OUTCOME_UNKNOWN koji sistem mora da razreši pre novog pokušaja.

Parametri

getProformaTrainingWorkflow: Parametri
PoljeOpis
proformaTrainingWorkflowIdobaveznoGde: pathTip: uuid

Odgovori

getProformaTrainingWorkflow: Odgovori
200OKPersisted workflow and fiscal-document stateProformaTrainingWorkflow
404Not FoundResource does not exist within the authenticated tenant scopeErrorCode
Odgovor: ProformaTrainingWorkflow

Opisi polja su preuzeti iz OpenAPI ugovora i na engleskom su; nazivi polja i vrednosti su isti u oba jezika.

getProformaTrainingWorkflow: Odgovor
PoljeOpis
idobaveznoTip: uuid
taxpayerIdobaveznoTip: uuid
businessPremiseIdobaveznoTip: uuid
clientReferenceobaveznoTip: string
invoiceTypeobaveznoTip: string

VrednostiPROFORMATRAINING

transactionTypeobaveznoTip: TransactionType

VrednostiSALEREFUND

stateobaveznoTip: string

VrednostiPENDINGCOMPLETEDOUTCOME_UNKNOWNREJECTEDFAILED

originalopcionoTip: ProformaTrainingWorkflowOriginal | null (može biti null)
sourceobaveznoTip: const "BOKA"
fiscalDocumentIdobaveznoTip: uuid
pfrNumberobaveznoTip: string
pfrTimeobaveznoTip: date-time
invoiceTypeobaveznoTip: string

VrednostiPROFORMATRAINING

transactionTypeobaveznoTip: TransactionType

VrednostiSALEREFUND

documentobaveznoTip: FiscalDocument
idobaveznoTip: uuid
taxpayerIdobaveznoTip: uuid
businessPremiseIdobaveznoTip: uuid
idempotencyKeyobaveznoTip: string
clientReferenceobaveznoTip: string
invoiceTypeobaveznoTip: InvoiceType

VrednostiNORMALPROFORMACOPYTRAININGADVANCE

transactionTypeobaveznoTip: TransactionType

VrednostiSALEREFUND

cashierIdobaveznoTip: string
buyerIdopcionoTip: string | null (može biti null)
buyerDetailsopcionoTip: FiscalBuyerDetails | null (može biti null)The buyer's company-registry facts stored with the document at reservation and printed under the buyer identification. Null when the buyer is not a domestic company (prefixes 10, 12, 14 with a valid PIB) or the register could not answer at issuance.
legalNameobaveznoTip: string

max 350

taxIdentifierobaveznoTip: string

pattern ^[0-9]{9}$

registrationNumberopcionoTip: string | null (može biti null)

pattern ^[0-9]{8}$

addressopcionoTip: string | null (može biti null)

max 300

cityopcionoTip: string | null (može biti null)

max 100

sourceobaveznoTip: string

Vrednostinbs-jrr

resolvedAtobaveznoTip: date-time
statusobaveznoTip: FiscalDocumentStatus

VrednostiRECEIVEDVALIDATEDSUBMITTINGFISCALIZEDREJECTEDNOT_FISCALIZEDOUTCOME_UNKNOWNRECONCILING

fiscalizedobaveznoTip: boolean
failureCodeopcionoTip: string | null (može biti null)
pfrRejectionopcionoTip: object | null (može biti null)Present only on a single-document read of a REJECTED operation. The V-PFR's own validation result, bounded to the property path of the caller's request and the supplier's numeric codes (2310 invalid tax label; 2800 to 2808 required, length, range, value, format and list-size validation). Lists never carry it.
itemsobaveznoTip: array<object>

max 10 items

propertyobaveznoTip: string

max 120

codesobaveznoTip: array<string>

max 5 items

retryableobaveznoTip: boolean
pfropcionoTip: PfrResult | null (može biti null)
invoiceNumberobaveznoTip: string
sdcTimeobaveznoTip: date-time
requestedByobaveznoTip: string
signedByobaveznoTip: string
transactionTypeCounteropcionoTip: integer | null (može biti null)V-PFR transaction-type counter (the left half of the printed counter). Null when the stored receipt does not carry it; the printed counter is always in the journal text.
totalCounteropcionoTip: integer | null (može biti null)V-PFR total counter (the right half of the printed counter and the last segment of invoiceNumber). Null under the same condition as transactionTypeCounter.
invoiceCounterExtensionopcionoTip: string | null (može biti null)Official Cyrillic invoice/transaction type pair printed after the counter (ПП, ПР, АП, АР, КП, КР, ОП, ОР, РП, РР). Null under the same condition as transactionTypeCounter.
totalAmountobaveznoTip: number
totalTaxopcionoTip: number | null (može biti null)Sum of the V-PFR signed tax amounts of the document (the printed "Укупан износ пореза" before its two-decimal display rounding). Null under the same condition as transactionTypeCounter.
verificationUrlobaveznoTip: uri
journalobaveznoTip: string
receiptopcionoTip: ReceiptRepresentations | null (može biti null)
textUrlobaveznoTip: uri-reference
jsonUrlobaveznoTip: uri-reference
pdfA4UrlobaveznoTip: uri-reference
pdf80mmUrlobaveznoTip: uri-reference
pdf58mmUrlobaveznoTip: uri-reference
previewImageUrlobaveznoTip: uri-reference
qrImageUrlobaveznoTip: uri-reference
verificationUrlobaveznoTip: uri
preferredPaperFormatobaveznoTip: stringImmutable preferred print/PDF format captured when this fiscal operation was reserved.

Vrednosti80mm58mma4

referenceopcionoTip: ResolvedReference
fiscalDocumentIdopcionoTip: uuid
pfrNumberobaveznoTip: string
pfrTimeobaveznoTip: date-time
createdAtobaveznoTip: date-time
updatedAtobaveznoTip: date-time
failureCodeopcionoTip: string | null (može biti null)
createdAtobaveznoTip: date-time
updatedAtobaveznoTip: date-time