{
 "openapi": "3.1.0",
 "info": {
  "title": "Cost Layers (Supply Chain)",
  "version": "20261030b",
  "description": "Each receipt of a FIFO or LIFO item, what is left of it and what a unit of it costs now (landed cost included)."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "cost-layers": {
    "type": "object",
    "required": [],
    "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 id",
      "readOnly": true
     },
     "item_no": {
      "type": "string",
      "description": "Item no",
      "readOnly": true
     },
     "item_name": {
      "type": "string",
      "description": "Item name",
      "readOnly": true
     },
     "cost_method": {
      "type": "string",
      "description": "Cost method",
      "readOnly": true
     },
     "layer_seq": {
      "type": "string",
      "format": "decimal",
      "description": "Layer seq",
      "readOnly": true
     },
     "received_on": {
      "type": "string",
      "format": "date-time",
      "description": "Received on",
      "readOnly": true
     },
     "reference_module": {
      "type": "string",
      "description": "Reference module",
      "readOnly": true
     },
     "reference_no": {
      "type": "string",
      "description": "Reference no",
      "readOnly": true
     },
     "lot_no": {
      "type": "string",
      "description": "Lot no",
      "readOnly": true
     },
     "qty_in": {
      "type": "string",
      "format": "decimal",
      "description": "Qty in",
      "readOnly": true
     },
     "qty_remaining": {
      "type": "string",
      "format": "decimal",
      "description": "Qty remaining",
      "readOnly": true
     },
     "unit_cost": {
      "type": "string",
      "format": "decimal",
      "description": "Unit cost",
      "readOnly": true
     },
     "landed_per_unit": {
      "type": "string",
      "format": "decimal",
      "description": "Landed per unit",
      "readOnly": true
     },
     "remaining_value": {
      "type": "string",
      "format": "decimal",
      "description": "Remaining value",
      "readOnly": true
     },
     "is_opening": {
      "type": "boolean",
      "description": "Is opening",
      "readOnly": true
     },
     "closed_reason": {
      "type": "string",
      "description": "Closed reason",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/scm/cost-layers": {
   "get": {
    "summary": "list cost-layers",
    "operationId": "list_cost_layers_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Post cost layers",
    "operationId": "action_cost_layers_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/cost-layers/{id}": {
   "get": {
    "summary": "get cost-layers",
    "operationId": "get_cost_layers_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "Put cost layers",
    "operationId": "action_cost_layers_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Delete cost layers",
    "operationId": "action_cost_layers_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/cost-layers/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_cost_layers_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"
     }
    }
   }
  }
 }
}