Yoobic Business KPIs data - salesdata API
Business KPIs data allows integration of external business data per location. This is the data that will be used to display Business KPIs in the Activity Hub or Today's focus widget of the application. Periods can be: yearly, monthly, weekly, or daily. Salesdata uniqueness is determined by: - store_id - reporting_date - title - category - value_frequency - target In case a new salesdata is created with values for the latter five which already exist in a salesdata, then the salesdata will be updated. Otherwise, a new salesdata entry will be created The category parameter refers to which KPI will use this data point to calculate the value in the app. For example, the 5 predefined KPIs are based on the following categories: - `sales` for the Sales KPI, calculated as the Sum of all sales data in the KPI's frequency - `sales` and `transactions` for the Average Basket KPI, calculated as SUM(sales) / SUM(transactions) in the KPI's frequency - `items` and `transactions` for the UPT KPI, calculated as SUM(items) / SUM(transactions) in the KPI's frequency - `transactions` and `traffic` for the Conversion rate KPI, calculated as SUM(transactions) / SUM(traffic) in the KPI's frequency - `reviews` for the Reviews, calculated as AVG(reviews) in the KPI's frequency - **For Custom KPIs**, the category must match the category defined in the **Business KPI configuration menu**. **Reporting Date** - The `reporting_date` must correspond to the expected calculation period of the KPI. - Example: For daily sales data, push one entry per store each day (e.g., timestamp at store closing time). **Targets** - Define a target with the parameter `target: true`. - The `reporting_date` should correspond to the target's period. - For weekly targets, use the timestamp for the start of the week. ### Fields | Field | Type | Required | Readonly | OrderBy | Description | |----------------------|:--------------:|:--------:|:--------:|:-------:|---------------------------| |`salesdata_id` | string | | x | | Unique id of the salesdata| |`store_id` | string | | | x | Unique id of the store | |`store_client_id` | string | | | | client_id of the store. Can be used instead of the store_id | |`reporting_date` | date | x | | | Reporting date | |`title` | string | x | | x | The salesdata report title| |`category` | string | x | | x | Salesdata name | |`value` | number | x | | | Salesdata value | |`value_currency` | string | | | | Salesdata currency | |`value_frequency` | string | x | | | The product measuring frequency : yearly / monthly / weekly / daily / hourly | |`target` | boolean | | | | Indicates if the associated value is a target | |`created_date` | date | | x | | Creation date | |`updated_date` | date | | x | x | Last update date | Either store_id or store_client_id can be used.