Skip to main content

Purchase / Sale Analysis

How to process purchase or sale analysis via the REST API

Written by Lenka Haringerová

To query purchase and sales analysis via REST API, two endpoints are available, called using the GET method:

GET https://demo.flexibee.eu/c/demo/analyza-nakupu
GET https://demo.flexibee.eu/c/demo/analyza-prodeje

The {firma} segment in the address represents the company's database identifier. Supported output formats are selected via the .xml or .json extension.


Parameters

The parameters are, with minor differences, the same for both analyses. Only analyzovat is required.

Parameter

Description

Default value

analyzovatrequired

Determines the target of the analysis being performed. See the values in the table below.

clenit

Specifies further breakdown of the analyzed data; accepts the same values as analyzovat except id.

No further breakdown.

datumOd

Lower date limit for the analyzed documents.

No limit on the oldest document.

datumDo

Upper date limit for the analyzed documents.

No limit on the newest document.

datumyUcetne

Determines whether the given dates are treated as posting dates. When set to false, they are treated as issue dates instead.

true — search by posting date.

neucetniDoklady

Determines whether non-accounting documents are also included in the analysis.

true — include non-accounting documents as well.

mesicniSumace

Sets whether monthly turnover summaries should be calculated.

true — perform monthly summaries.

stredisko

Restricts the analysis to the selected division — ID or code. To specify multiple divisions, repeat the parameter.

All divisions, without restriction.

nekatalogovePolozky

Includes non-catalog items in the analysis. Only relevant when analyzing by companies (adresar) or company groups (skupFir).

false — catalog items only.

cenik

Restricts the analysis to the selected price list item. Relevant when using analyzovat=cenik.

All price list items.

firma

Restricts the analysis to the selected company. Relevant when using analyzovat=adresar.

All companies, without restriction.

🚨 datumyUcetne=false cannot be combined with monthly summaries. If you want to analyze by issue date, you must also disable summaries at the same time — i.e., datumyUcetne=false&mesicniSumace=false. Otherwise the request will fail with error incompatible_param_values_exceptionParameter values [datumyUcetne, mesicniSumace] are mutually incompatible.

Values for the analyzovat and clenit parameters

Value

Meaning

cenik

Goods movement.

skupZboz

Movement summarized by goods groups.

skupCen

By price list groups.

vyrobce

By manufacturer.

sklad

Warehouse turnovers.

stredisko

Division turnovers.

zakazka

Turnovers by order.

adresar

Turnovers by company.

skupFir

Turnovers summarized by company groups.

zodpOsoba

By responsible person.

mistUrc

Turnovers by destination — sales analysis only.

id

Individual records without grouping. Only for analyzovat; this value cannot be used with clenit.


Examples

Goods movement with no further restriction:

GET /c/demo/analyza-prodeje?analyzovat=cenik

Turnovers by company for the year 2012, by issue date — this requires disabling monthly summaries as well:

GET /c/demo/analyza-nakupu?analyzovat=adresar&datumOd=2012-01-01&datumDo=2012-12-31&datumyUcetne=false&mesicniSumace=false

Turnovers of company groups for two selected divisions:

GET /c/demo/analyza-prodeje?analyzovat=skupFir&nekatalogovePolozky=false&stredisko=code:A&stredisko=code:B

Sales of a single price list item, broken down by warehouse:

GET /c/demo/analyza-prodeje?analyzovat=cenik&clenit=sklad&cenik=code:KUFR


Error states

Situation

Response

Missing parameter analyzovat

400, missing_param_exceptionThe 'analyzovat' parameter is required to perform this operation

Unknown value for analyzovat or clenit, or possibly mistUrc for purchase analysis

400, unsupported_param_value_exception — the error message also lists the allowed values

datumyUcetne=false without mesicniSumace=false

400, incompatible_param_values_exception


Related

Did this answer your question?