{
 "openapi": "3.1.0",
 "info": {
  "title": "Pay Files (HRMS)",
  "version": "20261030b",
  "description": "Each payroll run’s net-pay file for the bank, every version kept with its checksum and control totals. Made from Payroll Runs > Create pay file."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "pay-files": {
    "type": "object",
    "required": [],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "payroll_run_id": {
      "type": "string",
      "format": "uuid",
      "description": "Payroll run id",
      "readOnly": true
     },
     "run_no": {
      "type": "string",
      "description": "Run no",
      "readOnly": true
     },
     "period_start": {
      "type": "string",
      "format": "date",
      "description": "Period start",
      "readOnly": true
     },
     "period_end": {
      "type": "string",
      "format": "date",
      "description": "Period end",
      "readOnly": true
     },
     "pay_date": {
      "type": "string",
      "format": "date",
      "description": "Pay date",
      "readOnly": true
     },
     "run_status": {
      "type": "string",
      "description": "Run status",
      "readOnly": true
     },
     "paid_at": {
      "type": "string",
      "format": "date-time",
      "description": "Paid at",
      "readOnly": true
     },
     "version": {
      "type": "integer",
      "description": "Version",
      "readOnly": true
     },
     "format": {
      "type": "string",
      "description": "Format",
      "readOnly": true
     },
     "format_label": {
      "type": "string",
      "description": "Format label",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "file_name": {
      "type": "string",
      "description": "File name",
      "readOnly": true
     },
     "sha256": {
      "type": "string",
      "description": "Sha256",
      "readOnly": true
     },
     "entry_count": {
      "type": "integer",
      "description": "Entry count",
      "readOnly": true
     },
     "employee_count": {
      "type": "integer",
      "description": "Employee count",
      "readOnly": true
     },
     "total_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Total amount",
      "readOnly": true
     },
     "currency": {
      "type": "string",
      "description": "Currency",
      "readOnly": true
     },
     "entry_hash": {
      "type": "string",
      "description": "Entry hash",
      "readOnly": true
     },
     "block_count": {
      "type": "integer",
      "description": "Block count",
      "readOnly": true
     },
     "line_count": {
      "type": "integer",
      "description": "Line count",
      "readOnly": true
     },
     "effective_date": {
      "type": "string",
      "format": "date",
      "description": "Effective date",
      "readOnly": true
     },
     "controls": {
      "type": "object",
      "description": "Controls",
      "readOnly": true
     },
     "exception_count": {
      "type": "integer",
      "description": "Exception count",
      "readOnly": true
     },
     "exceptions": {
      "type": "object",
      "description": "Exceptions",
      "readOnly": true
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "created_by_name": {
      "type": "string",
      "description": "Created by name",
      "readOnly": true
     },
     "confirmed_at": {
      "type": "string",
      "format": "date-time",
      "description": "Confirmed at",
      "readOnly": true
     },
     "confirmed_by_name": {
      "type": "string",
      "description": "Confirmed by name",
      "readOnly": true
     },
     "downloads": {
      "type": "integer",
      "description": "Downloads",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/hrms/pay-files": {
   "get": {
    "summary": "list pay-files",
    "operationId": "list_pay_files_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Post pay files",
    "operationId": "action_pay_files_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/pay-files/{id}": {
   "get": {
    "summary": "get pay-files",
    "operationId": "get_pay_files_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "Put pay files",
    "operationId": "action_pay_files_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Delete pay files",
    "operationId": "action_pay_files_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/pay-files/preview": {
   "post": {
    "summary": "Preview",
    "operationId": "action_pay_files_0_5",
    "description": "Body keys: runId, format",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/pay-files/create": {
   "post": {
    "summary": "Create",
    "operationId": "action_pay_files_0_5",
    "description": "Body keys: runId, format, effectiveDate; format one of nacha|neft_csv|wps_sif|pain001",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/pay-files/{id}/exceptions": {
   "get": {
    "summary": "Exceptions",
    "operationId": "action_pay_files_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/pay-files/{id}/checks": {
   "post": {
    "summary": "Checks",
    "operationId": "action_pay_files_0_6",
    "description": "Body keys: replace, reason, firstCheckNo; checks: [{ employeeId, employeeNo, checkNo, check_number }]",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/pay-files/{id}/download": {
   "get": {
    "summary": "Download",
    "operationId": "action_pay_files_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/pay-files/{id}/confirm": {
   "post": {
    "summary": "Confirm",
    "operationId": "action_pay_files_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/hrms/pay-files/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_pay_files_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"
     }
    }
   }
  }
 }
}