Skip to main content

Recording Sales Receipts

How to post sales receipts via the REST API?

Written by Lenka Haringerová

The Post sales receipts service, which you'll find in the application above the sales till, can also be triggered via the REST API. It creates a cash receipt from the sales receipts for the selected day and links it to them.


Calling the service

The service is called using the PUT or POST method; no request body is needed:

PUT https://demo.flexibee.eu/c/demo/prodejka/zauctovat-prodejky.json?datum=2026-09-09&kasa=code:KASA&pokladna=2&typPokDokl=5

A complete URL, including optional parameters, might look like this:

PUT https://demo.flexibee.eu/c/demo/prodejka/zauctovat-prodejky.xml?datum=2026-09-09&kasa=37&pokladna=2&typPokDokl=5&typPohledavky[code:KARTA]=code:OST. POHLEDÁVKY

⚠️ Any method other than PUT or POST returns 405 Method Not Allowed.


Parameters

Parameter

Field in the application

Value

datum

Post sales receipts from date

Date in the format yyyy-mm-dd. If you don't specify this parameter, today's date is used.

kasa

Sales receipts from the till

Required. A record from the typ-prodejky records.

pokladna

Cash register

Required. A record from the pokladna records.

typPokDokl

Cash receipt type

Required. A record from the typ-pokladni-pohyb records.

cisRada

A record from the rada-pokladni-pohyb records. Required only when no numbering series matching the selected cash register and cash receipt type is found.

genPoklNulCastka

Create a cash receipt even for a zero amount

The default value is true.

typPohledavky[forma-uhrady]

The receivable type used for posting a non-cash payment. In square brackets is a record from the forma-uhrady records, and the value is a record from the typ-pohledavky records.

dry-run

The default value is false. With the value true, only the posting conditions are verified and no document is created.

For all parameters that identify a record, besides the numeric ID you can also use other supported identifier types — for example &kasa=code:KASA.

ℹ️ Required parameters are checked in the order kasa, pokladna, typPokDokl — if more than one is missing, you'll only be told about the first one. The API silently ignores unknown parameters, so a typo in the name of an optional parameter has no effect.


Dry-run verification

The dry-run=true parameter is a safe way to check whether the conditions for posting are met. On success, it returns 200 with an empty body; otherwise it returns 400 or 404 with a corresponding error message:

PUT https://demo.flexibee.eu/c/demo/prodejka/zauctovat-prodejky.json?datum=2026-09-09&kasa=code:KASA&pokladna=2&typPokDokl=5&dry-run=true

💡 Error states are returned in the response as an HTML page unless you request a specific format. The .json or .xml extension in the URL and the Accept header ensure that you get a machine-readable error with messageCode.


Output

A successful posting returns 200 and standard return values. The created cash receipt is in results:

{
"winstrom": {
"@version": "1.0",
"success": "true",
"stats": {
"created": "1",
"updated": "0",
"deleted": "0",
"skipped": "0",
"failed": "0"
},
"results": [
{
"id": "2034",
"ref": "/c/demo/pokladni-pohyb/2034.json"
}
]
}
}

Posted sales receipts get datUcto set and a link to the cash receipt is created. You'll find it in the vazby relation, where the sales receipt is in the a property and the cash receipt is in the b property:

GET https://demo.flexibee.eu/c/demo/prodejka/2852.json?relations=vazby


Error states

Status

Error code

Cause

400

missing_param_exception

A required parameter is missing; the message will name it.

400

zauctovaniProdejekNejsouProdejky

There are no unposted sales receipts for the selected date and till.

400

objectNotFound

A non-existent payment method or receivable type in the typPohledavky[…] parameter.

400

A date in a format other than required — the message reads Zadaný text … musí být datum ("The entered text … must be a date").

404

formZaznamNenalezen

A non-existent till, cash register, cash receipt type, or numbering series.

405

The HTTP method used is neither PUT nor POST.


Related

Did this answer your question?