{
 "openapi": "3.1.0",
 "info": {
  "title": "Expense Policy (HRMS)",
  "version": "20261030b",
  "description": "The caps, the daily limits and the receipt thresholds each claim is measured against. A claim above its linked travel request’s estimate is always flagged on the claim — that rule is built in and needs no policy here."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "expense-policies": {
    "type": "object",
    "required": [
     "code",
     "name",
     "expense_type"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "code": {
      "type": "string",
      "description": "Policy code"
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "expense_type": {
      "type": "string",
      "description": "Applies to"
     },
     "max_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Maximum for one line"
     },
     "max_per_day": {
      "type": "string",
      "format": "decimal",
      "description": "Maximum per day"
     },
     "requires_receipt_above": {
      "type": "string",
      "format": "decimal",
      "description": "Receipt required above"
     },
     "requires_approval_above": {
      "type": "string",
      "format": "decimal",
      "description": "Extra approval above"
     },
     "requires_pre_approval": {
      "type": "boolean",
      "description": "Needs pre-approval"
     },
     "gl_account_id": {
      "type": "string",
      "format": "uuid",
      "description": "Posts to"
     },
     "guidance": {
      "type": "string",
      "description": "Guidance"
     },
     "is_active": {
      "type": "boolean",
      "description": "Active"
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "expense_type_id": {
      "type": "string",
      "format": "uuid",
      "description": "Expense type (master)"
     },
     "country": {
      "type": "string",
      "description": "Country"
     },
     "city": {
      "type": "string",
      "description": "City"
     },
     "grade": {
      "type": "string",
      "description": "Grade"
     },
     "worker_type": {
      "type": "string",
      "description": "Worker type"
     },
     "currency": {
      "type": "string",
      "description": "Currency"
     },
     "limit_type": {
      "type": "string",
      "description": "Limit is",
      "enum": [
       "per_transaction",
       "per_day",
       "per_night",
       "per_person",
       "per_trip",
       "per_month"
      ]
     },
     "limit_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Limit"
     },
     "enforcement": {
      "type": "string",
      "description": "Enforcement",
      "enum": [
       "block",
       "approve",
       "warn",
       "inform",
       "none"
      ]
     },
     "approver_role": {
      "type": "string",
      "description": "Escalate to role"
     },
     "justification_required": {
      "type": "boolean",
      "description": "Justification required"
     },
     "advance_days_required": {
      "type": "integer",
      "description": "Book at least (days) ahead"
     },
     "cabin_class_allowed": {
      "type": "string",
      "description": "Cabin classes allowed"
     },
     "flight_hours_threshold": {
      "type": "string",
      "format": "decimal",
      "description": "Above flight hours"
     },
     "valid_from": {
      "type": "string",
      "format": "date",
      "description": "From"
     },
     "valid_to": {
      "type": "string",
      "format": "date",
      "description": "To"
     },
     "priority": {
      "type": "integer",
      "description": "Priority"
     },
     "description": {
      "type": "string",
      "description": "Description"
     },
     "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_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "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/hrms/expense-policies": {
   "get": {
    "summary": "list expense-policies",
    "operationId": "list_expense_policies_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create expense-policies",
    "operationId": "create_expense_policies_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/expense-policies/{id}": {
   "get": {
    "summary": "get expense-policies",
    "operationId": "get_expense_policies_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change expense-policies",
    "operationId": "change_expense_policies_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete expense-policies",
    "operationId": "delete_expense_policies_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/expense-policies/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_expense_policies_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"
     }
    }
   }
  }
 }
}