{
 "openapi": "3.1.0",
 "info": {
  "title": "Item · Purchasing (Supply Chain)",
  "version": "20261030b",
  "description": "Who it is bought from, on what terms, with what tolerance, and how the invoice is matched."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "item-purchasing": {
    "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"
     },
     "is_purchasable": {
      "type": "boolean",
      "description": "Purchasable"
     },
     "purchasing_uom": {
      "type": "string",
      "description": "Purchasing unit of measure"
     },
     "purchasing_uom_conversion": {
      "type": "string",
      "format": "decimal",
      "description": "Conversion to stock unit"
     },
     "buyer_id": {
      "type": "string",
      "format": "uuid",
      "description": "Buyer"
     },
     "commodity_category_id": {
      "type": "string",
      "format": "uuid",
      "description": "Commodity category id"
     },
     "default_supplier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Default supplier"
     },
     "default_supplier_site_id": {
      "type": "string",
      "format": "uuid",
      "description": "Default supplier site id"
     },
     "list_price": {
      "type": "string",
      "format": "decimal",
      "description": "Price"
     },
     "last_price_paid": {
      "type": "string",
      "format": "decimal",
      "description": "Last price paid"
     },
     "price_tolerance_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Price tolerance %"
     },
     "receipt_tolerance_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Over-receipt tolerance %"
     },
     "invoice_match_option": {
      "type": "string",
      "description": "Invoice matching",
      "enum": [
       "two_way",
       "three_way",
       "four_way",
       "none"
      ]
     },
     "receipt_routing": {
      "type": "string",
      "description": "On receipt",
      "enum": [
       "direct",
       "inspection",
       "standard"
      ]
     },
     "lead_time_days": {
      "type": "integer",
      "description": "Lead time (days)"
     },
     "minimum_order_qty": {
      "type": "string",
      "format": "decimal",
      "description": "Minimum order quantity"
     },
     "order_multiple": {
      "type": "string",
      "format": "decimal",
      "description": "Order multiple"
     },
     "fixed_order_cost": {
      "type": "string",
      "format": "decimal",
      "description": "Fixed order cost"
     },
     "allow_auto_source": {
      "type": "boolean",
      "description": "May be ordered automatically"
     },
     "requires_approval": {
      "type": "boolean",
      "description": "Requires approval"
     },
     "is_consigned": {
      "type": "boolean",
      "description": "Consigned"
     },
     "is_outsourced": {
      "type": "boolean",
      "description": "Subcontract manufacture"
     },
     "hs_code": {
      "type": "string",
      "description": "HS code"
     },
     "country_of_origin": {
      "type": "string",
      "description": "Country of origin"
     },
     "is_hazmat_regulated": {
      "type": "boolean",
      "description": "Is hazmat regulated"
     },
     "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
     },
     "quantity_tolerance_pct": {
      "type": "string",
      "format": "decimal",
      "description": "Quantity tolerance %"
     },
     "source_list_required": {
      "type": "boolean",
      "description": "Source list required"
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/scm/item-purchasing": {
   "get": {
    "summary": "list item-purchasing",
    "operationId": "list_item_purchasing_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-purchasing",
    "operationId": "create_item_purchasing_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/item-purchasing/{id}": {
   "get": {
    "summary": "get item-purchasing",
    "operationId": "get_item_purchasing_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-purchasing",
    "operationId": "change_item_purchasing_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-purchasing",
    "operationId": "delete_item_purchasing_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/scm/item-purchasing/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_item_purchasing_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"
     }
    }
   }
  }
 }
}