{
 "openapi": "3.1.0",
 "info": {
  "title": "Item · Lot & Serial Control (Supply Chain)",
  "version": "20261030b",
  "description": "The POLICY. Whether lots and serials are demanded, how they are formed, and what may not move without them — which is what turns traceability from an intention into a control."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "item-traceability": {
    "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"
     },
     "lot_control": {
      "type": "string",
      "description": "Lot control",
      "enum": [
       "none",
       "full",
       "at_receipt",
       "at_completion",
       "optional"
      ]
     },
     "lot_prefix": {
      "type": "string",
      "description": "Lot prefix"
     },
     "lot_numbering": {
      "type": "string",
      "description": "Lot numbering",
      "enum": [
       "manual",
       "automatic",
       "supplier",
       "production_order",
       "date_based"
      ]
     },
     "lot_uniqueness": {
      "type": "string",
      "description": "Lot uniqueness"
     },
     "lot_split_allowed": {
      "type": "boolean",
      "description": "Lots may be split"
     },
     "lot_merge_allowed": {
      "type": "boolean",
      "description": "Lots may be merged"
     },
     "shelf_life_control": {
      "type": "string",
      "description": "Shelf life control",
      "enum": [
       "none",
       "shelf_life_days",
       "user_defined",
       "supplier_expiry"
      ]
     },
     "shelf_life_days": {
      "type": "integer",
      "description": "Shelf life (days)"
     },
     "expiry_warning_days": {
      "type": "integer",
      "description": "Warn this many days before expiry"
     },
     "serial_control": {
      "type": "string",
      "description": "Serial control",
      "enum": [
       "none",
       "at_receipt",
       "at_completion",
       "at_issue",
       "at_sale",
       "predefined"
      ]
     },
     "serial_prefix": {
      "type": "string",
      "description": "Serial prefix"
     },
     "serial_numbering": {
      "type": "string",
      "description": "Serial numbering",
      "enum": [
       "manual",
       "automatic",
       "supplier",
       "manufacturer"
      ]
     },
     "serial_uniqueness": {
      "type": "string",
      "description": "Serial uniqueness"
     },
     "enforce_on_receipt": {
      "type": "boolean",
      "description": "Enforce on receipt"
     },
     "enforce_on_issue": {
      "type": "boolean",
      "description": "Enforce on issue"
     },
     "enforce_on_ship": {
      "type": "boolean",
      "description": "Enforce on shipment"
     },
     "enforce_on_return": {
      "type": "boolean",
      "description": "Enforce on return"
     },
     "track_genealogy": {
      "type": "boolean",
      "description": "Track genealogy"
     },
     "track_at_customer": {
      "type": "boolean",
      "description": "Track after it has shipped"
     },
     "recall_class": {
      "type": "string",
      "description": "Recall class",
      "enum": [
       "class_i",
       "class_ii",
       "class_iii",
       "none"
      ]
     },
     "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-traceability": {
   "get": {
    "summary": "list item-traceability",
    "operationId": "list_item_traceability_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-traceability",
    "operationId": "create_item_traceability_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/item-traceability/{id}": {
   "get": {
    "summary": "get item-traceability",
    "operationId": "get_item_traceability_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-traceability",
    "operationId": "change_item_traceability_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-traceability",
    "operationId": "delete_item_traceability_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/item-traceability/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_item_traceability_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"
     }
    }
   }
  }
 }
}