---
title: Demand Forecast Inventory
slug: fourkites-api-reference/demand-forecast-inventory
icon: {"apiMethod":"POST"}
createdAt: 2025-10-27T12:57:00.000Z
---

The Demand Forecast Ingestion API receives demand forecasts from WMS forecasting systems and feeds the event-driven inventory processing pipeline. Submissions are accepted asynchronously: the API acknowledges receipt and returns a `request_id`, then validates and processes the payload downstream.

:::hint{type="warning"}
A 202 confirms receipt, not validity. Every rule below is applied after the response is returned. Points that fail are recorded in FourKites service logs only — no error reaches the caller, and there is no callback today. To confirm a forecast landed, read it back through the inventory projection APIs.
:::

### Validation Rules

Two groups, and the difference matters: the first discards everything you sent, the second discards only the point at fault.

**Whole submission is rejected — nothing is stored:**

- `forecasts` is missing or empty
- `forecasts` contains more than 500 entries
- any `forecastData` contains more than 500 points
- any date is not in `YYYY-MM-DD` format

**Only the offending point or entry is rejected — everything else is stored:**

- `forecastData` is missing or empty — that entry only
- `productId` or `facilityId` missing, or over 100 characters
- `quantityUom` over 10 characters
- `date` missing on a point
- `quantity` missing, or negative
- the same date appears twice in one `forecastData` array

**Why the split.** A size breach or an unreadable date is a fault in how the submission was built, so the whole submission is refused before any of it is stored. Everything else is a fault in one row, so only that row is dropped.

Neither is reported back to you. Both are recorded in FourKites service logs against the `request_id`.

### Date format

Dates must be `YYYY-MM-DD`, for example `2026-09-02`. Other formats — `09/02/2026`, `2026-9-2`, `02-Sep-2026` — are not accepted, and a single one of them discards the entire submission.

An absent date is different: that point alone is rejected and its siblings are stored normally.

### Processing granularity

Daily or weekly handling is taken from your company's demand forecast configuration, not from the request. Dates are stored exactly as submitted; the API does not snap them to week starts or redistribute them. Where no configuration exists, forecasts are stored as daily and the quantity is taken as given rather than spread.

:::ApiMethodV2
```json
{
  "name": "Production",
  "method": "POST",
  "url": "https://api.fourkites.com/api/v1/async/forecast/demand",
  "description": "",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "p_tLnus26PSC7W2xVExtm",
        "language": "curl",
        "code": "curl --location 'https://api.fourkites.com/api/v1/async/forecast/demand' \\\n--header 'Content-Type: application/json' \\\n--header 'apikey: APIKEY' \\\n--data '{\n  \"messageId\": \"FCT-DEMAND-2026-09-01-001\",\n  \"forecasts\": [\n    {\n      \"productId\": \"WIRE-BEL-COA-001\",\n      \"facilityId\": \"442344\",\n      \"quantityUom\": \"EA\",\n      \"forecastData\": [\n        {\n          \"date\": \"2026-09-02\",\n          \"quantity\": 12.0\n        },\n        {\n          \"date\": \"2026-09-03\",\n          \"quantity\": 30.0\n        },\n        {\n          \"date\": \"2026-09-04\",\n          \"quantity\": 25.0\n        }\n      ],\n      \"referenceAttributes\": {\n        \"forecastModel\": \"ML_DEMAND_PREDICTOR_V2\",\n        \"customerSegment\": \"RETAIL\",\n        \"channel\": \"B2B\",\n        \"dataSource\": \"WMS_DEMAND_ENGINE\"\n      }\n    }\n  ]\n}'",
        "customLabel": ""
      },
      {
        "id": "AWA9XugNSl-Gyvf5zivJd",
        "language": "java",
        "code": "OkHttpClient client = new OkHttpClient().newBuilder()\n  .build();\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\n  \\\"messageId\\\": \\\"FCT-DEMAND-2026-09-01-001\\\",\\n  \\\"forecasts\\\": [\\n    {\\n      \\\"productId\\\": \\\"WIRE-BEL-COA-001\\\",\\n      \\\"facilityId\\\": \\\"442344\\\",\\n      \\\"quantityUom\\\": \\\"EA\\\",\\n      \\\"forecastData\\\": [\\n        {\\n          \\\"date\\\": \\\"2026-09-02\\\",\\n          \\\"quantity\\\": 12.0\\n        },\\n        {\\n          \\\"date\\\": \\\"2026-09-03\\\",\\n          \\\"quantity\\\": 30.0\\n        },\\n        {\\n          \\\"date\\\": \\\"2026-09-04\\\",\\n          \\\"quantity\\\": 25.0\\n        }\\n      ],\\n      \\\"referenceAttributes\\\": {\\n        \\\"forecastModel\\\": \\\"ML_DEMAND_PREDICTOR_V2\\\",\\n        \\\"customerSegment\\\": \\\"RETAIL\\\",\\n        \\\"channel\\\": \\\"B2B\\\",\\n        \\\"forecastAccuracy\\\": 0.92,\\n        \\\"demandPattern\\\": \\\"STABLE\\\",\\n        \\\"lastModelUpdate\\\": \\\"2024-07-25T09:00:00Z\\\",\\n        \\\"dataSource\\\": \\\"WMS_DEMAND_ENGINE\\\",\\n        \\\"seasonalityImpact\\\": \\\"HIGH\\\",\\n        \\\"promotionalLift\\\": 1.15,\\n        \\\"marketTrend\\\": \\\"GROWING\\\",\\n        \\\"customerTier\\\": \\\"PREMIUM\\\"\\n      }\\n    }\\n  ]\\n}\");\nRequest request = new Request.Builder()\n  .url(\"https://api.fourkites.com/api/v1/async/forecast/demand\")\n  .method(\"POST\", body)\n  .addHeader(\"Content-Type\", \"application/json\")\n  .addHeader(\"apikey\", \"APIKEY\")\n  .build();\nResponse response = client.newCall(request).execute();",
        "customLabel": ""
      },
      {
        "id": "wVL2kO6hKApaTtkFgtaEz",
        "language": "javascript",
        "code": "var settings = {\n  \"url\": \"https://api.fourkites.com/api/v1/async/forecast/demand\",\n  \"method\": \"POST\",\n  \"timeout\": 0,\n  \"headers\": {\n    \"Content-Type\": \"application/json\",\n    \"apikey\": \"APIKEY\"\n  },\n  \"data\": JSON.stringify({\n    \"messageId\": \"FCT-DEMAND-2026-09-01-001\",\n    \"forecasts\": [\n      {\n        \"productId\": \"WIRE-BEL-COA-001\",\n        \"facilityId\": \"442344\",\n        \"quantityUom\": \"EA\",\n        \"forecastData\": [\n          {\n            \"date\": \"2026-09-02\",\n            \"quantity\": 12\n          },\n          {\n            \"date\": \"2026-09-03\",\n            \"quantity\": 30\n          },\n          {\n            \"date\": \"2026-09-04\",\n            \"quantity\": 25\n          }\n        ],\n        \"referenceAttributes\": {\n          \"forecastModel\": \"ML_DEMAND_PREDICTOR_V2\",\n          \"customerSegment\": \"RETAIL\",\n          \"channel\": \"B2B\",\n          \"forecastAccuracy\": 0.92,\n          \"demandPattern\": \"STABLE\",\n          \"lastModelUpdate\": \"2024-07-25T09:00:00Z\",\n          \"dataSource\": \"WMS_DEMAND_ENGINE\",\n          \"seasonalityImpact\": \"HIGH\",\n          \"promotionalLift\": 1.15,\n          \"marketTrend\": \"GROWING\",\n          \"customerTier\": \"PREMIUM\"\n        }\n      }\n    ]\n  }),\n};\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});",
        "customLabel": ""
      },
      {
        "id": "3Wuya4leCO5KC1aa4azgG",
        "language": "swift",
        "code": "let parameters = \"{\\n  \\\"messageId\\\": \\\"FCT-DEMAND-2026-09-01-001\\\",\\n  \\\"forecasts\\\": [\\n    {\\n      \\\"productId\\\": \\\"WIRE-BEL-COA-001\\\",\\n      \\\"facilityId\\\": \\\"442344\\\",\\n      \\\"quantityUom\\\": \\\"EA\\\",\\n      \\\"forecastData\\\": [\\n        {\\n          \\\"date\\\": \\\"2026-09-02\\\",\\n          \\\"quantity\\\": 12.0\\n        },\\n        {\\n          \\\"date\\\": \\\"2026-09-03\\\",\\n          \\\"quantity\\\": 30.0\\n        },\\n        {\\n          \\\"date\\\": \\\"2026-09-04\\\",\\n          \\\"quantity\\\": 25.0\\n        }\\n      ],\\n      \\\"referenceAttributes\\\": {\\n        \\\"forecastModel\\\": \\\"ML_DEMAND_PREDICTOR_V2\\\",\\n        \\\"customerSegment\\\": \\\"RETAIL\\\",\\n        \\\"channel\\\": \\\"B2B\\\",\\n        \\\"forecastAccuracy\\\": 0.92,\\n        \\\"demandPattern\\\": \\\"STABLE\\\",\\n        \\\"lastModelUpdate\\\": \\\"2024-07-25T09:00:00Z\\\",\\n        \\\"dataSource\\\": \\\"WMS_DEMAND_ENGINE\\\",\\n        \\\"seasonalityImpact\\\": \\\"HIGH\\\",\\n        \\\"promotionalLift\\\": 1.15,\\n        \\\"marketTrend\\\": \\\"GROWING\\\",\\n        \\\"customerTier\\\": \\\"PREMIUM\\\"\\n      }\\n    }\\n  ]\\n}\"\nlet postData = parameters.data(using: .utf8)\n\nvar request = URLRequest(url: URL(string: \"https://api.fourkites.com/api/v1/async/forecast/demand\")!,timeoutInterval: Double.infinity)\nrequest.addValue(\"application/json\", forHTTPHeaderField: \"Content-Type\")\nrequest.addValue(\"APIKEY\", forHTTPHeaderField: \"apikey\")\n\nrequest.httpMethod = \"POST\"\nrequest.httpBody = postData\n\nlet task = URLSession.shared.dataTask(with: request) { data, response, error in \n  guard let data = data else {\n    print(String(describing: error))\n    return\n  }\n  print(String(data: data, encoding: .utf8)!)\n}\n\ntask.resume()\n",
        "customLabel": ""
      },
      {
        "id": "l-KEj4_5AfRGctRuo2vgZ",
        "language": "csharp",
        "code": "var client = new HttpClient();\nvar request = new HttpRequestMessage(HttpMethod.Post, \"https://api.fourkites.com/api/v1/async/forecast/demand\");\nrequest.Headers.Add(\"apikey\", \"APIKEY\");\nvar content = new StringContent(\"{\\n  \\\"messageId\\\": \\\"FCT-DEMAND-2026-09-01-001\\\",\\n  \\\"forecasts\\\": [\\n    {\\n      \\\"productId\\\": \\\"WIRE-BEL-COA-001\\\",\\n      \\\"facilityId\\\": \\\"442344\\\",\\n      \\\"quantityUom\\\": \\\"EA\\\",\\n      \\\"forecastData\\\": [\\n        {\\n          \\\"date\\\": \\\"2026-09-02\\\",\\n          \\\"quantity\\\": 12.0\\n        },\\n        {\\n          \\\"date\\\": \\\"2026-09-03\\\",\\n          \\\"quantity\\\": 30.0\\n        },\\n        {\\n          \\\"date\\\": \\\"2026-09-04\\\",\\n          \\\"quantity\\\": 25.0\\n        }\\n      ],\\n      \\\"referenceAttributes\\\": {\\n        \\\"forecastModel\\\": \\\"ML_DEMAND_PREDICTOR_V2\\\",\\n        \\\"customerSegment\\\": \\\"RETAIL\\\",\\n        \\\"channel\\\": \\\"B2B\\\",\\n        \\\"forecastAccuracy\\\": 0.92,\\n        \\\"demandPattern\\\": \\\"STABLE\\\",\\n        \\\"lastModelUpdate\\\": \\\"2024-07-25T09:00:00Z\\\",\\n        \\\"dataSource\\\": \\\"WMS_DEMAND_ENGINE\\\",\\n        \\\"seasonalityImpact\\\": \\\"HIGH\\\",\\n        \\\"promotionalLift\\\": 1.15,\\n        \\\"marketTrend\\\": \\\"GROWING\\\",\\n        \\\"customerTier\\\": \\\"PREMIUM\\\"\\n      }\\n    }\\n  ]\\n}\", null, \"application/json\");\nrequest.Content = content;\nvar response = await client.SendAsync(request);\nresponse.EnsureSuccessStatusCode();\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\n",
        "customLabel": ""
      },
      {
        "id": "u-nJ2l047iuJZyBdtpyql",
        "language": "go",
        "code": "package main\n\nimport (\n  \"fmt\"\n  \"strings\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n\n  url := \"https://api.fourkites.com/api/v1/async/forecast/demand\"\n  method := \"POST\"\n\n  payload := strings.NewReader(`{\n  \"messageId\": \"FCT-DEMAND-2026-09-01-001\",\n  \"forecasts\": [\n    {\n      \"productId\": \"WIRE-BEL-COA-001\",\n      \"facilityId\": \"442344\",\n      \"quantityUom\": \"EA\",\n      \"forecastData\": [\n        {\n          \"date\": \"2026-09-02\",\n          \"quantity\": 12.0\n        },\n        {\n          \"date\": \"2026-09-03\",\n          \"quantity\": 30.0\n        },\n        {\n          \"date\": \"2026-09-04\",\n          \"quantity\": 25.0\n        }\n      ],\n      \"referenceAttributes\": {\n        \"forecastModel\": \"ML_DEMAND_PREDICTOR_V2\",\n        \"customerSegment\": \"RETAIL\",\n        \"channel\": \"B2B\",\n        \"forecastAccuracy\": 0.92,\n        \"demandPattern\": \"STABLE\",\n        \"lastModelUpdate\": \"2024-07-25T09:00:00Z\",\n        \"dataSource\": \"WMS_DEMAND_ENGINE\",\n        \"seasonalityImpact\": \"HIGH\",\n        \"promotionalLift\": 1.15,\n        \"marketTrend\": \"GROWING\",\n        \"customerTier\": \"PREMIUM\"\n      }\n    }\n  ]\n}`)\n\n  client := &http.Client {\n  }\n  req, err := http.NewRequest(method, url, payload)\n\n  if err != nil {\n    fmt.Println(err)\n    return\n  }\n  req.Header.Add(\"Content-Type\", \"application/json\")\n  req.Header.Add(\"apikey\", \"APIKEY\")\n\n  res, err := client.Do(req)\n  if err != nil {\n    fmt.Println(err)\n    return\n  }\n  defer res.Body.Close()\n\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    fmt.Println(err)\n    return\n  }\n  fmt.Println(string(body))\n}",
        "customLabel": ""
      },
      {
        "id": "YRw_5ti6xrKCl1W8hdCkW",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fourkites.com/api/v1/async/forecast/demand\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"Content-Type\"] = \"application/json\"\nrequest[\"apikey\"] = \"APIKEY\"\nrequest.body = JSON.dump({\n  \"messageId\": \"FCT-DEMAND-2026-09-01-001\",\n  \"forecasts\": [\n    {\n      \"productId\": \"WIRE-BEL-COA-001\",\n      \"facilityId\": \"442344\",\n      \"quantityUom\": \"EA\",\n      \"forecastData\": [\n        {\n          \"date\": \"2026-09-02\",\n          \"quantity\": 12\n        },\n        {\n          \"date\": \"2026-09-03\",\n          \"quantity\": 30\n        },\n        {\n          \"date\": \"2026-09-04\",\n          \"quantity\": 25\n        }\n      ],\n      \"referenceAttributes\": {\n        \"forecastModel\": \"ML_DEMAND_PREDICTOR_V2\",\n        \"customerSegment\": \"RETAIL\",\n        \"channel\": \"B2B\",\n        \"forecastAccuracy\": 0.92,\n        \"demandPattern\": \"STABLE\",\n        \"lastModelUpdate\": \"2024-07-25T09:00:00Z\",\n        \"dataSource\": \"WMS_DEMAND_ENGINE\",\n        \"seasonalityImpact\": \"HIGH\",\n        \"promotionalLift\": 1.15,\n        \"marketTrend\": \"GROWING\",\n        \"customerTier\": \"PREMIUM\"\n      }\n    }\n  ]\n})\n\nresponse = https.request(request)\nputs response.read_body\n",
        "customLabel": ""
      },
      {
        "id": "h04TI7Do69eoE6SZ_yGUv",
        "language": "python",
        "code": "import http.client\nimport json\n\nconn = http.client.HTTPSConnection(\"api.fourkites.com\")\npayload = json.dumps({\n  \"messageId\": \"FCT-DEMAND-2026-09-01-001\",\n  \"forecasts\": [\n    {\n      \"productId\": \"WIRE-BEL-COA-001\",\n      \"facilityId\": \"442344\",\n      \"quantityUom\": \"EA\",\n      \"forecastData\": [\n        {\n          \"date\": \"2026-09-02\",\n          \"quantity\": 12\n        },\n        {\n          \"date\": \"2026-09-03\",\n          \"quantity\": 30\n        },\n        {\n          \"date\": \"2026-09-04\",\n          \"quantity\": 25\n        }\n      ],\n      \"referenceAttributes\": {\n        \"forecastModel\": \"ML_DEMAND_PREDICTOR_V2\",\n        \"customerSegment\": \"RETAIL\",\n        \"channel\": \"B2B\",\n        \"forecastAccuracy\": 0.92,\n        \"demandPattern\": \"STABLE\",\n        \"lastModelUpdate\": \"2024-07-25T09:00:00Z\",\n        \"dataSource\": \"WMS_DEMAND_ENGINE\",\n        \"seasonalityImpact\": \"HIGH\",\n        \"promotionalLift\": 1.15,\n        \"marketTrend\": \"GROWING\",\n        \"customerTier\": \"PREMIUM\"\n      }\n    }\n  ]\n})\nheaders = {\n  'Content-Type': 'application/json',\n  'apikey': 'APIKEY'\n}\nconn.request(\"POST\", \"/api/v1/async/forecast/demand\", payload, headers)\nres = conn.getresponse()\ndata = res.read()\nprint(data.decode(\"utf-8\"))",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "p_tLnus26PSC7W2xVExtm"
  },
  "results": {
    "languages": [
      {
        "id": "YunrEbqR9XMZFGA-29gMJ",
        "language": "202",
        "code": "{\n  \"request_id\": \"FCT-DEMAND-2026-09-01-001\"\n}",
        "customLabel": ""
      },
      {
        "id": "oZOQ0p2BSHwGIr5azc8sE",
        "language": "401",
        "code": "{\n  \"error_message\": \"Unauthorized access.\"\n}",
        "customLabel": ""
      },
      {
        "id": "XZYa9rJaomoAlIjuLcDUK",
        "language": "500",
        "code": "{\n  \"request_id\": \"FCT-DEMAND-2026-09-01-001\",\n  \"error_message\": \"Failed to process demand forecast data.\"\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "YunrEbqR9XMZFGA-29gMJ"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "name": "message_id",
        "kind": "optional",
        "type": "string",
        "description": "Correlation identifier returned as request_id. Falls back to the body's messageId, then to a generated identifier."
      },
      {
        "name": "company_id",
        "kind": "optional",
        "type": "string",
        "description": "Resolved from your API key when omitted. Most callers should omit it."
      }
    ],
    "headerParameters": [
      {
        "name": "Content-Type",
        "kind": "required",
        "type": "string",
        "description": "application/json"
      },
      {
        "name": "apikey",
        "kind": "required",
        "type": "string",
        "description": "Your API key. Determines the company the forecast is stored against."
      }
    ],
    "bodyDataParameters": [
      {
        "name": "messageId",
        "kind": "optional",
        "type": "string",
        "description": "Message identifier, used as the request_id fallback. Not checked for uniqueness and does not deduplicate submissions."
      },
      {
        "name": "forecasts",
        "kind": "required",
        "type": "object",
        "description": "Forecast entries, one per product-facility combination. At least 1, at most 500. Exceeding 500 discards the whole submission.",
        "children": [
          {
            "name": "productId",
            "kind": "required",
            "type": "string",
            "description": "Product identifier (maps to primary_product_id). Max 100 characters."
          },
          {
            "name": "facilityId",
            "kind": "required",
            "type": "string",
            "description": "Facility identifier (maps to facility_id). Max 100 characters."
          },
          {
            "name": "quantityUom",
            "kind": "optional",
            "type": "string",
            "description": "Unit of measure, for example \"EA\", \"CS\", \"KG\", \"LB\". Max 10 characters. Stored exactly as sent — no default is applied. Empty string, \"NA\" and \"N/A\" are treated as not supplied."
          },
          {
            "name": "forecastData",
            "kind": "required",
            "type": "object",
            "description": "Forecast points for this product-facility combination. At least 1, at most 500. Exceeding 500 discards the whole submission; an empty or missing array rejects this entry only.",
            "children": [
              {
                "name": "date",
                "kind": "required",
                "type": "string",
                "description": "Forecast date, YYYY-MM-DD. Must be unique within this forecastData array. A date in any other format causes the entire submission to be discarded — see Date format above."
              },
              {
                "name": "quantity",
                "kind": "required",
                "type": "number",
                "description": "Forecasted demand quantity. Must be ≥ 0 — see How demand affects projected inventory above."
              }
            ]
          },
          {
            "name": "referenceAttributes",
            "kind": "optional",
            "type": "object",
            "description": "Additional demand forecast metadata. Stored as submitted and not interpreted."
          }
        ],
        "schema": [
          {
            "name": "productId",
            "kind": "required",
            "type": "string",
            "description": "Product identifier (maps to primary_product_id). Max 100 characters."
          },
          {
            "name": "facilityId",
            "kind": "required",
            "type": "string",
            "description": "Facility identifier (maps to facility_id). Max 100 characters."
          },
          {
            "name": "quantityUom",
            "kind": "optional",
            "type": "string",
            "description": "Unit of measure, for example \"EA\", \"CS\", \"KG\", \"LB\". Max 10 characters. Stored exactly as sent — no default is applied. Empty string, \"NA\" and \"N/A\" are treated as not supplied."
          },
          {
            "name": "forecastData",
            "kind": "required",
            "type": "object",
            "description": "Forecast points for this product-facility combination. At least 1, at most 500. Exceeding 500 discards the whole submission; an empty or missing array rejects this entry only.",
            "children": [
              {
                "name": "date",
                "kind": "required",
                "type": "string",
                "description": "Forecast date, YYYY-MM-DD. Must be unique within this forecastData array. A date in any other format causes the entire submission to be discarded — see Date format above."
              },
              {
                "name": "quantity",
                "kind": "required",
                "type": "number",
                "description": "Forecasted demand quantity. Must be ≥ 0 — see How demand affects projected inventory above."
              }
            ]
          },
          {
            "name": "referenceAttributes",
            "kind": "optional",
            "type": "object",
            "description": "Additional demand forecast metadata. Stored as submitted and not interpreted."
          }
        ]
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "production",
  "legacyHash": "Fr7HVURcoGvVT8E6xLi8e"
}
```
:::

:::ApiMethodV2
```json
{
  "name": "Staging",
  "method": "POST",
  "url": "https://api-staging.fourkites.com/api/v1/async/forecast/demand",
  "description": "",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "p_tLnus26PSC7W2xVExtm",
        "language": "curl",
        "code": "curl --location 'https://api-staging.fourkites.com/api/v1/async/forecast/demand' \\\n--header 'Content-Type: application/json' \\\n--header 'apikey: APIKEY' \\\n--data '{\n  \"messageId\": \"FCT-DEMAND-2026-09-01-001\",\n  \"forecasts\": [\n    {\n      \"productId\": \"WIRE-BEL-COA-001\",\n      \"facilityId\": \"442344\",\n      \"quantityUom\": \"EA\",\n      \"forecastData\": [\n        {\n          \"date\": \"2026-09-02\",\n          \"quantity\": 12.0\n        },\n        {\n          \"date\": \"2026-09-03\",\n          \"quantity\": 30.0\n        },\n        {\n          \"date\": \"2026-09-04\",\n          \"quantity\": 25.0\n        }\n      ],\n      \"referenceAttributes\": {\n        \"forecastModel\": \"ML_DEMAND_PREDICTOR_V2\",\n        \"customerSegment\": \"RETAIL\",\n        \"channel\": \"B2B\",\n        \"dataSource\": \"WMS_DEMAND_ENGINE\"\n      }\n    }\n  ]\n}'",
        "customLabel": ""
      },
      {
        "id": "AWA9XugNSl-Gyvf5zivJd",
        "language": "java",
        "code": "OkHttpClient client = new OkHttpClient().newBuilder()\n  .build();\nMediaType mediaType = MediaType.parse(\"application/json\");\nRequestBody body = RequestBody.create(mediaType, \"{\\n  \\\"messageId\\\": \\\"FCT-DEMAND-2026-09-01-001\\\",\\n  \\\"forecasts\\\": [\\n    {\\n      \\\"productId\\\": \\\"WIRE-BEL-COA-001\\\",\\n      \\\"facilityId\\\": \\\"442344\\\",\\n      \\\"quantityUom\\\": \\\"EA\\\",\\n      \\\"forecastData\\\": [\\n        {\\n          \\\"date\\\": \\\"2026-09-02\\\",\\n          \\\"quantity\\\": 12.0\\n        },\\n        {\\n          \\\"date\\\": \\\"2026-09-03\\\",\\n          \\\"quantity\\\": 30.0\\n        },\\n        {\\n          \\\"date\\\": \\\"2026-09-04\\\",\\n          \\\"quantity\\\": 25.0\\n        }\\n      ],\\n      \\\"referenceAttributes\\\": {\\n        \\\"forecastModel\\\": \\\"ML_DEMAND_PREDICTOR_V2\\\",\\n        \\\"customerSegment\\\": \\\"RETAIL\\\",\\n        \\\"channel\\\": \\\"B2B\\\",\\n        \\\"forecastAccuracy\\\": 0.92,\\n        \\\"demandPattern\\\": \\\"STABLE\\\",\\n        \\\"lastModelUpdate\\\": \\\"2024-07-25T09:00:00Z\\\",\\n        \\\"dataSource\\\": \\\"WMS_DEMAND_ENGINE\\\",\\n        \\\"seasonalityImpact\\\": \\\"HIGH\\\",\\n        \\\"promotionalLift\\\": 1.15,\\n        \\\"marketTrend\\\": \\\"GROWING\\\",\\n        \\\"customerTier\\\": \\\"PREMIUM\\\"\\n      }\\n    }\\n  ]\\n}\");\nRequest request = new Request.Builder()\n  .url(\"https://api-staging.fourkites.com/api/v1/async/forecast/demand\")\n  .method(\"POST\", body)\n  .addHeader(\"Content-Type\", \"application/json\")\n  .addHeader(\"apikey\", \"APIKEY\")\n  .build();\nResponse response = client.newCall(request).execute();",
        "customLabel": ""
      },
      {
        "id": "wVL2kO6hKApaTtkFgtaEz",
        "language": "javascript",
        "code": "var settings = {\n  \"url\": \"https://api-staging.fourkites.com/api/v1/async/forecast/demand\",\n  \"method\": \"POST\",\n  \"timeout\": 0,\n  \"headers\": {\n    \"Content-Type\": \"application/json\",\n    \"apikey\": \"APIKEY\"\n  },\n  \"data\": JSON.stringify({\n    \"messageId\": \"FCT-DEMAND-2026-09-01-001\",\n    \"forecasts\": [\n      {\n        \"productId\": \"WIRE-BEL-COA-001\",\n        \"facilityId\": \"442344\",\n        \"quantityUom\": \"EA\",\n        \"forecastData\": [\n          {\n            \"date\": \"2026-09-02\",\n            \"quantity\": 12\n          },\n          {\n            \"date\": \"2026-09-03\",\n            \"quantity\": 30\n          },\n          {\n            \"date\": \"2026-09-04\",\n            \"quantity\": 25\n          }\n        ],\n        \"referenceAttributes\": {\n          \"forecastModel\": \"ML_DEMAND_PREDICTOR_V2\",\n          \"customerSegment\": \"RETAIL\",\n          \"channel\": \"B2B\",\n          \"forecastAccuracy\": 0.92,\n          \"demandPattern\": \"STABLE\",\n          \"lastModelUpdate\": \"2024-07-25T09:00:00Z\",\n          \"dataSource\": \"WMS_DEMAND_ENGINE\",\n          \"seasonalityImpact\": \"HIGH\",\n          \"promotionalLift\": 1.15,\n          \"marketTrend\": \"GROWING\",\n          \"customerTier\": \"PREMIUM\"\n        }\n      }\n    ]\n  }),\n};\n\n$.ajax(settings).done(function (response) {\n  console.log(response);\n});",
        "customLabel": ""
      },
      {
        "id": "3Wuya4leCO5KC1aa4azgG",
        "language": "swift",
        "code": "let parameters = \"{\\n  \\\"messageId\\\": \\\"FCT-DEMAND-2026-09-01-001\\\",\\n  \\\"forecasts\\\": [\\n    {\\n      \\\"productId\\\": \\\"WIRE-BEL-COA-001\\\",\\n      \\\"facilityId\\\": \\\"442344\\\",\\n      \\\"quantityUom\\\": \\\"EA\\\",\\n      \\\"forecastData\\\": [\\n        {\\n          \\\"date\\\": \\\"2026-09-02\\\",\\n          \\\"quantity\\\": 12.0\\n        },\\n        {\\n          \\\"date\\\": \\\"2026-09-03\\\",\\n          \\\"quantity\\\": 30.0\\n        },\\n        {\\n          \\\"date\\\": \\\"2026-09-04\\\",\\n          \\\"quantity\\\": 25.0\\n        }\\n      ],\\n      \\\"referenceAttributes\\\": {\\n        \\\"forecastModel\\\": \\\"ML_DEMAND_PREDICTOR_V2\\\",\\n        \\\"customerSegment\\\": \\\"RETAIL\\\",\\n        \\\"channel\\\": \\\"B2B\\\",\\n        \\\"forecastAccuracy\\\": 0.92,\\n        \\\"demandPattern\\\": \\\"STABLE\\\",\\n        \\\"lastModelUpdate\\\": \\\"2024-07-25T09:00:00Z\\\",\\n        \\\"dataSource\\\": \\\"WMS_DEMAND_ENGINE\\\",\\n        \\\"seasonalityImpact\\\": \\\"HIGH\\\",\\n        \\\"promotionalLift\\\": 1.15,\\n        \\\"marketTrend\\\": \\\"GROWING\\\",\\n        \\\"customerTier\\\": \\\"PREMIUM\\\"\\n      }\\n    }\\n  ]\\n}\"\nlet postData = parameters.data(using: .utf8)\n\nvar request = URLRequest(url: URL(string: \"https://api-staging.fourkites.com/api/v1/async/forecast/demand\")!,timeoutInterval: Double.infinity)\nrequest.addValue(\"application/json\", forHTTPHeaderField: \"Content-Type\")\nrequest.addValue(\"APIKEY\", forHTTPHeaderField: \"apikey\")\n\nrequest.httpMethod = \"POST\"\nrequest.httpBody = postData\n\nlet task = URLSession.shared.dataTask(with: request) { data, response, error in \n  guard let data = data else {\n    print(String(describing: error))\n    return\n  }\n  print(String(data: data, encoding: .utf8)!)\n}\n\ntask.resume()\n",
        "customLabel": ""
      },
      {
        "id": "l-KEj4_5AfRGctRuo2vgZ",
        "language": "csharp",
        "code": "var client = new HttpClient();\nvar request = new HttpRequestMessage(HttpMethod.Post, \"https://api-staging.fourkites.com/api/v1/async/forecast/demand\");\nrequest.Headers.Add(\"apikey\", \"APIKEY\");\nvar content = new StringContent(\"{\\n  \\\"messageId\\\": \\\"FCT-DEMAND-2026-09-01-001\\\",\\n  \\\"forecasts\\\": [\\n    {\\n      \\\"productId\\\": \\\"WIRE-BEL-COA-001\\\",\\n      \\\"facilityId\\\": \\\"442344\\\",\\n      \\\"quantityUom\\\": \\\"EA\\\",\\n      \\\"forecastData\\\": [\\n        {\\n          \\\"date\\\": \\\"2026-09-02\\\",\\n          \\\"quantity\\\": 12.0\\n        },\\n        {\\n          \\\"date\\\": \\\"2026-09-03\\\",\\n          \\\"quantity\\\": 30.0\\n        },\\n        {\\n          \\\"date\\\": \\\"2026-09-04\\\",\\n          \\\"quantity\\\": 25.0\\n        }\\n      ],\\n      \\\"referenceAttributes\\\": {\\n        \\\"forecastModel\\\": \\\"ML_DEMAND_PREDICTOR_V2\\\",\\n        \\\"customerSegment\\\": \\\"RETAIL\\\",\\n        \\\"channel\\\": \\\"B2B\\\",\\n        \\\"forecastAccuracy\\\": 0.92,\\n        \\\"demandPattern\\\": \\\"STABLE\\\",\\n        \\\"lastModelUpdate\\\": \\\"2024-07-25T09:00:00Z\\\",\\n        \\\"dataSource\\\": \\\"WMS_DEMAND_ENGINE\\\",\\n        \\\"seasonalityImpact\\\": \\\"HIGH\\\",\\n        \\\"promotionalLift\\\": 1.15,\\n        \\\"marketTrend\\\": \\\"GROWING\\\",\\n        \\\"customerTier\\\": \\\"PREMIUM\\\"\\n      }\\n    }\\n  ]\\n}\", null, \"application/json\");\nrequest.Content = content;\nvar response = await client.SendAsync(request);\nresponse.EnsureSuccessStatusCode();\nConsole.WriteLine(await response.Content.ReadAsStringAsync());\n",
        "customLabel": ""
      },
      {
        "id": "u-nJ2l047iuJZyBdtpyql",
        "language": "go",
        "code": "package main\n\nimport (\n  \"fmt\"\n  \"strings\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n\n  url := \"https://api-staging.fourkites.com/api/v1/async/forecast/demand\"\n  method := \"POST\"\n\n  payload := strings.NewReader(`{\n  \"messageId\": \"FCT-DEMAND-2026-09-01-001\",\n  \"forecasts\": [\n    {\n      \"productId\": \"WIRE-BEL-COA-001\",\n      \"facilityId\": \"442344\",\n      \"quantityUom\": \"EA\",\n      \"forecastData\": [\n        {\n          \"date\": \"2026-09-02\",\n          \"quantity\": 12.0\n        },\n        {\n          \"date\": \"2026-09-03\",\n          \"quantity\": 30.0\n        },\n        {\n          \"date\": \"2026-09-04\",\n          \"quantity\": 25.0\n        }\n      ],\n      \"referenceAttributes\": {\n        \"forecastModel\": \"ML_DEMAND_PREDICTOR_V2\",\n        \"customerSegment\": \"RETAIL\",\n        \"channel\": \"B2B\",\n        \"forecastAccuracy\": 0.92,\n        \"demandPattern\": \"STABLE\",\n        \"lastModelUpdate\": \"2024-07-25T09:00:00Z\",\n        \"dataSource\": \"WMS_DEMAND_ENGINE\",\n        \"seasonalityImpact\": \"HIGH\",\n        \"promotionalLift\": 1.15,\n        \"marketTrend\": \"GROWING\",\n        \"customerTier\": \"PREMIUM\"\n      }\n    }\n  ]\n}`)\n\n  client := &http.Client {\n  }\n  req, err := http.NewRequest(method, url, payload)\n\n  if err != nil {\n    fmt.Println(err)\n    return\n  }\n  req.Header.Add(\"Content-Type\", \"application/json\")\n  req.Header.Add(\"apikey\", \"APIKEY\")\n\n  res, err := client.Do(req)\n  if err != nil {\n    fmt.Println(err)\n    return\n  }\n  defer res.Body.Close()\n\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    fmt.Println(err)\n    return\n  }\n  fmt.Println(string(body))\n}",
        "customLabel": ""
      },
      {
        "id": "YRw_5ti6xrKCl1W8hdCkW",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api-staging.fourkites.com/api/v1/async/forecast/demand\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"Content-Type\"] = \"application/json\"\nrequest[\"apikey\"] = \"APIKEY\"\nrequest.body = JSON.dump({\n  \"messageId\": \"FCT-DEMAND-2026-09-01-001\",\n  \"forecasts\": [\n    {\n      \"productId\": \"WIRE-BEL-COA-001\",\n      \"facilityId\": \"442344\",\n      \"quantityUom\": \"EA\",\n      \"forecastData\": [\n        {\n          \"date\": \"2026-09-02\",\n          \"quantity\": 12\n        },\n        {\n          \"date\": \"2026-09-03\",\n          \"quantity\": 30\n        },\n        {\n          \"date\": \"2026-09-04\",\n          \"quantity\": 25\n        }\n      ],\n      \"referenceAttributes\": {\n        \"forecastModel\": \"ML_DEMAND_PREDICTOR_V2\",\n        \"customerSegment\": \"RETAIL\",\n        \"channel\": \"B2B\",\n        \"forecastAccuracy\": 0.92,\n        \"demandPattern\": \"STABLE\",\n        \"lastModelUpdate\": \"2024-07-25T09:00:00Z\",\n        \"dataSource\": \"WMS_DEMAND_ENGINE\",\n        \"seasonalityImpact\": \"HIGH\",\n        \"promotionalLift\": 1.15,\n        \"marketTrend\": \"GROWING\",\n        \"customerTier\": \"PREMIUM\"\n      }\n    }\n  ]\n})\n\nresponse = https.request(request)\nputs response.read_body\n",
        "customLabel": ""
      },
      {
        "id": "h04TI7Do69eoE6SZ_yGUv",
        "language": "python",
        "code": "import http.client\nimport json\n\nconn = http.client.HTTPSConnection(\"api-staging.fourkites.com\")\npayload = json.dumps({\n  \"messageId\": \"FCT-DEMAND-2026-09-01-001\",\n  \"forecasts\": [\n    {\n      \"productId\": \"WIRE-BEL-COA-001\",\n      \"facilityId\": \"442344\",\n      \"quantityUom\": \"EA\",\n      \"forecastData\": [\n        {\n          \"date\": \"2026-09-02\",\n          \"quantity\": 12\n        },\n        {\n          \"date\": \"2026-09-03\",\n          \"quantity\": 30\n        },\n        {\n          \"date\": \"2026-09-04\",\n          \"quantity\": 25\n        }\n      ],\n      \"referenceAttributes\": {\n        \"forecastModel\": \"ML_DEMAND_PREDICTOR_V2\",\n        \"customerSegment\": \"RETAIL\",\n        \"channel\": \"B2B\",\n        \"forecastAccuracy\": 0.92,\n        \"demandPattern\": \"STABLE\",\n        \"lastModelUpdate\": \"2024-07-25T09:00:00Z\",\n        \"dataSource\": \"WMS_DEMAND_ENGINE\",\n        \"seasonalityImpact\": \"HIGH\",\n        \"promotionalLift\": 1.15,\n        \"marketTrend\": \"GROWING\",\n        \"customerTier\": \"PREMIUM\"\n      }\n    }\n  ]\n})\nheaders = {\n  'Content-Type': 'application/json',\n  'apikey': 'APIKEY'\n}\nconn.request(\"POST\", \"/api/v1/async/forecast/demand\", payload, headers)\nres = conn.getresponse()\ndata = res.read()\nprint(data.decode(\"utf-8\"))",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "p_tLnus26PSC7W2xVExtm"
  },
  "results": {
    "languages": [
      {
        "id": "YunrEbqR9XMZFGA-29gMJ",
        "language": "202",
        "code": "{\n  \"request_id\": \"FCT-DEMAND-2026-09-01-001\"\n}",
        "customLabel": ""
      },
      {
        "id": "oZOQ0p2BSHwGIr5azc8sE",
        "language": "401",
        "code": "{\n  \"error_message\": \"Unauthorized access.\"\n}",
        "customLabel": ""
      },
      {
        "id": "XZYa9rJaomoAlIjuLcDUK",
        "language": "500",
        "code": "{\n  \"request_id\": \"FCT-DEMAND-2026-09-01-001\",\n  \"error_message\": \"Failed to process demand forecast data.\"\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "YunrEbqR9XMZFGA-29gMJ"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [
      {
        "name": "message_id",
        "kind": "optional",
        "type": "string",
        "description": "Correlation identifier returned as request_id. Falls back to the body's messageId, then to a generated identifier."
      },
      {
        "name": "company_id",
        "kind": "optional",
        "type": "string",
        "description": "Resolved from your API key when omitted. Most callers should omit it."
      }
    ],
    "headerParameters": [
      {
        "name": "Content-Type",
        "kind": "required",
        "type": "string",
        "description": "application/json"
      },
      {
        "name": "apikey",
        "kind": "required",
        "type": "string",
        "description": "Your API key. Determines the company the forecast is stored against."
      }
    ],
    "bodyDataParameters": [
      {
        "name": "messageId",
        "kind": "optional",
        "type": "string",
        "description": "Message identifier, used as the request_id fallback. Not checked for uniqueness and does not deduplicate submissions."
      },
      {
        "name": "forecasts",
        "kind": "required",
        "type": "object",
        "description": "Forecast entries, one per product-facility combination. At least 1, at most 500. Exceeding 500 discards the whole submission.",
        "children": [
          {
            "name": "productId",
            "kind": "required",
            "type": "string",
            "description": "Product identifier (maps to primary_product_id). Max 100 characters."
          },
          {
            "name": "facilityId",
            "kind": "required",
            "type": "string",
            "description": "Facility identifier (maps to facility_id). Max 100 characters."
          },
          {
            "name": "quantityUom",
            "kind": "optional",
            "type": "string",
            "description": "Unit of measure, for example \"EA\", \"CS\", \"KG\", \"LB\". Max 10 characters. Stored exactly as sent — no default is applied. Empty string, \"NA\" and \"N/A\" are treated as not supplied."
          },
          {
            "name": "forecastData",
            "kind": "required",
            "type": "object",
            "description": "Forecast points for this product-facility combination. At least 1, at most 500. Exceeding 500 discards the whole submission; an empty or missing array rejects this entry only.",
            "children": [
              {
                "name": "date",
                "kind": "required",
                "type": "string",
                "description": "Forecast date, YYYY-MM-DD. Must be unique within this forecastData array. A date in any other format causes the entire submission to be discarded — see Date format above."
              },
              {
                "name": "quantity",
                "kind": "required",
                "type": "number",
                "description": "Forecasted demand quantity. Must be ≥ 0 — see How demand affects projected inventory above."
              }
            ]
          },
          {
            "name": "referenceAttributes",
            "kind": "optional",
            "type": "object",
            "description": "Additional demand forecast metadata. Stored as submitted and not interpreted."
          }
        ],
        "schema": [
          {
            "name": "productId",
            "kind": "required",
            "type": "string",
            "description": "Product identifier (maps to primary_product_id). Max 100 characters."
          },
          {
            "name": "facilityId",
            "kind": "required",
            "type": "string",
            "description": "Facility identifier (maps to facility_id). Max 100 characters."
          },
          {
            "name": "quantityUom",
            "kind": "optional",
            "type": "string",
            "description": "Unit of measure, for example \"EA\", \"CS\", \"KG\", \"LB\". Max 10 characters. Stored exactly as sent — no default is applied. Empty string, \"NA\" and \"N/A\" are treated as not supplied."
          },
          {
            "name": "forecastData",
            "kind": "required",
            "type": "object",
            "description": "Forecast points for this product-facility combination. At least 1, at most 500. Exceeding 500 discards the whole submission; an empty or missing array rejects this entry only.",
            "children": [
              {
                "name": "date",
                "kind": "required",
                "type": "string",
                "description": "Forecast date, YYYY-MM-DD. Must be unique within this forecastData array. A date in any other format causes the entire submission to be discarded — see Date format above."
              },
              {
                "name": "quantity",
                "kind": "required",
                "type": "number",
                "description": "Forecasted demand quantity. Must be ≥ 0 — see How demand affects projected inventory above."
              }
            ]
          },
          {
            "name": "referenceAttributes",
            "kind": "optional",
            "type": "object",
            "description": "Additional demand forecast metadata. Stored as submitted and not interpreted."
          }
        ]
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  },
  "hasTryItOut": false,
  "autoGeneratedAnchorSlug": "staging",
  "legacyHash": "ELaJmvIu41oCyitN1eKQg"
}
```
:::

There is no 400 response for a malformed forecast on this endpoint, and no `errors` array. Body-level problems are detected downstream, after the 202 has been returned.
