{
 "openapi": "3.1.0",
 "info": {
  "title": "Demand Signals (Supply Chain)",
  "version": "20261030b",
  "description": "Demand that is not a forecast: a signed order, a likely quotation, a weighted opportunity, a dependent requirement. One place for a planning run to read demand from, and it can say where every unit came from."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "demand-signals": {
    "type": "object",
    "required": [
     "item_id",
     "required_on"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "item_id": {
      "type": "string",
      "format": "uuid",
      "description": "Item"
     },
     "warehouse_id": {
      "type": "string",
      "format": "uuid",
      "description": "Warehouse"
     },
     "location_id": {
      "type": "string",
      "format": "uuid",
      "description": "Location id"
     },
     "signal_type": {
      "type": "string",
      "description": "Kind",
      "enum": [
       "sales_order",
       "quotation",
       "opportunity",
       "forecast",
       "safety_stock",
       "dependent",
       "transfer",
       "service",
       "sample",
       "contract",
       "manual"
      ]
     },
     "sales_order_id": {
      "type": "string",
      "format": "uuid",
      "description": "Sales order"
     },
     "quotation_id": {
      "type": "string",
      "format": "uuid",
      "description": "Quotation"
     },
     "opportunity_id": {
      "type": "string",
      "format": "uuid",
      "description": "Opportunity"
     },
     "production_order_id": {
      "type": "string",
      "format": "uuid",
      "description": "Production order id"
     },
     "demand_plan_id": {
      "type": "string",
      "format": "uuid",
      "description": "Demand plan id"
     },
     "account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Customer"
     },
     "reference_no": {
      "type": "string",
      "description": "Reference"
     },
     "required_on": {
      "type": "string",
      "format": "date",
      "description": "Wanted on"
     },
     "quantity": {
      "type": "string",
      "format": "decimal",
      "description": "Quantity"
     },
     "uom_id": {
      "type": "string",
      "format": "uuid",
      "description": "Unit"
     },
     "quantity_committed": {
      "type": "string",
      "format": "decimal",
      "description": "Quantity committed",
      "readOnly": true
     },
     "probability_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Probability %"
     },
     "weighted_quantity": {
      "type": "string",
      "format": "decimal",
      "description": "Weighted quantity",
      "readOnly": true
     },
     "priority": {
      "type": "integer",
      "description": "Priority"
     },
     "is_firm": {
      "type": "boolean",
      "description": "Firm"
     },
     "consumes_forecast": {
      "type": "boolean",
      "description": "Consumes the forecast"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "enum": [
       "open",
       "planned",
       "committed",
       "fulfilled",
       "cancelled",
       "expired"
      ]
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "source_line_id": {
      "type": "string",
      "format": "uuid",
      "description": "Source line id",
      "readOnly": true
     },
     "config_id": {
      "type": "string",
      "format": "uuid",
      "description": "Config id",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/scm/demand-signals": {
   "get": {
    "summary": "list demand-signals",
    "operationId": "list_demand_signals_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create demand-signals",
    "operationId": "create_demand_signals_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/demand-signals/{id}": {
   "get": {
    "summary": "get demand-signals",
    "operationId": "get_demand_signals_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change demand-signals",
    "operationId": "change_demand_signals_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete demand-signals",
    "operationId": "delete_demand_signals_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/demand-signals/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_demand_signals_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/demand-signals/collect": {
   "post": {
    "summary": "Collect",
    "operationId": "action_demand_signals_0_5",
    "description": "Body keys: horizonDays, includeQuotations, warehouseId",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}