{
 "openapi": "3.1.0",
 "info": {
  "title": "Master Recipes (Manufacturing)",
  "version": "20261030b",
  "description": "The process industry’s counterpart of a BOM plus a routing: its steps carry parameters with specifications, and its quantities scale with batch size."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "recipes": {
    "type": "object",
    "required": [
     "name",
     "item_id"
    ],
    "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
     },
     "recipe_no": {
      "type": "string",
      "description": "Recipe no",
      "readOnly": true
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "item_id": {
      "type": "string",
      "format": "uuid",
      "description": "Item"
     },
     "version": {
      "type": "string",
      "description": "Version"
     },
     "bom_id": {
      "type": "string",
      "format": "uuid",
      "description": "Bill of material"
     },
     "routing_id": {
      "type": "string",
      "format": "uuid",
      "description": "Routing"
     },
     "standard_batch_size": {
      "type": "string",
      "format": "decimal",
      "description": "Standard batch size"
     },
     "min_batch_size": {
      "type": "string",
      "format": "decimal",
      "description": "Minimum batch"
     },
     "max_batch_size": {
      "type": "string",
      "format": "decimal",
      "description": "Maximum batch"
     },
     "batch_uom": {
      "type": "string",
      "description": "Batch unit"
     },
     "expected_yield_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Expected yield %"
     },
     "requires_batch_record": {
      "type": "boolean",
      "description": "Produces a batch record"
     },
     "requires_signature": {
      "type": "boolean",
      "description": "Requires signatures"
     },
     "gmp_class": {
      "type": "string",
      "description": "GMP class"
     },
     "change_order_id": {
      "type": "string",
      "format": "uuid",
      "description": "Authorized by change order"
     },
     "effective_from": {
      "type": "string",
      "format": "date",
      "description": "Effective from"
     },
     "effective_to": {
      "type": "string",
      "format": "date",
      "description": "Effective to"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "approved_by": {
      "type": "string",
      "format": "uuid",
      "description": "Approved by",
      "readOnly": true
     },
     "approved_at": {
      "type": "string",
      "format": "date-time",
      "description": "Approved at",
      "readOnly": true
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "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/mfg/recipes": {
   "get": {
    "summary": "list recipes",
    "operationId": "list_recipes_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create recipes",
    "operationId": "create_recipes_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/recipes/{id}": {
   "get": {
    "summary": "get recipes",
    "operationId": "get_recipes_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change recipes",
    "operationId": "change_recipes_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete recipes",
    "operationId": "delete_recipes_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/recipes/{parentId}/phases": {
   "get": {
    "summary": "Phases",
    "operationId": "action_recipes_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Phases",
    "operationId": "action_recipes_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/recipes/{parentId}/phases/{lineId}": {
   "put": {
    "summary": "Phases",
    "operationId": "action_recipes_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Phases",
    "operationId": "action_recipes_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/mfg/recipes/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_recipes_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/mfg/recipes/{id}/release": {
   "post": {
    "summary": "Release",
    "operationId": "action_recipes_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}