๐Ÿ–จ๏ธFiscals

This page provides a description of the available API routes for managing fiscal devices.

Fiscal device refers to receipt printer that prints cash register receipts (part of ticket closing procedure).

Fiscal device is represented by Fiscal class.

API methods

CRUD actions

These API methods allow for the management of fiscal resources, including creation, reading, updating, and deletion.

Get fiscals

GET http://{server-address}/fiscals

Returns all fiscals that matches query parameters. Result is of type QueryResult<Fiscal>.

Query Parameters

NameTypeDescription

name

string

Supports NData syntax.

$skip

int

Pagination property. Describing number of records to skip from beginning of result collection.

$take

int

Pagination property. Maximum count of items to be returned.

$sort

string[]

Comma separated list of property names. Please see NData syntax.

$count

bool

If set to true, response will not contain items collection. Use to get resource count, not the resources themselves.

isActive

bool

Supports NData syntax.

type

string

Supports NData syntax.

dkp

string

Supports NData syntax.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

{
    "items":
    [
        {
            "name": "Virtual",
            "isActive": true,
            "type": "Virtual",
            "version": "",
            "dkp": "88811223344550000",
            "settings":
            {
                "Footer": "ฤŽakujeme za nรกkup!"
            },
            "_v": 1
        }
    ],
    "count": 1,
    "totalCount": 1
}

Get fiscal by name

GET http://{server-address}/fiscals/{name}

Result is of type Fiscal.

Path Parameters

NameTypeDescription

name*

string

Unique fiscal name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

{
    "name": "fiscal1",
    "isActive": true,
    "type": "Virtual",
    "version": "",
    "dkp": "88811223344550000",
    "settings":
    {
        "Footer": "ฤŽakujeme za nรกkup!"
    },
    "_v": 1
}{
    "name": "fiscal1",
    "isActive": true,
    "type": "Virtual",
    "version": "",
    "dkp": "88811223344550000",
    "settings":
    {
        "Footer": "ฤŽakujeme za nรกkup!"
    },
    "_v": 1
}

Create fiscal

POST http://{server-address}/fiscals

Creates new fiscal. Result is of type Fiscal.

Required rights

Authorized user must have FiscalCreate right assigned.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

Request Body

NameTypeDescription

(body)*

Fiscal

Model to create.

{
    "name": "fiscal1",
    "isActive": true,
    "type": "Virtual",
    "version": "",
    "dkp": "88811223344550000",
    "settings":
    {
        "Footer": "ฤŽakujeme za nรกkup!"
    },
    "_v": 1
}

Create or update fiscal

PUT http://{server-address}/fiscals/{name}

Creates new or updates existing fiscal. Result is of type Fiscal.

Required rights

Authorized user must have assigned FiscalCreate or FiscalUpdate right.

Path Parameters

NameTypeDescription

name*

string

Unique fiscal name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

Request Body

NameTypeDescription

(body)*

Fiscal

Model to create or update.

{
    "name": "fiscal1",
    "isActive": true,
    "type": "Virtual",
    "version": "",
    "dkp": "88811223344550000",
    "settings":
    {
        "Footer": "ฤŽakujeme za nรกkup!"
    },
    "_v": 1
}

Delete fiscal by name

DELETE http://{server-address}/fiscals/{name}

Required rights

Authorized user must have FiscalDelete right assigned.

Path Parameters

NameTypeDescription

name*

string

Unique fiscal name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

{
    "name": "fiscal1",
    "isActive": true,
    "type": "Virtual",
    "version": "",
    "dkp": "88811223344550000",
    "settings":
    {
        "Footer": "ฤŽakujeme za nรกkup!"
    },
    "_v": 1
}

RPC actions

These API methods trigger specific actions on fiscal devices. However, it's important to note that depending on the type of fiscal device, some methods may not be supported. Additionally, attempting an action on a fiscal device that is marked as inactive will also result in failure. In both of these cases, making API calls will result in an HTTP status code of 403.

Open cash drawer

POST http://{server-address}/fiscals/{name}/open_drawer

Opens cash drawer on specified device.

Required rights

Authorized user must have FiscalOpenDrawer right assigned.

Path Parameters

NameTypeDescription

name*

string

Unique fiscal name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

The response body contains no content.

Perform cash transfer

POST http://{server-address}/fiscals/{name}/cash_transfer

This method performs a cash transfer operation on a fiscal device specified by name. It updates the latest daily sales report for the device or creates a new report if none is currently opened. The updated daily sales report is then returned in the response body.

The method accepts CashTransfer in request body.

Required rights

Authorized user must have FiscalCashTransfer right assigned.

Path Parameters

NameTypeDescription

name*

string

Unique fiscal name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

Request Body

NameTypeDescription

(body)*

CashTransfer

Cash transfer model.

POST http://{server-address}/fiscals/{name}/print_record_copy

Prints copy of specified ticket on fiscal printer. Method accepts RecordCopyContext in request body.

Required rights

Authorized user must have FiscalPrintRecordCopy right assigned.

Path Parameters

NameTypeDescription

name*

string

Unique fiscal name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

Request Body

NameTypeDescription

(body)*

RecordCopyContext

The record copy context.

The response body contains no content.

POST http://{server-address}/fiscals/{name}/print_last_record_copy

Prints copy of last ticket printed on fiscal printer.

Required rights

Authorized user must have FiscalPrintRecordCopy right assigned.

Path Parameters

NameTypeDescription

name*

string

Unique fiscal name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

The response body contains no content.

POST http://{server-address}/fiscals/{name}/print_overview_sales_report

Prints overview sales report on specified fiscal printer.

The overview sales report ("Priebeลพnรก uzรกvierka", "Prehฤพadovรก uzรกvierka" or "X uzรกvierka" in Slovak) includes financial information on sales from the last daily sales report.

Required rights

Authorized user must have OverviewSalesReport right assigned.

Path Parameters

NameTypeDescription

name*

string

Unique fiscal name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

The response body contains no content.

POST http://{server-address}/fiscals/{name}/print_summary_interval_sales_report

Prints summary interval sales report on specified fiscal printer. The generated report consolidates financial information extracted from multiple daily sales reports.

The method accepts IntervalSalesReportContext in request body.

Required rights

Authorized user must have SummaryIntervalSalesReport right assigned.

Path Parameters

NameTypeDescription

name*

string

Unique fiscal name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

Request Body

NameTypeDescription

(body)*

IntervalSalesReportContext

Model that specifies sales reports interval.

The response body contains no content.

POST http://{server-address}/fiscals/{name}/print_detailed_interval_sales_report

Prints detailed interval sales report on specified fiscal printer. The generated report consolidates financial information extracted from multiple daily sales reports.

The method accepts IntervalSalesReportContext in request body.

Required rights

Authorized user must have DetailedIntervalSalesReport right assigned.

Path Parameters

NameTypeDescription

name*

string

Unique fiscal name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

Request Body

NameTypeDescription

(body)*

IntervalSalesReportContext

Model that specifies sales reports interval.

The response body contains no content.

POST http://{server-address}/fiscals/{name}/daily_sales_report

Performs daily sales closure and prints daily sales report on specified fiscal printer. DailySalesReport is returned in response body. It's important to note that certain fiscal devices only support one daily sales report per day, while other types of fiscal devices allow multiple closures to be performed within the same day.

Required rights

Authorized user must have DoDailySalesReport right assigned.

Path Parameters

NameTypeDescription

name*

string

Unique fiscal name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

{
    "id": "649ad7516413d6a4de6c8cb4",
    "fiscalName": "eKasa",
    "number": 1,
    "fiscalMemorySerialNumber": "1326585810",
    "openDate": "2023-06-27T08:04:25.605Z",
    "closeDate": "2023-06-27T22:42:13.662Z",
    "currencyLabel": "EUR",
    "cashTransfers":
    [],
    "fiscalInfo":
    {
        "ticketsCount": 7,
        "ticketsAmountIncludingVat":
        {
            "amount": 80.65,
            "currencyLabel": "EUR"
        },
        "invalidTicketsCount": 0,
        "invalidTicketsAmountIncludingVat":
        {
            "amount": 0.0,
            "currencyLabel": "EUR"
        },
        "invoiceTicketsCount": 0,
        "invoiceTicketsAmountIncludingVat":
        {
            "amount": 0.0,
            "currencyLabel": "EUR"
        },
        "positiveTicketItemsCount": 8,
        "positiveTicketItemsAmountIncludingVat":
        {
            "amount": 80.65,
            "currencyLabel": "EUR"
        },
        "returnedContainerTicketItemsCount": 0,
        "returnedContainerTicketItemsAmountIncludingVat":
        {
            "amount": 0.0,
            "currencyLabel": "EUR"
        },
        "returnedTicketItemsCount": 0,
        "returnedTicketItemsAmountIncludingVat":
        {
            "amount": 0.0,
            "currencyLabel": "EUR"
        },
        "correctionTicketItemsCount": 0,
        "correctionTicketItemsAmountIncludingVat":
        {
            "amount": 0.0,
            "currencyLabel": "EUR"
        },
        "discountTicketItemsCount": 0,
        "discountTicketItemsAmountIncludingVat":
        {
            "amount": 0.0,
            "currencyLabel": "EUR"
        },
        "advanceTicketItemsCount": 0,
        "advanceTicketItemsAmountIncludingVat":
        {
            "amount": 0.0,
            "currencyLabel": "EUR"
        },
        "creditTicketItemsCount": 0,
        "creditTicketItemsAmountIncludingVat":
        {
            "amount": 0.0,
            "currencyLabel": "EUR"
        },
        "voucherTicketItemsCount": 0,
        "voucherTicketItemsAmountIncludingVat":
        {
            "amount": 0.0,
            "currencyLabel": "EUR"
        },
        "vatIncomes":
        [
            {
                "vatCategory": 1,
                "vatRate": 20.0,
                "totalAmount":
                {
                    "amount": 9.45,
                    "currencyLabel": "EUR"
                },
                "vatAmount":
                {
                    "amount": 1.58,
                    "currencyLabel": "EUR"
                }
            },
            {
                "vatCategory": 2,
                "vatRate": 10.0,
                "totalAmount":
                {
                    "amount": 71.2,
                    "currencyLabel": "EUR"
                },
                "vatAmount":
                {
                    "amount": 6.47,
                    "currencyLabel": "EUR"
                }
            },
            {
                "vatCategory": 3,
                "vatRate": 0.0,
                "totalAmount":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                },
                "vatAmount":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                }
            },
            {
                "vatCategory": 4,
                "vatRate": 0.0,
                "totalAmount":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                },
                "vatAmount":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                }
            },
            {
                "vatCategory": 5,
                "vatRate": 0.0,
                "totalAmount":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                },
                "vatAmount":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                }
            }
        ],
        "grandTotalAmountIncludingVat":
        {
            "amount": 1619.31,
            "currencyLabel": "EUR"
        },
        "roundingDown":
        {
            "amount": -0.02,
            "currencyLabel": "EUR"
        },
        "roundingUp":
        {
            "amount": 0.02,
            "currencyLabel": "EUR"
        }
    },
    "state": "Closed",
    "_v": 2
}

POST http://{server-address}/fiscals/{name}/daily_sales_report_copy

Prints copy of daily sales report associated with given fiscal printer. Method accepts DailySalesReportCopyContext in request body.

Required rights

Authorized user must have FiscalPrintDailySalesReportCopy right assigned.

Path Parameters

NameTypeDescription

name*

string

Unique fiscal name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

Request Body

NameTypeDescription

(body)

DailySalesReportCopyContex

Context that specifies daily sales report to be printed.

The response body contains no content.

POST http://{server-address}/fiscals/{name}/last_daily_sales_report_copy

Prints copy of last daily sales report associated with given fiscal printer.

Required rights

Authorized user must have FiscalPrintDailySalesReportCopy right assigned.

Path Parameters

NameTypeDescription

name*

string

Unique fiscal name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

The response body contains no content.

POST http://{server-address}/fiscals/{name}/print_nonfiscal_record

Prints text (nonfiscal record) on selected fiscal device. Method accepts NonfiscalRecordContext in request body.

Required rights

Authorized user must have PrintNonfiscalRecord right assigned.

Path Parameters

NameTypeDescription

name*

string

Unique fiscal name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

Request Body

NameTypeDescription

(body)

NonfiscalRecordContext

Context that specifies text to be printed.

The response body contains no content.

Last updated