Responses
{
"200": {
"content": {
"application/json": {
"schema": {
"properties": {
"analysis_job_id": {
"type": "string"
},
"classification": {
"type": "object"
},
"customer_trend": {
"description": "Customer demand trend for this SKU: latest 30 days versus previous 30 days, anchored to the latest sale date in tenant data.",
"properties": {
"as_of_date": {
"format": "date",
"nullable": true,
"type": "string"
},
"current_from": {
"format": "date",
"nullable": true,
"type": "string"
},
"current_order_count": {
"type": "integer"
},
"current_quantity": {
"type": "number"
},
"current_to": {
"format": "date",
"nullable": true,
"type": "string"
},
"current_unique_customers": {
"type": "integer"
},
"current_value": {
"type": "number"
},
"delta_customers": {
"type": "integer"
},
"delta_pct": {
"nullable": true,
"type": "number"
},
"previous_from": {
"format": "date",
"nullable": true,
"type": "string"
},
"previous_order_count": {
"type": "integer"
},
"previous_quantity": {
"type": "number"
},
"previous_to": {
"format": "date",
"nullable": true,
"type": "string"
},
"previous_unique_customers": {
"type": "integer"
},
"previous_value": {
"type": "number"
},
"trend": {
"enum": [
"growing",
"stable",
"declining",
"new",
"none"
],
"type": "string"
},
"window_days": {
"example": 30,
"type": "integer"
}
},
"type": "object"
},
"customers": {
"items": {
"type": "object"
},
"type": "array"
},
"external_ref": {
"description": "Supplementary ERP cross-reference (e.g. REF).",
"nullable": true,
"type": "string"
},
"forecast": {
"nullable": true,
"type": "object"
},
"history_weekly": {
"items": {
"type": "object"
},
"type": "array"
},
"product_name": {
"nullable": true,
"type": "string"
},
"recommendation": {
"nullable": true,
"type": "object"
},
"sku": {
"description": "Canonical SKU resolved from the request.",
"type": "string"
},
"sku_reference_mappings": {
"description": "Reference changes related to this SKU. Used by the dashboard to mark the change point and by analysis runs to merge old history before forecast.",
"items": {
"properties": {
"effective_date": {
"format": "date",
"type": "string"
},
"new_sku": {
"type": "string"
},
"old_sku": {
"type": "string"
},
"reason": {
"nullable": true,
"type": "string"
}
},
"type": "object"
},
"type": "array"
},
"stock_snapshots": {
"items": {
"type": "object"
},
"type": "array"
}
},
"type": "object"
}
}
},
"description": "Success"
},
"401": {
"description": "Unauthorized - missing or invalid API key"
},
"403": {
"description": "Forbidden - missing required scope"
},
"429": {
"description": "Rate limit exceeded"
},
"500": {
"description": "Internal server error"
}
}