Reports API
Get data to generate reports for store data
General:
Basics:
Base-URL: https://capi.lagerkoll.com/v1/reports/
Parameters in the url should all be encoded and all data sent should be UTF-8
MAX number of requests per minute is set to 200.
When the limit is hit an error with code 429 is returned, with the header "Retry-After" containing the number of seconds you have to wait for your next request.
When the limit is hit an error with code 429 is returned, with the header "Retry-After" containing the number of seconds you have to wait for your next request.
Headers:
There are 2 ways to be authenticated when using this API. in both ways you add headers to the request.
1) Use an API-key together with store-id. This would be used when communicating machine to machine and no real person is involved. The API-key is available from where you activated the API. The store-id is also available in the same place.
2) Use a user_id and user_token together with a store-id. You get these values from the login-request. The values are connected to a person and are gained when an actual login to the system has been made.
1) Use an API-key together with store-id. This would be used when communicating machine to machine and no real person is involved. The API-key is available from where you activated the API. The store-id is also available in the same place.
2) Use a user_id and user_token together with a store-id. You get these values from the login-request. The values are connected to a person and are gained when an actual login to the system has been made.
store: <<STORE>> user_id: <<USER_ID>> user_token: <<USER_TOKEN>> api_key: <<API_KEY>> Accept: application/json Content-Type: application/json
Errors:
| Code | Description |
|---|---|
| 900001 | Credentials don't match |
| 900101 | Common error |
| 900429 | Too many requests |
| 904001 | Error when getting report data |
{
"errorCode" : 900101,
"errorMessage" : "Something went wrong on the server",
"errorField" : null,
"errorData" : null
}
Reports API:
Reports
Get summary for tobacco and nicotine
GETUrl: /tobacco/summary
Headers:
Accept: application/json or application/xml
Get summary of weight, volume, tax cost for weight and tax cost for volume for tobacco and nicotine statistics during chosen period
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| include_tobacco | true | ||
| include_nicotine | true | ||
| start_date | |||
| end_date | |||
| tag | |||
| account | -1 |
Body:
Successfull response:
{"vats": [{ "isDefault": true, "code": "code", "vat": 8013.555445627539, "description": "description", "id": 9228, "account": 1168 }]}
Get stockworth
GETUrl: /stockworth
Headers:
Accept: application/json or application/xml
Get stockworth data for report
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| days | 30 | ||
| end_date |
Body:
Successfull response:
{"stats": [{ "stockValue": 3655.601415501194, "date": 4992, "stockValueFIFO": 7362.6984981631 }]}
Get customer orders
GETUrl: /customerorders
Headers:
Accept: application/json or application/xml
Get customer orders data for report
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| days | 30 | ||
| end_date |
Body:
Successfull response:
{"stats": [{ "date": 4358, "orderAmount": 8741.643152150555, "orderProducts": 1744.7685042533722, "orderValue": 8917.222747731148 }]}
Get orders for article
GETUrl: /orders/{id : .+}
Headers:
Accept: application/json or application/xml
Get customer and purchase orders data for article for report
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| end_date |
Body:
Successfull response:
{ "customerOrders": [{}], "purchaseOrders": [{}] }
Get customer orders for article
GETUrl: /customerorders/{id : .+}
Headers:
Accept: application/json or application/xml
Get customer orders data for article for report
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| batch | |||
| serialnumber | |||
| days | 30 | ||
| end_date |
Body:
Successfull response:
{"stats": [{ "orderCreated": 4842, "articleName": "articleName", "articleValue": 2009.5412165760008, "orderId": 5087, "orderDisplayId": "orderDisplayId", "articleAmount": 2.708271026448106, "articleDiscount": 3246.001683922546, "articleId": "articleId", "orderValue": 3031.581594335957, "articleDiscountType": "articleDiscountType", "customerName": "customerName", "orderState": "orderState", "customerId": 2541, "customerDisplayId": "customerDisplayId" }]}
Get customers
GETUrl: /customers
Headers:
Accept: application/json or application/xml
Get customers data for report
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| days | 30 | ||
| end_date | |||
| max_customers | 10 |
Body:
Successfull response:
{"stats": [{ "customerId": 9864, "orderValue": 4042.163558443076, "customerName": "customerName" }]}
Get customers for article
GETUrl: /customers_for_article/{id : .+}
Headers:
Accept: application/json or application/xml
Get customers data for article for report
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| start | |||
| end | |||
| batch_id | |||
| serial_nr | |||
| delivered | true | ||
| not_delivered | true |
Body:
Successfull response:
{"stats": [{ "customerId": 54, "orderValue": 329.448725005671, "customerName": "customerName" }]}
Get customer products
GETUrl: /customers/{customer_id}/products
Headers:
Accept: application/json or application/xml
Get customer products data for report
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| days | 30 | ||
| end_date |
Body:
Successfull response:
{"stats": [{ "amount": 4872.812927120663, "articleName": "articleName", "articleId": "articleId", "value": 2511.647200499666 }]}
Get articles most sold
GETUrl: /articles_most_sold
Headers:
Accept: application/json or application/xml
Get articles most sold data for report
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| days | 30 | ||
| end_date | |||
| max_articles | 10 | ||
| type | amount |
Body:
Successfull response:
{"stats": [{ "amount": 1152.4232552185242, "articleName": "articleName", "articleId": "articleId", "value": 8700.57910978434 }]}
Get articles per account
GETUrl: /articles_per_account
Headers:
Accept: application/json or application/xml
Get articles data sold per account for report
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| days | 30 | ||
| end_date | |||
| max_accounts | 0 |
Body:
Successfull response:
{"stats": [{ "value": 1744.256251591627, "account": "account" }]}
Get articles stock state
GETUrl: /articles_stockstate
Headers:
Accept: application/json or application/xml
Get articles stock state data for report
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| article_id | |||
| end_date |
Body:
Successfull response:
{"states": [{ "stockAmount": 567.6175533243211, "date": 678, "incoming": 44.0593986956972, "outgoing": 8008.315819222706, "articleId": "articleId" }]}
Get alcoholic beverage sales accounts
GETUrl: /alcoholic_beverage_sales_account
Headers:
Accept: application/json or application/xml
Get sales accounts for alcoholic beverage statistics for chosen period
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| start_date | |||
| end_date |
Body:
Successfull response:
{"vats": [{ "isDefault": true, "code": "code", "vat": 6135.168422409418, "description": "description", "id": 452, "account": 4142 }]}
Get alcoholic beverage statistics
GETUrl: /alcoholic_beverage
Headers:
Accept: application/json or application/xml
Get alcoholic beverage statistics for chosen period
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| page | 0 | ||
| limit | 50 | ||
| start_date | |||
| end_date | |||
| account | -1 |
Body:
Successfull response:
{ "pages": 3336, "stats": [{}], "pageSize": 4149, "page": 8639, "articlesCount": 2374 }
Get ordered articles
GETUrl: /ordered_articles
Headers:
Accept: application/json or application/xml
Get last ordered articles data for article for report
Body:
Successfull response:
{"articles": [{ "deliveredDate": 4565, "ordered": 2132.9856227499145, "orderId": 1893, "articleId": "articleId", "externalOrderId": "externalOrderId", "deliveryDate": 8070, "orderDate": 4225 }]}
Get summary alcoholic beverage
GETUrl: /alcoholic_beverage/summary
Headers:
Accept: application/json or application/xml
Get summary of volume, tax cost for volume for alcoholic beverage statistics during chosen period
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| start_date | |||
| end_date | |||
| account | -1 |
Body:
Successfull response:
{ "totalVolume": 2820.3632651882904, "taxCostVolume": 9957.19691300046 }
Get tobacco and nicotine statistics
GETUrl: /tobacco
Headers:
Accept: application/json or application/xml
Get tobacco and nicotine statistics for chosen period
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| page | 0 | ||
| limit | 50 | ||
| include_tobacco | true | ||
| include_nicotine | true | ||
| start_date | |||
| end_date | |||
| tag | |||
| account | -1 |
Body:
Successfull response:
{ "pages": 3577, "stats": [{}], "pageSize": 4509, "page": 2376, "articlesCount": 1884 }
Get tobacco and nicotine sales accounts
GETUrl: /tobacco_sales_account
Headers:
Accept: application/json or application/xml
Get sales accounts for tobacco and nicotine statistics for chosen period
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| include_tobacco | true | ||
| include_nicotine | true | ||
| start_date | |||
| end_date | |||
| tag |
Body:
Successfull response:
{"vats": [{ "isDefault": false, "code": "code", "vat": 9610.04470710547, "description": "description", "id": 7197, "account": 7210 }]}
Get bestseller article
GETUrl: /category/{id}/bestseller_article
Headers:
Accept: application/json or application/xml
Get the bestseller article of a category
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| start | |||
| end |
Get category rate
GETUrl: /category/{id}/category_rate
Headers:
Accept: application/json or application/xml
Get the rate of a category
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| start | |||
| end |
Get articles to chart
GETUrl: /category/{id}/articles_chart
Headers:
Accept: application/json or application/xml
Get a list of articles for a category to display in the chart. If an article is missing value for specific day it means it has a value of 0
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| start | |||
| end | |||
| limiter | quarter |
Get stock count change
GETUrl: /stock_count_change
Headers:
Accept: application/json or application/xml
Get a list of articles where stock has changed during a specified period
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| start_date | |||
| end_date | |||
| page | 0 | ||
| limit | 25 | ||
| order | desc | asc,desc | |
| sort_column | article_id | article_id,name,category,count,in_delivery,out_delivery |
Body:
Successfull response:
{ "pages": 6128, "pageSize": 6744, "page": 9768, "articlesCount": 7257, "articles": [{}] }
Get stock count fixed
GETUrl: /stock_count_fixed
Headers:
Accept: application/json or application/xml
Get a list of articles where stock has not changed during a specified period
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| start_date | |||
| end_date | |||
| page | 0 | ||
| limit | 25 | ||
| order | desc | asc,desc | |
| sort_column | article_id | article_id,name,category,count,in_delivery,out_delivery |
Body:
Successfull response:
{ "pages": 3738, "pageSize": 4240, "page": 4733, "articlesCount": 6390, "articles": [{}] }
Get annual sales to category chart
GETUrl: /category/{id}/category_chart
Headers:
Accept: application/json or application/xml
Get a list of annual sales to display in the chart. If a category is missing value for specific year it means it has a value of 0
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| start | |||
| end | |||
| limiter | quarter |
Get sales to categories chart
GETUrl: /categories_chart
Headers:
Accept: application/json or application/xml
Get a list of sales to display in the chart. If a category is missing value for specific day, week, month, quarter or year it means it has a value of 0
Valid parameters:
| Parameter | Description | Default value | Allowed values |
|---|---|---|---|
| start | |||
| end | |||
| limiter | quarter |
Classes:
ArticlesForStockCountChangeResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| page | int | R | |||||
| pages | int | R | |||||
| pageSize | int | R | |||||
| articlesCount | int | R | |||||
| articles | List | R |
ReportsAccountDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| account | String | R | |||||
| value | double | R |
ReportsAccountsResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| stats | List | R |
ReportsAlcoholicSummaryDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| totalVolume | double | R | |||||
| taxCostVolume | double | R |
ReportsArticleDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| articleId | String | R | |||||
| articleName | String | R | |||||
| amount | double | R | |||||
| value | double | R |
ReportsArticlesResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| stats | List | R |
ReportsArticleStockStateDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| articleId | String | R | |||||
| stockAmount | double | R | |||||
| incoming | double | R | |||||
| outgoing | double | R | |||||
| date | long | R |
ReportsArticleStockStatesResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| states | List | R |
ReportsBeverageSalesAccountsResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| vats | List | R |
ReportsBeverageStatisticsResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| page | int | R | |||||
| pages | int | R | |||||
| pageSize | int | R | |||||
| articlesCount | int | R | |||||
| stats | List | R |
ReportsCustomerDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| customerId | Long | R | |||||
| customerName | String | R | |||||
| orderValue | Double | R |
ReportsCustomerOrderArticleDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| articleId | String | R | |||||
| ordered | double | R | |||||
| orderId | long | R | |||||
| externalOrderId | String | R | |||||
| orderDate | Long | R | |||||
| deliveryDate | Long | R | |||||
| deliveredDate | Long | R |
ReportsCustomerOrderArticlesResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| articles | List | R |
ReportsCustomerOrderDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| orderId | Long | R | |||||
| orderDisplayId | String | R | |||||
| orderCreated | Long | R | |||||
| orderValue | Double | R | |||||
| orderState | String | R | |||||
| articleId | String | R | |||||
| articleName | String | R | |||||
| articleAmount | Double | R | |||||
| articleValue | Double | R | |||||
| articleDiscount | Double | R | |||||
| articleDiscountType | String | R | |||||
| customerId | Long | R | |||||
| customerDisplayId | String | R | |||||
| customerName | String | R |
ReportsCustomerOrdersResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| stats | List | R |
ReportsCustomerOrderSummariesResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| stats | List | R |
ReportsCustomerOrderSummaryDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| orderValue | Double | R | |||||
| orderAmount | Double | R | |||||
| orderProducts | Double | R | |||||
| date | Long | R |
ReportsCustomersResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| stats | List | R |
ReportsOrdersResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| customerOrders | List | R | |||||
| purchaseOrders | List | R |
ReportsStockWorthDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| stockValue | Double | R | |||||
| stockValueFIFO | Double | R | |||||
| date | Long | R |
ReportsStockWorthResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| stats | List | R |
ReportsTobaccoStatisticsResponseDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| page | int | R | |||||
| pages | int | R | |||||
| pageSize | int | R | |||||
| articlesCount | int | R | |||||
| stats | List | R |
VATDto
| Field | Type | Description | Default | Mandatory | Accepted values | Example values | Access |
|---|---|---|---|---|---|---|---|
| id | long | R | |||||
| vat | double | VAT value in percentage | R | ||||
| account | int | sales account | R | ||||
| code | String | vat code | R | ||||
| description | String | description of vat | R | ||||
| isDefault | Boolean | default vat | R |