Forecast Import API: Overview
Authentication
Section titled “Authentication”To be allowed to push towards the Forecast import, you must include the custom header AuthKey in your requests. This header should contain the authentication token provided to you by Caspeco or through the shared customer.
Endpoint
Section titled “Endpoint”Data should be sent towards the following endpoint using a POST method: https://salesapi.caspeco.net/api/kpi/salesforecast
Data Specification
Section titled “Data Specification”The input body uses of two structures, ForecastBody and SalesForecastDTO.
ForecastBody
Section titled “ForecastBody”String OrgNr - Required - The organization number of the Company the forecast is related to. List<SalesForecastDTO> Forecasts - A list containing SalesForecastDTO objects
SalesForecastDTO
Section titled “SalesForecastDTO”StationID - Integer - Required - The Caspeco Station ID the forecast is to be mapped towards. ForecastValue - Double - Required - A positivt numeric value. Up to 2 decimal points in accuarcy. Timestamp - String - Required - A timestamp for the relevant time for the forecast, format yyyy-MM-dd’T’HH:mm:ss. The timestamp should be provided in local time to the timezone the company is located in. Hourly - Boolean - Optional - If set to true the Forecast will be an hourly forecast rather than the default daily. If this value is not provided the forecast will be treated as a Daily forecast.
Example:
{ "OrgNr": "19551114-5555", "Forecasts": [ { "StationID":1, "ForecastValue": 123.45, "Timestamp": "2025-03-21T11:00:00", "Hourly": true } ]}Note on StationID
Section titled “Note on StationID”This corresponds to a subsection of a company within the Caspeco structure. At this time we are not able to export a mapping of this structure. You will need to create a mapping of this structure together with the Customer’s Caspeco configuration. The ID’s can be found in the Organization Tree view in Caspeco Cloud.