Skip to content
Reference

Proforma and Training

The bounded workflow for Proforma and Training documents, with a refund that must repeat the whole source document.

2 operations

Issue a Proforma or Training document

post/v1/proforma-training-workflows

Scopeproforma-training:writeRequires Idempotency-Key

A Proforma is an offer without tax effect; Training is practice. A Training Sale must not carry a reference; a refund must exactly repeat the source document and identify the buyer.

Contract notes (OpenAPI)

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.

Request bodyapplication/json

createProformaTrainingWorkflow: Request body
FieldDescription
taxpayerIdrequiredType: uuid
businessPremiseIdrequiredType: uuid
clientReferencerequiredType: string

min 1max 200

invoiceTyperequiredType: string

ValuesPROFORMATRAINING

transactionTyperequiredType: TransactionType

ValuesSALEREFUND

cashierrequiredType: Cashier
idrequiredType: string
displayNameoptionalType: string
buyeroptionalType: Buyer
idoptionalType: stringOfficial prefix and value, for example 10:123456789.
optionalFieldoptionalType: 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.
originaloptionalType: BokaDocumentReference
sourcerequiredType: const "BOKA"
fiscalDocumentIdrequiredType: uuid
itemsrequiredType: array<LineItem>

min 1 items

catalogProductIdoptionalType: uuidOptional; arbitrary inline items are permitted.
namerequiredType: string

min 1max 2048

unitOfMeasureoptionalType: 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

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

>= 0.001<= 99999999999.999step 0.001

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

>= 0step 0.01

unitPriceBeforeDiscountoptionalType: 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

gtinoptionalType: string

min 8max 14

taxLabelsrequiredType: array<string>

min 1 itemsunique

paymentsrequiredType: array<Payment>

min 1 items

typerequiredType: PaymentType

ValuesOTHERCASHCARDCHECKWIRE_TRANSFERVOUCHERINSTANT_PAYMENT

amountrequiredType: 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

commercialFooteroptionalType: string

max 2000

metadataoptionalType: objectNon-fiscal caller metadata.

Responses

createProformaTrainingWorkflow: Responses
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

Examples

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"
}
Response: ProformaTrainingWorkflow

Field descriptions come from the OpenAPI contract; field names and values are identical in both languages.

createProformaTrainingWorkflow: Response
FieldDescription
idrequiredType: uuid
taxpayerIdrequiredType: uuid
businessPremiseIdrequiredType: uuid
clientReferencerequiredType: string
invoiceTyperequiredType: string

ValuesPROFORMATRAINING

transactionTyperequiredType: TransactionType

ValuesSALEREFUND

staterequiredType: string

ValuesPENDINGCOMPLETEDOUTCOME_UNKNOWNREJECTEDFAILED

originaloptionalType: ProformaTrainingWorkflowOriginal | null (nullable)
sourcerequiredType: const "BOKA"
fiscalDocumentIdrequiredType: uuid
pfrNumberrequiredType: string
pfrTimerequiredType: date-time
invoiceTyperequiredType: string

ValuesPROFORMATRAINING

transactionTyperequiredType: TransactionType

ValuesSALEREFUND

documentrequiredType: FiscalDocument
idrequiredType: uuid
taxpayerIdrequiredType: uuid
businessPremiseIdrequiredType: uuid
idempotencyKeyrequiredType: string
clientReferencerequiredType: string
invoiceTyperequiredType: InvoiceType

ValuesNORMALPROFORMACOPYTRAININGADVANCE

transactionTyperequiredType: TransactionType

ValuesSALEREFUND

cashierIdrequiredType: string
buyerIdoptionalType: string | null (nullable)
buyerDetailsoptionalType: FiscalBuyerDetails | null (nullable)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.
legalNamerequiredType: string

max 350

taxIdentifierrequiredType: string

pattern ^[0-9]{9}$

registrationNumberoptionalType: string | null (nullable)

pattern ^[0-9]{8}$

addressoptionalType: string | null (nullable)

max 300

cityoptionalType: string | null (nullable)

max 100

sourcerequiredType: string

Valuesnbs-jrr

resolvedAtrequiredType: date-time
statusrequiredType: FiscalDocumentStatus

ValuesRECEIVEDVALIDATEDSUBMITTINGFISCALIZEDREJECTEDNOT_FISCALIZEDOUTCOME_UNKNOWNRECONCILING

fiscalizedrequiredType: boolean
failureCodeoptionalType: string | null (nullable)
pfrRejectionoptionalType: object | null (nullable)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.
itemsrequiredType: array<object>

max 10 items

propertyrequiredType: string

max 120

codesrequiredType: array<string>

max 5 items

retryablerequiredType: boolean
pfroptionalType: PfrResult | null (nullable)
invoiceNumberrequiredType: string
sdcTimerequiredType: date-time
requestedByrequiredType: string
signedByrequiredType: string
transactionTypeCounteroptionalType: integer | null (nullable)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.
totalCounteroptionalType: integer | null (nullable)V-PFR total counter (the right half of the printed counter and the last segment of invoiceNumber). Null under the same condition as transactionTypeCounter.
invoiceCounterExtensionoptionalType: string | null (nullable)Official Cyrillic invoice/transaction type pair printed after the counter (ПП, ПР, АП, АР, КП, КР, ОП, ОР, РП, РР). Null under the same condition as transactionTypeCounter.
totalAmountrequiredType: number
totalTaxoptionalType: number | null (nullable)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.
verificationUrlrequiredType: uri
journalrequiredType: string
receiptoptionalType: ReceiptRepresentations | null (nullable)
textUrlrequiredType: uri-reference
jsonUrlrequiredType: uri-reference
pdfA4UrlrequiredType: uri-reference
pdf80mmUrlrequiredType: uri-reference
pdf58mmUrlrequiredType: uri-reference
previewImageUrlrequiredType: uri-reference
qrImageUrlrequiredType: uri-reference
verificationUrlrequiredType: uri
preferredPaperFormatrequiredType: stringImmutable preferred print/PDF format captured when this fiscal operation was reserved.

Values80mm58mma4

referenceoptionalType: ResolvedReference
fiscalDocumentIdoptionalType: uuid
pfrNumberrequiredType: string
pfrTimerequiredType: date-time
createdAtrequiredType: date-time
updatedAtrequiredType: date-time
failureCodeoptionalType: string | null (nullable)
createdAtrequiredType: date-time
updatedAtrequiredType: date-time

Read a Proforma or Training workflow

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

Scopefiscal:read

The workflow state and its document, including OUTCOME_UNKNOWN which a system must resolve before another attempt.

Parameters

getProformaTrainingWorkflow: Parameters
FieldDescription
proformaTrainingWorkflowIdrequiredIn: pathType: uuid

Responses

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

Field descriptions come from the OpenAPI contract; field names and values are identical in both languages.

getProformaTrainingWorkflow: Response
FieldDescription
idrequiredType: uuid
taxpayerIdrequiredType: uuid
businessPremiseIdrequiredType: uuid
clientReferencerequiredType: string
invoiceTyperequiredType: string

ValuesPROFORMATRAINING

transactionTyperequiredType: TransactionType

ValuesSALEREFUND

staterequiredType: string

ValuesPENDINGCOMPLETEDOUTCOME_UNKNOWNREJECTEDFAILED

originaloptionalType: ProformaTrainingWorkflowOriginal | null (nullable)
sourcerequiredType: const "BOKA"
fiscalDocumentIdrequiredType: uuid
pfrNumberrequiredType: string
pfrTimerequiredType: date-time
invoiceTyperequiredType: string

ValuesPROFORMATRAINING

transactionTyperequiredType: TransactionType

ValuesSALEREFUND

documentrequiredType: FiscalDocument
idrequiredType: uuid
taxpayerIdrequiredType: uuid
businessPremiseIdrequiredType: uuid
idempotencyKeyrequiredType: string
clientReferencerequiredType: string
invoiceTyperequiredType: InvoiceType

ValuesNORMALPROFORMACOPYTRAININGADVANCE

transactionTyperequiredType: TransactionType

ValuesSALEREFUND

cashierIdrequiredType: string
buyerIdoptionalType: string | null (nullable)
buyerDetailsoptionalType: FiscalBuyerDetails | null (nullable)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.
legalNamerequiredType: string

max 350

taxIdentifierrequiredType: string

pattern ^[0-9]{9}$

registrationNumberoptionalType: string | null (nullable)

pattern ^[0-9]{8}$

addressoptionalType: string | null (nullable)

max 300

cityoptionalType: string | null (nullable)

max 100

sourcerequiredType: string

Valuesnbs-jrr

resolvedAtrequiredType: date-time
statusrequiredType: FiscalDocumentStatus

ValuesRECEIVEDVALIDATEDSUBMITTINGFISCALIZEDREJECTEDNOT_FISCALIZEDOUTCOME_UNKNOWNRECONCILING

fiscalizedrequiredType: boolean
failureCodeoptionalType: string | null (nullable)
pfrRejectionoptionalType: object | null (nullable)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.
itemsrequiredType: array<object>

max 10 items

propertyrequiredType: string

max 120

codesrequiredType: array<string>

max 5 items

retryablerequiredType: boolean
pfroptionalType: PfrResult | null (nullable)
invoiceNumberrequiredType: string
sdcTimerequiredType: date-time
requestedByrequiredType: string
signedByrequiredType: string
transactionTypeCounteroptionalType: integer | null (nullable)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.
totalCounteroptionalType: integer | null (nullable)V-PFR total counter (the right half of the printed counter and the last segment of invoiceNumber). Null under the same condition as transactionTypeCounter.
invoiceCounterExtensionoptionalType: string | null (nullable)Official Cyrillic invoice/transaction type pair printed after the counter (ПП, ПР, АП, АР, КП, КР, ОП, ОР, РП, РР). Null under the same condition as transactionTypeCounter.
totalAmountrequiredType: number
totalTaxoptionalType: number | null (nullable)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.
verificationUrlrequiredType: uri
journalrequiredType: string
receiptoptionalType: ReceiptRepresentations | null (nullable)
textUrlrequiredType: uri-reference
jsonUrlrequiredType: uri-reference
pdfA4UrlrequiredType: uri-reference
pdf80mmUrlrequiredType: uri-reference
pdf58mmUrlrequiredType: uri-reference
previewImageUrlrequiredType: uri-reference
qrImageUrlrequiredType: uri-reference
verificationUrlrequiredType: uri
preferredPaperFormatrequiredType: stringImmutable preferred print/PDF format captured when this fiscal operation was reserved.

Values80mm58mma4

referenceoptionalType: ResolvedReference
fiscalDocumentIdoptionalType: uuid
pfrNumberrequiredType: string
pfrTimerequiredType: date-time
createdAtrequiredType: date-time
updatedAtrequiredType: date-time
failureCodeoptionalType: string | null (nullable)
createdAtrequiredType: date-time
updatedAtrequiredType: date-time