{
 "openapi": "3.1.0",
 "info": {
  "title": "Benefit Plans (HRMS)",
  "version": "20261030b",
  "description": "What is offered, who carries it, and what a period of it costs the employee and the employer. Every election is against one of these."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "benefit-plans": {
    "type": "object",
    "required": [
     "code",
     "name"
    ],
    "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": "Code"
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "plan_type": {
      "type": "string",
      "description": "Type",
      "enum": [
       "medical",
       "dental",
       "vision",
       "life",
       "disability",
       "retirement",
       "other"
      ]
     },
     "employee_cost_per_period": {
      "type": "string",
      "format": "decimal",
      "description": "Employee cost a period"
     },
     "employer_cost_per_period": {
      "type": "string",
      "format": "decimal",
      "description": "Employer cost a period"
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "plan_year_id": {
      "type": "string",
      "format": "uuid",
      "description": "Plan year"
     },
     "category": {
      "type": "string",
      "description": "Category"
     },
     "carrier": {
      "type": "string",
      "description": "Carrier"
     },
     "policy_number": {
      "type": "string",
      "description": "Policy number"
     },
     "deduction_code": {
      "type": "string",
      "description": "Deduction code"
     },
     "is_pretax": {
      "type": "boolean",
      "description": "Is pretax"
     },
     "allows_dependants": {
      "type": "boolean",
      "description": "Allows dependants"
     },
     "requires_evidence": {
      "type": "boolean",
      "description": "Requires evidence",
      "readOnly": true
     },
     "waiting_period_days": {
      "type": "integer",
      "description": "Waiting period (days)"
     },
     "min_hours_week": {
      "type": "string",
      "format": "decimal",
      "description": "Minimum hours a week"
     },
     "min_fte": {
      "type": "string",
      "format": "decimal",
      "description": "Minimum FTE"
     },
     "eligible_employment_types": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Employment types"
     },
     "annual_limit": {
      "type": "string",
      "format": "decimal",
      "description": "Annual limit"
     },
     "employer_contribution_percent": {
      "type": "string",
      "format": "decimal",
      "description": "Employer contribution percent",
      "readOnly": true
     },
     "is_default": {
      "type": "boolean",
      "description": "Is default",
      "readOnly": true
     },
     "is_active": {
      "type": "boolean",
      "description": "Active"
     },
     "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
     },
     "tax_treatment": {
      "type": "string",
      "description": "Tax treatment",
      "enum": [
       "Pre-tax, Section 125 (medical, dental, vision, health FSA)",
       "Pre-tax HSA (W-2 box 12 W)",
       "Pre-tax dependent care FSA (W-2 box 10)",
       "Pre-tax transit and parking (Section 132)",
       "Pre-tax 401(k) (box 12 D; FICA still due)",
       "Pre-tax 403(b) (box 12 E)",
       "Pre-tax 457(b) (box 12 G)",
       "Roth 401(k), after tax (box 12 AA)",
       "Roth 403(b), after tax (box 12 BB)",
       "Roth 457(b), after tax (box 12 EE)",
       "After tax (supplemental life, accident)",
       "Group-term life (cover over $50,000 imputed, box 12 C)",
       "Paid by the employer only"
      ]
     },
     "w2_box": {
      "type": "string",
      "description": "W-2 box"
     },
     "carrier_id": {
      "type": "string",
      "format": "uuid",
      "description": "Carrier id",
      "readOnly": true
     },
     "is_mec": {
      "type": "boolean",
      "description": "Is mec",
      "readOnly": true
     },
     "is_min_value": {
      "type": "boolean",
      "description": "Is min value",
      "readOnly": true
     },
     "self_insured": {
      "type": "boolean",
      "description": "Self insured",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/hrms/benefit-plans": {
   "get": {
    "summary": "list benefit-plans",
    "operationId": "list_benefit_plans_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create benefit-plans",
    "operationId": "create_benefit_plans_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/benefit-plans/{id}": {
   "get": {
    "summary": "get benefit-plans",
    "operationId": "get_benefit_plans_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change benefit-plans",
    "operationId": "change_benefit_plans_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete benefit-plans",
    "operationId": "delete_benefit_plans_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/benefit-plans/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_benefit_plans_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/hrms/benefit-plans/{parentId}/tiers": {
   "get": {
    "summary": "Tiers",
    "operationId": "action_benefit_plans_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Tiers",
    "operationId": "action_benefit_plans_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/benefit-plans/{parentId}/tiers/{lineId}": {
   "put": {
    "summary": "Tiers",
    "operationId": "action_benefit_plans_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Tiers",
    "operationId": "action_benefit_plans_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}