{
 "openapi": "3.1.0",
 "info": {
  "title": "What Needs Replenishing (Supply Chain)",
  "version": "20261030b",
  "description": "Every pick face at or below its minimum, right now. The replenishment run reads exactly this and turns each row into a task."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "replenishment-needs": {
    "type": "object",
    "required": [],
    "properties": {
     "rule_id": {
      "type": "string",
      "format": "uuid",
      "description": "Rule id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "warehouse_id": {
      "type": "string",
      "format": "uuid",
      "description": "Warehouse id",
      "readOnly": true
     },
     "item_id": {
      "type": "string",
      "format": "uuid",
      "description": "Item id",
      "readOnly": true
     },
     "to_bin_id": {
      "type": "string",
      "format": "uuid",
      "description": "To bin id",
      "readOnly": true
     },
     "min_quantity": {
      "type": "string",
      "format": "decimal",
      "description": "Min quantity",
      "readOnly": true
     },
     "max_quantity": {
      "type": "string",
      "format": "decimal",
      "description": "Max quantity",
      "readOnly": true
     },
     "method": {
      "type": "string",
      "description": "Method",
      "readOnly": true
     },
     "priority": {
      "type": "integer",
      "description": "Priority",
      "readOnly": true
     },
     "trigger_mode": {
      "type": "string",
      "description": "Trigger mode",
      "readOnly": true
     },
     "item_no": {
      "type": "string",
      "description": "Item no",
      "readOnly": true
     },
     "item_name": {
      "type": "string",
      "description": "Item name",
      "readOnly": true
     },
     "uom": {
      "type": "string",
      "description": "Uom",
      "readOnly": true
     },
     "bin_code": {
      "type": "string",
      "description": "Bin code",
      "readOnly": true
     },
     "bin_address": {
      "type": "string",
      "description": "Bin address",
      "readOnly": true
     },
     "on_hand": {
      "type": "string",
      "format": "decimal",
      "description": "On hand",
      "readOnly": true
     },
     "shortfall": {
      "type": "string",
      "format": "decimal",
      "description": "Shortfall",
      "readOnly": true
     },
     "open_tasks": {
      "type": "integer",
      "description": "Open tasks",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/scm/replenishment-needs": {
   "get": {
    "summary": "list replenishment-needs",
    "operationId": "list_replenishment_needs_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Post what needs replenishing",
    "operationId": "action_replenishment_needs_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/replenishment-needs/{rule_id}": {
   "get": {
    "summary": "get replenishment-needs",
    "operationId": "get_replenishment_needs_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/replenishment-needs/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_replenishment_needs_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/replenishment-needs/{id}": {
   "put": {
    "summary": "Put what needs replenishing",
    "operationId": "action_replenishment_needs_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Delete what needs replenishing",
    "operationId": "action_replenishment_needs_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}