Pređi na sadržaj
Referenca

Refundacije

Potpuna ili delimična refundacija računa koji je BokaPOS izdao, sa automatskom kopijom kod povraćaja gotovine.

1 operacija

Refundiraj račun

post/v1/refund-workflows

Scoperefund:writeZahteva Idempotency-Key

Potpuna ili delimična refundacija računa za promet koji je BokaPOS izdao. Navodite izvorni dokument, stavke po indeksu izvorne linije i vraćena plaćanja; kupac je obavezan. Ako se vraća gotovina, BokaPOS odmah izdaje i kopiju refundacije.

Beleške iz ugovora (OpenAPI, engleski)

Supports full and partial Normal Refunds. Boka-issued originals are resolved only within the exact taxpayer and premise, and cumulative quantities are prevented from exceeding each stored original line. When any returned payment is cash, Boka automatically issues the required Copy Refundation and renders its customer-signature line. This first bounded workflow accepts only a Boka-stored original; external originals remain unsupported because their cumulative returned quantity cannot be independently proven. Normal fiscal traffic remains governed by the same disabled-by-default provider and uncertain-outcome safeguards.

Telo zahtevaapplication/json

createRefundWorkflow: Telo zahteva
PoljeOpis
taxpayerIdobaveznoTip: uuid
businessPremiseIdobaveznoTip: uuid
clientReferenceobaveznoTip: string
originalobaveznoTip: BokaDocumentReference
sourceobaveznoTip: const "BOKA"
fiscalDocumentIdobaveznoTip: uuid
cashierobaveznoTip: Cashier
idobaveznoTip: string
displayNameopcionoTip: string
buyerobaveznoTip: 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.
itemsobaveznoTip: array<RefundWorkflowLineItem>

min 1 items

originalLineIndexobaveznoTip: integerZero-based index of the exact line on the identified original receipt.

>= 0

catalogProductIdopcionoTip: uuidOptional; must match the Boka-stored original line when source is BOKA.
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: numberQuantity returned from this original line.

>= 0.001<= 99999999999.999step 0.001

unitPriceobaveznoTip: numberMust match the final gross unit price on the identified original line when source is BOKA.

>= 0step 0.01

unitPriceBeforeDiscountopcionoTip: numberOptional Boka-local pre-discount price; when the source line has it, the value must match exactly and remain greater than unitPrice.

>= 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

Odgovori

createRefundWorkflow: Odgovori
200OKIdempotent replay of a completed refund workflowRefundWorkflow
201CreatedCompleted refund workflowRefundWorkflow
404Not FoundResource does not exist within the authenticated tenant scopeErrorCode
409ConflictThe key was already used with different canonical contentIdempotencyConflict
422Unprocessable ContentThe command violates a Boka or fiscal ruleErrorCode
503Service UnavailableThe refund workflow is incomplete; no missing fiscal step is claimed as issuedRefundWorkflow

Primeri

cash

POST/v1/refund-workflows
curl -X POST "https://api.bokapos.rs/v1/refund-workflows" \
  -H "Authorization: Bearer $BOKAPOS_TOKEN" \
  -H "Idempotency-Key: order-4127-refund-1" \
  -H "Content-Type: application/json" \
  -d '{
  "taxpayerId": "3f9c2a8e-6b1d-4e5a-9c47-1d2b8e6f0a11",
  "businessPremiseId": "b7d4e2c1-9a3f-4c8e-8f21-6e5a0c9d3b22",
  "clientReference": "ORDER-4127-R1",
  "original": {
    "source": "BOKA",
    "fiscalDocumentId": "9f8e7d6c-5b4a-4321-8765-0fedcba98761"
  },
  "cashier": {
    "id": "web-shop"
  },
  "buyer": {
    "id": "20:001234567"
  },
  "items": [
    {
      "originalLineIndex": 0,
      "name": "Bluetooth slušalice",
      "unitOfMeasure": "kom",
      "quantity": 1,
      "unitPrice": 8990,
      "gtin": "8606012345678",
      "taxLabels": [
        "F"
      ]
    }
  ],
  "payments": [
    {
      "type": "CASH",
      "amount": 8990
    }
  ]
}'
201Created
{
  "id": "5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b",
  "taxpayerId": "3f9c2a8e-6b1d-4e5a-9c47-1d2b8e6f0a11",
  "businessPremiseId": "b7d4e2c1-9a3f-4c8e-8f21-6e5a0c9d3b22",
  "clientReference": "ORDER-4127-R1",
  "status": "COMPLETED",
  "original": {
    "source": "BOKA",
    "fiscalDocumentId": "9f8e7d6c-5b4a-4321-8765-0fedcba98761",
    "pfrNumber": "JWX4K9PL-JWX4K9PL-1042",
    "pfrTime": "2026-09-01T10:15:32.483+02:00",
    "invoiceType": "NORMAL",
    "transactionType": "SALE"
  },
  "refund": {
    "id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
    "taxpayerId": "3f9c2a8e-6b1d-4e5a-9c47-1d2b8e6f0a11",
    "businessPremiseId": "b7d4e2c1-9a3f-4c8e-8f21-6e5a0c9d3b22",
    "idempotencyKey": "order-4127-refund-1",
    "clientReference": "ORDER-4127-R1",
    "invoiceType": "NORMAL",
    "transactionType": "REFUND",
    "cashierId": "web-shop",
    "buyerId": "20:001234567",
    "buyerDetails": null,
    "status": "FISCALIZED",
    "fiscalized": true,
    "failureCode": null,
    "retryable": false,
    "pfr": {
      "invoiceNumber": "JWX4K9PL-JWX4K9PL-1045",
      "sdcTime": "2026-09-01T10:15:32.483+02:00",
      "requestedBy": "JWX4K9PL",
      "signedBy": "JWX4K9PL",
      "transactionTypeCounter": 900,
      "totalCounter": 1045,
      "invoiceCounterExtension": "ПР",
      "totalAmount": 8990,
      "totalTax": 890.9009,
      "verificationUrl": "https://sandbox.suf.purs.gov.rs/v/?vl=A0pXWDRLOVBMSldYNEs5UEwSBAAAEAQAAKCLPAAAAAAAAAABnAqJa1EAAAA...",
      "journal": "============ ФИСКАЛНИ РАЧУН ============\n...\nПФР број рачуна:      JWX4K9PL-JWX4K9PL-1045\nБројач рачуна:                900/1045ПР\n========================================\n======== КРАЈ ФИСКАЛНОГ РАЧУНА ========="
    },
    "receipt": {
      "textUrl": "/v1/fiscal-documents/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d/representations/official-text",
      "jsonUrl": "/v1/fiscal-documents/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d/representations/canonical-json",
      "pdfA4Url": "/v1/fiscal-documents/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d/representations/pdf-a4",
      "pdf80mmUrl": "/v1/fiscal-documents/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d/representations/pdf-80mm",
      "pdf58mmUrl": "/v1/fiscal-documents/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d/representations/pdf-58mm",
      "previewImageUrl": "/v1/fiscal-documents/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d/representations/preview-png",
      "qrImageUrl": "/v1/fiscal-documents/a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d/representations/qr-svg",
      "verificationUrl": "https://sandbox.suf.purs.gov.rs/v/?vl=A0pXWDRLOVBMSldYNEs5UEwSBAAAEAQAAKCLPAAAAAAAAAABnAqJa1EAAAA...",
      "preferredPaperFormat": "a4"
    },
    "reference": {
      "fiscalDocumentId": "9f8e7d6c-5b4a-4321-8765-0fedcba98761",
      "pfrNumber": "JWX4K9PL-JWX4K9PL-1042",
      "pfrTime": "2026-09-01T10:15:32.483+02:00"
    },
    "createdAt": "2026-09-01T08:15:31.902Z",
    "updatedAt": "2026-09-01T08:15:32.611Z"
  },
  "cashRefundCopy": {
    "id": "6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c",
    "taxpayerId": "3f9c2a8e-6b1d-4e5a-9c47-1d2b8e6f0a11",
    "businessPremiseId": "b7d4e2c1-9a3f-4c8e-8f21-6e5a0c9d3b22",
    "idempotencyKey": "order-4127-refund-1:copy",
    "clientReference": "COPY-ORDER-4127-R1",
    "invoiceType": "COPY",
    "transactionType": "REFUND",
    "cashierId": "web-shop",
    "buyerId": "20:001234567",
    "buyerDetails": null,
    "status": "FISCALIZED",
    "fiscalized": true,
    "failureCode": null,
    "retryable": false,
    "pfr": {
      "invoiceNumber": "JWX4K9PL-JWX4K9PL-1046",
      "sdcTime": "2026-09-01T10:15:32.483+02:00",
      "requestedBy": "JWX4K9PL",
      "signedBy": "JWX4K9PL",
      "transactionTypeCounter": 901,
      "totalCounter": 1046,
      "invoiceCounterExtension": "КР",
      "totalAmount": 8990,
      "totalTax": 890.9009,
      "verificationUrl": "https://sandbox.suf.purs.gov.rs/v/?vl=A0pXWDRLOVBMSldYNEs5UEwSBAAAEAQAAKCLPAAAAAAAAAABnAqJa1EAAAA...",
      "journal": "============ ФИСКАЛНИ РАЧУН ============\n...\nПФР број рачуна:      JWX4K9PL-JWX4K9PL-1046\nБројач рачуна:                901/1046КР\n========================================\n======== КРАЈ ФИСКАЛНОГ РАЧУНА ========="
    },
    "receipt": {
      "textUrl": "/v1/fiscal-documents/6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c/representations/official-text",
      "jsonUrl": "/v1/fiscal-documents/6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c/representations/canonical-json",
      "pdfA4Url": "/v1/fiscal-documents/6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c/representations/pdf-a4",
      "pdf80mmUrl": "/v1/fiscal-documents/6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c/representations/pdf-80mm",
      "pdf58mmUrl": "/v1/fiscal-documents/6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c/representations/pdf-58mm",
      "previewImageUrl": "/v1/fiscal-documents/6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c/representations/preview-png",
      "qrImageUrl": "/v1/fiscal-documents/6f7a8b9c-0d1e-4f2a-9b3c-4d5e6f7a8b9c/representations/qr-svg",
      "verificationUrl": "https://sandbox.suf.purs.gov.rs/v/?vl=A0pXWDRLOVBMSldYNEs5UEwSBAAAEAQAAKCLPAAAAAAAAAABnAqJa1EAAAA...",
      "preferredPaperFormat": "a4"
    },
    "reference": {
      "fiscalDocumentId": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d",
      "pfrNumber": "JWX4K9PL-JWX4K9PL-1045",
      "pfrTime": "2026-09-01T16:40:05.120+02:00"
    },
    "createdAt": "2026-09-01T08:15:31.902Z",
    "updatedAt": "2026-09-01T08:15:32.611Z"
  },
  "failureCode": null,
  "createdAt": "2026-09-01T14:40:04.300Z",
  "updatedAt": "2026-09-01T14:40:06.902Z"
}

Kod povraćaja gotovine BokaPOS odmah izdaje i kopiju refundacije (cashRefundCopy) sa linijom za potpis kupca; odštampajte je i dajte kupcu na potpis.

Odgovor: RefundWorkflow

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

createRefundWorkflow: Odgovor
PoljeOpis
idobaveznoTip: uuid
taxpayerIdobaveznoTip: uuid
businessPremiseIdobaveznoTip: uuid
clientReferenceobaveznoTip: string
statusobaveznoTip: string

VrednostiREFUND_PENDINGREFUND_OUTCOME_UNKNOWNCOPY_PENDINGCOPY_OUTCOME_UNKNOWNCOMPLETEDFAILED

originalobaveznoTip: RefundWorkflowOriginal
sourceobaveznoTip: const "BOKA"
fiscalDocumentIdobaveznoTip: uuid
pfrNumberobaveznoTip: string
pfrTimeobaveznoTip: date-time
invoiceTypeobaveznoTip: InvoiceType

VrednostiNORMALPROFORMACOPYTRAININGADVANCE

transactionTypeobaveznoTip: TransactionType

VrednostiSALEREFUND

refundobaveznoTip: 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
cashRefundCopyopcionoTip: FiscalDocument | null (može biti null)
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