{
 "openapi": "3.1.0",
 "info": {
  "title": "Item · Planning (Supply Chain)",
  "version": "20261030b",
  "description": "How supply is decided and how demand is read — both sides in one row, because the planning run reads them together."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "item-planning": {
    "type": "object",
    "required": [
     "item_id"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "item_id": {
      "type": "string",
      "format": "uuid",
      "description": "Item"
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Applies in"
     },
     "planning_method": {
      "type": "string",
      "description": "Planning method",
      "enum": [
       "none",
       "min_max",
       "reorder_point",
       "mrp",
       "mps",
       "kanban",
       "vmi",
       "subcontract",
       "make_to_order",
       "buy_to_order"
      ]
     },
     "make_or_buy": {
      "type": "string",
      "description": "Make or buy",
      "enum": [
       "make",
       "buy",
       "both",
       "subcontract"
      ]
     },
     "planner_id": {
      "type": "string",
      "format": "uuid",
      "description": "Planner"
     },
     "planning_category_id": {
      "type": "string",
      "format": "uuid",
      "description": "Planning category id"
     },
     "safety_stock_qty": {
      "type": "string",
      "format": "decimal",
      "description": "Safety stock quantity"
     },
     "safety_stock_days": {
      "type": "integer",
      "description": "Safety stock (days of cover)"
     },
     "reorder_point": {
      "type": "string",
      "format": "decimal",
      "description": "Reorder point"
     },
     "minimum_qty": {
      "type": "string",
      "format": "decimal",
      "description": "Minimum"
     },
     "maximum_qty": {
      "type": "string",
      "format": "decimal",
      "description": "Maximum"
     },
     "fixed_order_qty": {
      "type": "string",
      "format": "decimal",
      "description": "Fixed order qty"
     },
     "economic_order_qty": {
      "type": "string",
      "format": "decimal",
      "description": "Economic order quantity"
     },
     "order_multiple": {
      "type": "string",
      "format": "decimal",
      "description": "Order multiple"
     },
     "processing_lead_days": {
      "type": "integer",
      "description": "Processing lead days"
     },
     "preprocessing_lead_days": {
      "type": "integer",
      "description": "Pre-processing lead days"
     },
     "postprocessing_lead_days": {
      "type": "integer",
      "description": "Post-processing lead days"
     },
     "cumulative_lead_days": {
      "type": "integer",
      "description": "Cumulative lead days"
     },
     "demand_time_fence_days": {
      "type": "integer",
      "description": "Demand time fence (days)"
     },
     "planning_time_fence_days": {
      "type": "integer",
      "description": "Planning time fence (days)"
     },
     "release_time_fence_days": {
      "type": "integer",
      "description": "Release time fence days"
     },
     "forecast_method": {
      "type": "string",
      "description": "Forecast method",
      "enum": [
       "none",
       "manual",
       "moving_average",
       "exponential",
       "seasonal",
       "causal",
       "collaborative"
      ]
     },
     "forecast_consumption": {
      "type": "boolean",
      "description": "Orders consume the forecast"
     },
     "forecast_backward_days": {
      "type": "integer",
      "description": "Forecast backward days"
     },
     "forecast_forward_days": {
      "type": "integer",
      "description": "Forecast forward days"
     },
     "demand_variability": {
      "type": "string",
      "description": "Demand pattern",
      "enum": [
       "stable",
       "seasonal",
       "erratic",
       "lumpy",
       "new"
      ]
     },
     "abc_class": {
      "type": "string",
      "description": "ABC class",
      "enum": [
       "A",
       "B",
       "C",
       "D"
      ]
     },
     "xyz_class": {
      "type": "string",
      "description": "XYZ class",
      "enum": [
       "X",
       "Y",
       "Z"
      ]
     },
     "service_level_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Target service level %"
     },
     "is_critical": {
      "type": "boolean",
      "description": "Critical"
     },
     "is_phantom": {
      "type": "boolean",
      "description": "Phantom (consumed through, never stocked)"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "effective_from": {
      "type": "string",
      "format": "date",
      "description": "In force from"
     },
     "effective_to": {
      "type": "string",
      "format": "date",
      "description": "Until"
     },
     "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/item-planning": {
   "get": {
    "summary": "list item-planning",
    "operationId": "list_item_planning_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create item-planning",
    "operationId": "create_item_planning_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/item-planning/{id}": {
   "get": {
    "summary": "get item-planning",
    "operationId": "get_item_planning_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change item-planning",
    "operationId": "change_item_planning_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete item-planning",
    "operationId": "delete_item_planning_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/item-planning/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_item_planning_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"
     }
    }
   }
  }
 }
}