{
 "openapi": "3.1.0",
 "info": {
  "title": "Claims (EHR)",
  "version": "20261030b",
  "description": "Built, scrubbed, submitted and adjudicated. What the patient owes becomes a receivable in Accounting."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "claims": {
    "type": "object",
    "required": [
     "patient_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
     },
     "claim_no": {
      "type": "string",
      "description": "Claim no",
      "readOnly": true
     },
     "patient_id": {
      "type": "string",
      "format": "uuid",
      "description": "Patient id"
     },
     "encounter_id": {
      "type": "string",
      "format": "uuid",
      "description": "Encounter id"
     },
     "payer_id": {
      "type": "string",
      "format": "uuid",
      "description": "Payer id"
     },
     "policy_id": {
      "type": "string",
      "format": "uuid",
      "description": "Policy id"
     },
     "claim_type": {
      "type": "string",
      "description": "Claim type"
     },
     "service_from": {
      "type": "string",
      "format": "date",
      "description": "Service from"
     },
     "service_to": {
      "type": "string",
      "format": "date",
      "description": "Service to"
     },
     "billed_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Billed amount",
      "readOnly": true
     },
     "allowed_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Allowed amount",
      "readOnly": true
     },
     "paid_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Paid amount",
      "readOnly": true
     },
     "patient_responsibility": {
      "type": "string",
      "format": "decimal",
      "description": "Patient responsibility",
      "readOnly": true
     },
     "adjustment_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Adjustment amount",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status"
     },
     "submitted_at": {
      "type": "string",
      "format": "date-time",
      "description": "Submitted at",
      "readOnly": true
     },
     "adjudicated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Adjudicated at",
      "readOnly": true
     },
     "denial_code": {
      "type": "string",
      "description": "Denial code"
     },
     "denial_reason": {
      "type": "string",
      "description": "Denial reason"
     },
     "ar_invoice_id": {
      "type": "string",
      "format": "uuid",
      "description": "Ar invoice id",
      "readOnly": true
     },
     "scrub_errors": {
      "type": "array",
      "items": {
       "type": "string"
      },
      "description": "Scrub errors",
      "readOnly": true
     },
     "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
     },
     "bill_type": {
      "type": "string",
      "description": "Bill type"
     },
     "place_of_service": {
      "type": "string",
      "description": "Place of service"
     },
     "frequency_code": {
      "type": "string",
      "description": "Frequency code"
     },
     "billing_site_id": {
      "type": "string",
      "format": "uuid",
      "description": "Billing site id"
     },
     "rendering_provider_id": {
      "type": "string",
      "format": "uuid",
      "description": "Rendering provider id"
     },
     "edi_status": {
      "type": "string",
      "description": "Edi status",
      "readOnly": true
     },
     "edi_status_detail": {
      "type": "string",
      "description": "Edi status detail",
      "readOnly": true
     },
     "last_edi_file_id": {
      "type": "string",
      "format": "uuid",
      "description": "Last edi file id",
      "readOnly": true
     },
     "payer_claim_no": {
      "type": "string",
      "description": "Payer claim no",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/ehr/claims": {
   "get": {
    "summary": "list claims",
    "operationId": "list_claims_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create claims",
    "operationId": "create_claims_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ehr/claims/{id}": {
   "get": {
    "summary": "get claims",
    "operationId": "get_claims_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change claims",
    "operationId": "change_claims_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete claims",
    "operationId": "delete_claims_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ehr/claims/{id}/submit": {
   "post": {
    "summary": "Submit",
    "operationId": "action_claims_0_6",
    "description": "Body keys: channel",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ehr/claims/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_claims_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/ehr/claims/{parentId}/payments": {
   "get": {
    "summary": "Payments",
    "operationId": "action_claims_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Payments",
    "operationId": "action_claims_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ehr/claims/{parentId}/payments/{lineId}": {
   "put": {
    "summary": "Payments",
    "operationId": "action_claims_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Payments",
    "operationId": "action_claims_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ehr/claims/build": {
   "post": {
    "summary": "Build",
    "operationId": "action_claims_0_5",
    "description": "Body keys: patientId*, patient_id, encounterId, chargeIds, payerId",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ehr/claims/{id}/post-payment": {
   "post": {
    "summary": "Post payment",
    "operationId": "action_claims_0_6",
    "description": "Body keys: paidAmount, allowedAmount, adjustmentAmount, patientResponsibility, denialCode, denialReason, method, reference",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}