> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.rebateright.com.au/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.rebateright.com.au/_mcp/server.

# Health Fund Eligibility Check

POST https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2
Content-Type: application/json

**What will the patient's health fund cover for this hospital admission?**

That is the question this endpoint answers before the admission, as an estimate from the patient's
health fund.

Test environment only. Services Australia is certifying this service, and it reaches production once certified.

The fund checks the membership and returns the patient's hospital cover for the admission, with
its benefit limitations, its exclusions and any excess or co-payment. To estimate the cost of a
prosthesis or a miscellaneous item, add it as a `service` in the medical event. The check goes to the fund alone.

Send `typeCode` as `ECF` for an admission to a hospital or day facility. For an overseas visitor,
use [Overseas Visitor Eligibility Check](/api-reference/health-funds/overseas-visitor-eligibility-check).

The estimate supports informed financial consent. The fund assesses the actual claim on the
patient's cover when the claim is made.

#### Response `status`

| Value                     | Meaning                                                                                  |
| ------------------------- | ---------------------------------------------------------------------------------------- |
| `COMPLETE`                | The fund answered. `healthFundStatus` and `healthFundClaimEstimation` hold the estimate. |
| `HEALTH_FUND_REJECTED`    | The fund rejected the check                                                              |
| `HEALTH_FUND_UNAVAILABLE` | The fund's system is unavailable. Check again later.                                     |

If the fund takes longer than 30 seconds to answer, the check fails with code `3040`. Send it again.

#### Limits

A request holds up to 16 medical events, numbered from `01` in order. Each medical event holds
up to 14 services, and the request holds up to 50.

#### Validation errors (`400`)

| Code                          | Meaning                                                                                                                                                          |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `9202`                        | A submitted field failed its checks. The `reason` in `serviceMessage` names the field and the problem.                                                           |
| `2030`                        | Two fields conflict, or a date breaks its rule. The `reason` names the rule and, where it applies, the medical event.                                            |
| `9672`                        | `organisation` is missing from the current fund list. Refresh your list from [Get Participants](/api-reference/health-funds/get-participants), then check again. |
| `2025`, `2032`, `2033`        | The request is over one of the limits above.                                                                                                                     |
| `5`, with `codeType` `DHSEIN` | The request does not match the expected structure, such as a missing required field or a number sent as a string. `message` names the problem.                   |

#### Showing the result

[Give the patient the report](/health-fund-checks#give-the-patient-the-report) sets out what a
result shown or printed for the patient must carry.

**Display `text` exactly as supplied.** Services Australia requires its messages to be shown
to the end user exactly as supplied in the response, without truncating, transforming or
changing them in any way. The wording can change at any time, so branch on `code`, never on `text`.

Reference: https://docs.rebateright.com.au/api-reference/health-funds/health-fund-eligibility-check

## Authentication

- `x-api-key` header (required) — API Key authentication via header
- `x-minor-id` header (required) — Your Minor ID is 3 uppercase letters followed by 5 digits, such as `MDE00000`. Send the Minor ID exactly as issued. A malformed value returns `400` with the text `The Minor ID is not valid.` on every endpoint.

## Servers

- `https://test-api.rebateright.com.au` (Test, default)
- `https://api.rebateright.com.au` (Production)

## Request

### Headers

- `x-minor-id` (string, required) — The Minor ID of the clinic you act for. See [Keys, Minor ID and environments](/keys-and-environments).

### Body (application/json)

This endpoint expects an object.

- `claim` (MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaim, required)

## Response

### 200

OK

- `status` (enum, required) — Outcome of the check. The status table at the top of this page explains each value.
  - Allowed values: `COMPLETE`, `HEALTH_FUND_REJECTED`, `HEALTH_FUND_UNAVAILABLE`
- `correlationId` (string, required) — Unique identifier for this transaction. Use it for tracing and support.
- `claimSummary` (MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaClaimSummary, optional)
- `healthFundStatus` (MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundStatus, optional) — The fund's check of the membership. Code `0` means the fund holds the membership.
- `healthFundClaimEstimation` (MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundClaimEstimation, optional) — The fund's estimate for the admission. The test environment's fund returns the fields in the examples. A fund can also return `exclusionDescription`, `patientCoPayment`, `patientExcessPayment`, `productTier` and `additionalClinicalCategories`.

## Errors

### 400 Bad Request Error

A submitted value broke a format or business rule. A rule error carries `serviceMessage` entries. A request that does not match the expected structure carries `code`, `codeType` and `message` instead. Both carry the `correlationId`.

- `PostMedicareOnlineeligibilitycheckHfV2RequestBadRequestError`

## Types

### MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaim

- `accountReferenceId` (string, required) — Your reference for this estimate, 1–20 letters or digits, not all zeros. The response returns it in `claimSummary.accountReferenceId`.
- `compensationClaimInd` (enum, required) — Whether the admission is part of a compensation claim. | Code | Meaning | |------|---------| | `Y` | Compensation claim | | `N` | Not a compensation claim |
  - Allowed values: `Y`, `N`
- `facilityId` (string, required) — The hospital or day facility's 8-character facility ID, in provider number format.
- `peaRequestInd` (enum, required) — Whether you ask the fund to assess a pre-existing ailment for this admission. The fund's answer is in `peaPotentialInd`. | Code | Meaning | |------|---------| | `Y` | Assess a pre-existing ailment | | `N` | No assessment requested |
  - Allowed values: `Y`, `N`
- `sameDayInd` (enum, required) — Whether the patient is admitted and discharged on the same day. | Code | Meaning | |------|---------| | `Y` | Same-day admission | | `N` | Overnight stay. Send `lengthOfStay`. |
  - Allowed values: `Y`, `N`
- `submissionAuthorityInd` (enum, required) — Must be `Y`, confirming the patient authorised your practice to send this check on their behalf. | Code | Meaning | |------|---------| | `Y` | Authorised by the patient |
  - Allowed values: `Y`
- `typeCode` (enum, required) — Must be `ECF` on this endpoint. Any other value returns `400` with code `2030`. | Code | Meaning | |------|---------| | `ECF` | Health fund eligibility check |
  - Allowed values: `ECF`
- `patient` (MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaimPatient, required)
- `accident` (MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaimAccident, required)
- `medicalEvent` (list of MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaimMedicalEventItems, required) — The admission, as up to 16 medical events. Every medical event carries the same `admissionDate` and `dischargeDate`.
- `emergencyAdmissionInd` (enum, optional) — Optional. Whether the admission is an emergency. | Code | Meaning | |------|---------| | `Y` | Emergency admission | | `N` | Planned admission |
  - Allowed values: `Y`, `N`
- `lengthOfStay` (integer, optional) — The expected length of stay in days, from 1 to 999, sent as a JSON number. It must equal the days from `admissionDate` to `dischargeDate`. Send it when `sameDayInd` is `N`, and leave it out when `sameDayInd` is `Y`.
- `presentingIllnessCode` (string, optional) — The presenting illness code, from `0` to `999`. Send this or `presentingIllnessItemNumber`, never both.
- `presentingIllnessItemNumber` (string, optional) — The MBS item that describes the presenting illness, such as `30026`. Send this or `presentingIllnessCode`, never both.
- `senderContact` (MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaimSenderContact, optional) — Optional. The person at your practice to contact about this check.

### MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaClaimSummary

- `accountReferenceId` (string, optional) — The `accountReferenceId` you sent.

### MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundStatus

The fund's check of the membership. Code `0` means the fund holds the membership.

- `status` (MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundStatusStatus, optional)

### MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundClaimEstimation

The fund's estimate for the admission. The test environment's fund returns the fields in the examples. A fund can also return `exclusionDescription`, `patientCoPayment`, `patientExcessPayment`, `productTier` and `additionalClinicalCategories`.

- `healthFundTable` (MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundClaimEstimationHealthFundTable, optional) — The patient's hospital cover. A fund calls each of its covers a table.
- `productTier` (string, optional) — The tier of the patient's hospital cover, such as `Gold`, `Silver Plus` or `Basic`.
- `additionalClinicalCategories` (list of string, optional) — The additional clinical categories the patient's hospital cover includes, such as `Cataracts` or `Joint replacements`.
- `benefitLimitations` (string, optional) — The limits on the fund's benefits, in the fund's words.
- `exclusionDescription` (string, optional) — The treatments the cover excludes, in the fund's words.
- `financialStatus` (string, optional) — Whether the membership is financial, `Y` or `N`.
- `fundAssessmentCode` (string, optional) — The fund's assessment code for the admission, such as `A`. The fund sets the codes.
- `fundReferenceId` (string, optional) — The fund's reference for this estimate.
- `peaPotentialInd` (string, optional) — Whether a pre-existing ailment may apply to the admission, `Y` or `N`.
- `patientCoPayment` (MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundClaimEstimationPatientCoPayment, optional) — The co-payment the patient pays, as the fund supplies it. A blank `amount` beside an `amountDescription` means the fund gave no figure, so show it blank, never as zero.
- `patientExcessPayment` (MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundClaimEstimationPatientExcessPayment, optional) — The excess the patient pays, as the fund supplies it. A blank `amount` beside an `amountDescription` means the fund gave no figure, so show it blank, never as zero.
- `explanation` (list of MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundClaimEstimationExplanationItems, optional) — The fund's explanations for the estimate.
- `medicalEvent` (list of MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundClaimEstimationMedicalEventItems, optional) — The estimate for each medical event, with an estimate for each service you sent.

### Service message

- `highestSeverity` (string, required)
- `serviceMessage` (list of MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaOneOf0ServiceMessageItems, required)
- `correlationId` (string, required)

### Structure error

- `code` (integer, required)
- `codeType` (string, required)
- `message` (string, required)
- `correlationId` (string, required)

### MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaimPatient

- `identity` (MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaimPatientIdentity, required)
- `healthFund` (MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaimPatientHealthFund, required)
- `alsoKnownAs` (MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaimPatientAlsoKnownAs, optional) — Optional. The patient's name as the fund holds it, when it differs from `identity`. Leave it out rather than send it empty.

### MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaimAccident

- `accidentInd` (enum, required) — Whether the admission results from an accident. | Code | Meaning | |------|---------| | `Y` | Results from an accident. Send `accidentDate`. | | `N` | Does not result from an accident, or unknown |
  - Allowed values: `Y`, `N`
- `accidentDate` (date, optional) — The date of the accident. Send it when `accidentInd` is `Y`, and leave it out when `accidentInd` is `N`. It cannot be in the future.

### MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaimMedicalEventItems

- `id` (string, required) — The medical event number, 2 digits, starting at `01` and rising by 1 for each medical event.
- `admissionDate` (date, required) — The admission date. It can be up to 12 months ahead and up to 7 days in the past, and it cannot be before the patient's date of birth.
- `dischargeDate` (date, optional) — Optional. The discharge date. It cannot be before `admissionDate`.
- `service` (list of MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaimMedicalEventItemsServiceItems, optional) — Optional. The prostheses and miscellaneous items to estimate, up to 14 in each medical event. Leave it out to estimate the admission alone.

### MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaimSenderContact

Optional. The person at your practice to contact about this check.

- `name` (string, optional) — The contact's name, 1–40 letters, digits, spaces, apostrophes and hyphens.
- `phoneNumber` (string, optional) — The contact's phone number, 8–19 characters of digits, spaces and `( ) - +`.
- `emailAddress` (string, optional) — The contact's email address, 5–128 characters, with an `@` and no spaces.

### MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundStatusStatus

- `code` (integer, required) — Health fund status code. [Health Fund Verification](/api-reference/health-funds/health-fund-verification) lists the codes.
- `text` (string, required) — The message to show the user, exactly as supplied.

### MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundClaimEstimationHealthFundTable

The patient's hospital cover. A fund calls each of its covers a table.

- `tableName` (string, optional) — The name of the cover, such as `Basic Hospital`.
- `tableDescription` (string, optional) — The fund's description of the cover.
- `tableScale` (string, optional) — Who the cover is for, such as `SINGLE`.

### MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundClaimEstimationPatientCoPayment

The co-payment the patient pays, as the fund supplies it. A blank `amount` beside an `amountDescription` means the fund gave no figure, so show it blank, never as zero.

- `amount` (any, optional) — The co-payment amount.
- `amountDescription` (string, optional) — The fund's description of the co-payment.
- `daysRemaining` (any, optional) — The days remaining, as the fund supplies them.

### MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundClaimEstimationPatientExcessPayment

The excess the patient pays, as the fund supplies it. A blank `amount` beside an `amountDescription` means the fund gave no figure, so show it blank, never as zero.

- `amount` (any, optional) — The excess amount.
- `amountDescription` (string, optional) — The fund's description of the excess.
- `bonusAmount` (any, optional) — The bonus amount, as the fund supplies it.

### MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundClaimEstimationExplanationItems

- `code` (string, optional) — The fund's explanation code.
- `text` (string, optional) — The explanation to show the user, exactly as supplied.

### MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundClaimEstimationMedicalEventItems

- `id` (string, optional) — The medical event number you sent.
- `service` (list of MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundClaimEstimationMedicalEventItemsServiceItems, optional) — Present when the medical event carried services.

### MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaOneOf0ServiceMessageItems

- `code` (string, optional)
- `severity` (string, optional)
- `reason` (string, optional)

### MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaimPatientIdentity

- `dateOfBirth` (date, required) — The patient's date of birth. It cannot be in the future or more than 130 years in the past.
- `familyName` (string, required) — The patient's family name, 1–40 letters, digits, spaces, apostrophes and hyphens. If the patient has only one name, send it here and send `Onlyname` as `givenName`.
- `givenName` (string, required) — The patient's given name, 1–40 letters, digits, spaces, apostrophes and hyphens. If the patient has only one name, send `Onlyname` here and the name in `familyName`.
- `sex` (enum, required) — Sex, as Services Australia codes it. | Code | Meaning | |------|---------| | `1` | Male | | `2` | Female | | `3` | Another term | | `9` | Not stated |
  - Allowed values: `1`, `2`, `3`, `9`
- `secondInitial` (string, optional) — Optional. The initial of the patient's second given name, a single letter.

### MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaimPatientHealthFund

- `memberNumber` (string, required) — The patient's health fund membership number, 1–19 letters or digits.
- `organisation` (string, required) — The patient's fund code, 3 capital letters. [Fund codes](/health-fund-checks#fund-codes) says where the codes come from.
- `memberRefNumber` (string, optional) — Optional. The patient's Universal Patient Identifier (UPI) on the health fund membership, 1 or 2 digits from `0` to `99`. Leading zeros are allowed.

### MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaimPatientAlsoKnownAs

Optional. The patient's name as the fund holds it, when it differs from `identity`. Leave it out rather than send it empty.

- `familyName` (string, optional) — The family name the fund holds, with the same rules as `identity.familyName`.
- `givenName` (string, optional) — The given name the fund holds, with the same rules as `identity.givenName`.

### MedicareOnlineeligibilitycheckHfV2PostRequestBodyContentApplicationJsonSchemaClaimMedicalEventItemsServiceItems

- `id` (string, required) — The service number, exactly 4 digits such as `0001`, unique across the request.
- `serviceCodeTypeCode` (enum, required) — The kind of item. | Code | Meaning | |------|---------| | `M` | Miscellaneous item | | `P` | Prosthesis |
  - Allowed values: `M`, `P`
- `serviceCode` (string, required) — The code of the prosthesis or miscellaneous item, 1–11 letters or digits. It cannot be `0`.
- `serviceQuantity` (integer, required) — The number of items, from 0 to 99, sent as a JSON number.
- `serviceRate` (integer, required) — The price of one item in cents, sent as a JSON number.
- `chargeAmount` (string, required) — The total charge in cents, sent as a string, from `100` ($1.00) to `999999999`.
- `dateOfService` (date, required) — The date the item is supplied. It cannot be before the accident date, more than 7 days in the past, or before the patient's date of birth.

### MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundClaimEstimationMedicalEventItemsServiceItems

- `id` (string, optional) — The service number you sent.
- `benefit` (integer, optional) — The fund's benefit for the service, in cents.
- `chargeAmount` (string, optional) — The charge you sent, in cents.
- `dateOfService` (date, optional) — The date of service you sent.
- `fundAssessmentCode` (string, optional) — The fund's assessment code for the service, such as `A`.
- `serviceCode` (string, optional) — The item code you sent.
- `serviceCodeTypeCode` (string, optional) — The kind of item you sent.
- `explanation` (list of MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundClaimEstimationMedicalEventItemsServiceItemsExplanationItems, optional) — The fund's explanations for the service.

### MedicareOnlineeligibilitycheckHfV2PostResponsesContentApplicationJsonSchemaHealthFundClaimEstimationMedicalEventItemsServiceItemsExplanationItems

- `code` (string, optional) — The fund's explanation code.
- `text` (string, optional) — The explanation to show the user, exactly as supplied.

## Examples

### Same-Day Admission

**Request**

```json
{
  "claim": {
    "accountReferenceId": "QUOTE0001",
    "compensationClaimInd": "N",
    "facilityId": "9988770W",
    "peaRequestInd": "N",
    "sameDayInd": "Y",
    "submissionAuthorityInd": "Y",
    "typeCode": "ECF",
    "patient": {
      "identity": {
        "dateOfBirth": "1993-08-14",
        "familyName": "NASH",
        "givenName": "Hazel",
        "sex": "2"
      },
      "healthFund": {
        "memberNumber": "1234567",
        "organisation": "TST",
        "memberRefNumber": "1"
      }
    },
    "accident": {
      "accidentInd": "N"
    },
    "medicalEvent": [
      {
        "id": "01",
        "admissionDate": "2027-09-01"
      }
    ],
    "presentingIllnessItemNumber": "30026"
  }
}
```

**Response**

```json
{
  "status": "COMPLETE",
  "correlationId": "urn:uuid:MDE0000023e65f6664814b37",
  "claimSummary": {
    "accountReferenceId": "QUOTE0001"
  },
  "healthFundStatus": {
    "status": {
      "code": 0,
      "text": "Patient is known to the Health Fund specified in the request."
    }
  },
  "healthFundClaimEstimation": {
    "healthFundTable": {
      "tableName": "Basic Hospital",
      "tableDescription": "Hospital cover only",
      "tableScale": "SINGLE"
    },
    "benefitLimitations": "This is to test a return of 100 character entry in the table description or benefit limitations....",
    "financialStatus": "Y",
    "fundAssessmentCode": "A",
    "fundReferenceId": "STS012102",
    "peaPotentialInd": "N",
    "explanation": [
      {
        "code": "1001",
        "text": "Patient to contact Health Fund"
      }
    ],
    "medicalEvent": [
      {
        "id": "01"
      }
    ]
  }
}
```

**SDK Code**

```python Same-Day Admission
import requests

url = "https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2"

payload = { "claim": {
        "accountReferenceId": "QUOTE0001",
        "compensationClaimInd": "N",
        "facilityId": "9988770W",
        "peaRequestInd": "N",
        "sameDayInd": "Y",
        "submissionAuthorityInd": "Y",
        "typeCode": "ECF",
        "patient": {
            "identity": {
                "dateOfBirth": "1993-08-14",
                "familyName": "NASH",
                "givenName": "Hazel",
                "sex": "2"
            },
            "healthFund": {
                "memberNumber": "1234567",
                "organisation": "TST",
                "memberRefNumber": "1"
            }
        },
        "accident": { "accidentInd": "N" },
        "medicalEvent": [
            {
                "id": "01",
                "admissionDate": "2027-09-01"
            }
        ],
        "presentingIllnessItemNumber": "30026"
    } }
headers = {
    "x-minor-id": "<minorId>",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Same-Day Admission
const url = 'https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2';
const options = {
  method: 'POST',
  headers: {
    'x-minor-id': '<minorId>',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"claim":{"accountReferenceId":"QUOTE0001","compensationClaimInd":"N","facilityId":"9988770W","peaRequestInd":"N","sameDayInd":"Y","submissionAuthorityInd":"Y","typeCode":"ECF","patient":{"identity":{"dateOfBirth":"1993-08-14","familyName":"NASH","givenName":"Hazel","sex":"2"},"healthFund":{"memberNumber":"1234567","organisation":"TST","memberRefNumber":"1"}},"accident":{"accidentInd":"N"},"medicalEvent":[{"id":"01","admissionDate":"2027-09-01"}],"presentingIllnessItemNumber":"30026"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Same-Day Admission
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2"

	payload := strings.NewReader("{\n  \"claim\": {\n    \"accountReferenceId\": \"QUOTE0001\",\n    \"compensationClaimInd\": \"N\",\n    \"facilityId\": \"9988770W\",\n    \"peaRequestInd\": \"N\",\n    \"sameDayInd\": \"Y\",\n    \"submissionAuthorityInd\": \"Y\",\n    \"typeCode\": \"ECF\",\n    \"patient\": {\n      \"identity\": {\n        \"dateOfBirth\": \"1993-08-14\",\n        \"familyName\": \"NASH\",\n        \"givenName\": \"Hazel\",\n        \"sex\": \"2\"\n      },\n      \"healthFund\": {\n        \"memberNumber\": \"1234567\",\n        \"organisation\": \"TST\",\n        \"memberRefNumber\": \"1\"\n      }\n    },\n    \"accident\": {\n      \"accidentInd\": \"N\"\n    },\n    \"medicalEvent\": [\n      {\n        \"id\": \"01\",\n        \"admissionDate\": \"2027-09-01\"\n      }\n    ],\n    \"presentingIllnessItemNumber\": \"30026\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-minor-id", "<minorId>")
	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Same-Day Admission
require 'uri'
require 'net/http'

url = URI("https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-minor-id"] = '<minorId>'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"claim\": {\n    \"accountReferenceId\": \"QUOTE0001\",\n    \"compensationClaimInd\": \"N\",\n    \"facilityId\": \"9988770W\",\n    \"peaRequestInd\": \"N\",\n    \"sameDayInd\": \"Y\",\n    \"submissionAuthorityInd\": \"Y\",\n    \"typeCode\": \"ECF\",\n    \"patient\": {\n      \"identity\": {\n        \"dateOfBirth\": \"1993-08-14\",\n        \"familyName\": \"NASH\",\n        \"givenName\": \"Hazel\",\n        \"sex\": \"2\"\n      },\n      \"healthFund\": {\n        \"memberNumber\": \"1234567\",\n        \"organisation\": \"TST\",\n        \"memberRefNumber\": \"1\"\n      }\n    },\n    \"accident\": {\n      \"accidentInd\": \"N\"\n    },\n    \"medicalEvent\": [\n      {\n        \"id\": \"01\",\n        \"admissionDate\": \"2027-09-01\"\n      }\n    ],\n    \"presentingIllnessItemNumber\": \"30026\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Same-Day Admission
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2")
  .header("x-minor-id", "<minorId>")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"claim\": {\n    \"accountReferenceId\": \"QUOTE0001\",\n    \"compensationClaimInd\": \"N\",\n    \"facilityId\": \"9988770W\",\n    \"peaRequestInd\": \"N\",\n    \"sameDayInd\": \"Y\",\n    \"submissionAuthorityInd\": \"Y\",\n    \"typeCode\": \"ECF\",\n    \"patient\": {\n      \"identity\": {\n        \"dateOfBirth\": \"1993-08-14\",\n        \"familyName\": \"NASH\",\n        \"givenName\": \"Hazel\",\n        \"sex\": \"2\"\n      },\n      \"healthFund\": {\n        \"memberNumber\": \"1234567\",\n        \"organisation\": \"TST\",\n        \"memberRefNumber\": \"1\"\n      }\n    },\n    \"accident\": {\n      \"accidentInd\": \"N\"\n    },\n    \"medicalEvent\": [\n      {\n        \"id\": \"01\",\n        \"admissionDate\": \"2027-09-01\"\n      }\n    ],\n    \"presentingIllnessItemNumber\": \"30026\"\n  }\n}")
  .asString();
```

```php Same-Day Admission
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2', [
  'body' => '{
  "claim": {
    "accountReferenceId": "QUOTE0001",
    "compensationClaimInd": "N",
    "facilityId": "9988770W",
    "peaRequestInd": "N",
    "sameDayInd": "Y",
    "submissionAuthorityInd": "Y",
    "typeCode": "ECF",
    "patient": {
      "identity": {
        "dateOfBirth": "1993-08-14",
        "familyName": "NASH",
        "givenName": "Hazel",
        "sex": "2"
      },
      "healthFund": {
        "memberNumber": "1234567",
        "organisation": "TST",
        "memberRefNumber": "1"
      }
    },
    "accident": {
      "accidentInd": "N"
    },
    "medicalEvent": [
      {
        "id": "01",
        "admissionDate": "2027-09-01"
      }
    ],
    "presentingIllnessItemNumber": "30026"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
    'x-minor-id' => '<minorId>',
  ],
]);

echo $response->getBody();
```

```csharp Same-Day Admission
using RestSharp;

var client = new RestClient("https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2");
var request = new RestRequest(Method.POST);
request.AddHeader("x-minor-id", "<minorId>");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"claim\": {\n    \"accountReferenceId\": \"QUOTE0001\",\n    \"compensationClaimInd\": \"N\",\n    \"facilityId\": \"9988770W\",\n    \"peaRequestInd\": \"N\",\n    \"sameDayInd\": \"Y\",\n    \"submissionAuthorityInd\": \"Y\",\n    \"typeCode\": \"ECF\",\n    \"patient\": {\n      \"identity\": {\n        \"dateOfBirth\": \"1993-08-14\",\n        \"familyName\": \"NASH\",\n        \"givenName\": \"Hazel\",\n        \"sex\": \"2\"\n      },\n      \"healthFund\": {\n        \"memberNumber\": \"1234567\",\n        \"organisation\": \"TST\",\n        \"memberRefNumber\": \"1\"\n      }\n    },\n    \"accident\": {\n      \"accidentInd\": \"N\"\n    },\n    \"medicalEvent\": [\n      {\n        \"id\": \"01\",\n        \"admissionDate\": \"2027-09-01\"\n      }\n    ],\n    \"presentingIllnessItemNumber\": \"30026\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Same-Day Admission
import Foundation

let headers = [
  "x-minor-id": "<minorId>",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["claim": [
    "accountReferenceId": "QUOTE0001",
    "compensationClaimInd": "N",
    "facilityId": "9988770W",
    "peaRequestInd": "N",
    "sameDayInd": "Y",
    "submissionAuthorityInd": "Y",
    "typeCode": "ECF",
    "patient": [
      "identity": [
        "dateOfBirth": "1993-08-14",
        "familyName": "NASH",
        "givenName": "Hazel",
        "sex": "2"
      ],
      "healthFund": [
        "memberNumber": "1234567",
        "organisation": "TST",
        "memberRefNumber": "1"
      ]
    ],
    "accident": ["accidentInd": "N"],
    "medicalEvent": [
      [
        "id": "01",
        "admissionDate": "2027-09-01"
      ]
    ],
    "presentingIllnessItemNumber": "30026"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Overnight Admission

**Request**

```json
{
  "claim": {
    "accountReferenceId": "QUOTE0002",
    "compensationClaimInd": "N",
    "facilityId": "9988770W",
    "peaRequestInd": "Y",
    "sameDayInd": "N",
    "submissionAuthorityInd": "Y",
    "typeCode": "ECF",
    "patient": {
      "identity": {
        "dateOfBirth": "1993-08-14",
        "familyName": "NASH",
        "givenName": "Hazel",
        "sex": "2"
      },
      "healthFund": {
        "memberNumber": "1234567",
        "organisation": "TST",
        "memberRefNumber": "1"
      }
    },
    "accident": {
      "accidentInd": "N"
    },
    "medicalEvent": [
      {
        "id": "01",
        "admissionDate": "2027-09-01",
        "dischargeDate": "2027-09-04"
      }
    ],
    "emergencyAdmissionInd": "N",
    "lengthOfStay": 3,
    "presentingIllnessItemNumber": "30026"
  }
}
```

**Response**

```json
{
  "status": "COMPLETE",
  "correlationId": "urn:uuid:MDE000004ad751d1a6e34c81",
  "claimSummary": {
    "accountReferenceId": "QUOTE0002"
  },
  "healthFundStatus": {
    "status": {
      "code": 0,
      "text": "Patient is known to the Health Fund specified in the request."
    }
  },
  "healthFundClaimEstimation": {
    "healthFundTable": {
      "tableName": "Basic Hospital",
      "tableDescription": "Hospital cover only",
      "tableScale": "SINGLE"
    },
    "benefitLimitations": "This is to test a return of 100 character entry in the table description or benefit limitations....",
    "financialStatus": "Y",
    "fundAssessmentCode": "A",
    "fundReferenceId": "STS012102",
    "peaPotentialInd": "N",
    "explanation": [
      {
        "code": "1001",
        "text": "Patient to contact Health Fund"
      }
    ],
    "medicalEvent": [
      {
        "id": "01"
      }
    ]
  }
}
```

**SDK Code**

```python Overnight Admission
import requests

url = "https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2"

payload = { "claim": {
        "accountReferenceId": "QUOTE0002",
        "compensationClaimInd": "N",
        "facilityId": "9988770W",
        "peaRequestInd": "Y",
        "sameDayInd": "N",
        "submissionAuthorityInd": "Y",
        "typeCode": "ECF",
        "patient": {
            "identity": {
                "dateOfBirth": "1993-08-14",
                "familyName": "NASH",
                "givenName": "Hazel",
                "sex": "2"
            },
            "healthFund": {
                "memberNumber": "1234567",
                "organisation": "TST",
                "memberRefNumber": "1"
            }
        },
        "accident": { "accidentInd": "N" },
        "medicalEvent": [
            {
                "id": "01",
                "admissionDate": "2027-09-01",
                "dischargeDate": "2027-09-04"
            }
        ],
        "emergencyAdmissionInd": "N",
        "lengthOfStay": 3,
        "presentingIllnessItemNumber": "30026"
    } }
headers = {
    "x-minor-id": "<minorId>",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Overnight Admission
const url = 'https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2';
const options = {
  method: 'POST',
  headers: {
    'x-minor-id': '<minorId>',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"claim":{"accountReferenceId":"QUOTE0002","compensationClaimInd":"N","facilityId":"9988770W","peaRequestInd":"Y","sameDayInd":"N","submissionAuthorityInd":"Y","typeCode":"ECF","patient":{"identity":{"dateOfBirth":"1993-08-14","familyName":"NASH","givenName":"Hazel","sex":"2"},"healthFund":{"memberNumber":"1234567","organisation":"TST","memberRefNumber":"1"}},"accident":{"accidentInd":"N"},"medicalEvent":[{"id":"01","admissionDate":"2027-09-01","dischargeDate":"2027-09-04"}],"emergencyAdmissionInd":"N","lengthOfStay":3,"presentingIllnessItemNumber":"30026"}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Overnight Admission
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2"

	payload := strings.NewReader("{\n  \"claim\": {\n    \"accountReferenceId\": \"QUOTE0002\",\n    \"compensationClaimInd\": \"N\",\n    \"facilityId\": \"9988770W\",\n    \"peaRequestInd\": \"Y\",\n    \"sameDayInd\": \"N\",\n    \"submissionAuthorityInd\": \"Y\",\n    \"typeCode\": \"ECF\",\n    \"patient\": {\n      \"identity\": {\n        \"dateOfBirth\": \"1993-08-14\",\n        \"familyName\": \"NASH\",\n        \"givenName\": \"Hazel\",\n        \"sex\": \"2\"\n      },\n      \"healthFund\": {\n        \"memberNumber\": \"1234567\",\n        \"organisation\": \"TST\",\n        \"memberRefNumber\": \"1\"\n      }\n    },\n    \"accident\": {\n      \"accidentInd\": \"N\"\n    },\n    \"medicalEvent\": [\n      {\n        \"id\": \"01\",\n        \"admissionDate\": \"2027-09-01\",\n        \"dischargeDate\": \"2027-09-04\"\n      }\n    ],\n    \"emergencyAdmissionInd\": \"N\",\n    \"lengthOfStay\": 3,\n    \"presentingIllnessItemNumber\": \"30026\"\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-minor-id", "<minorId>")
	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Overnight Admission
require 'uri'
require 'net/http'

url = URI("https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-minor-id"] = '<minorId>'
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"claim\": {\n    \"accountReferenceId\": \"QUOTE0002\",\n    \"compensationClaimInd\": \"N\",\n    \"facilityId\": \"9988770W\",\n    \"peaRequestInd\": \"Y\",\n    \"sameDayInd\": \"N\",\n    \"submissionAuthorityInd\": \"Y\",\n    \"typeCode\": \"ECF\",\n    \"patient\": {\n      \"identity\": {\n        \"dateOfBirth\": \"1993-08-14\",\n        \"familyName\": \"NASH\",\n        \"givenName\": \"Hazel\",\n        \"sex\": \"2\"\n      },\n      \"healthFund\": {\n        \"memberNumber\": \"1234567\",\n        \"organisation\": \"TST\",\n        \"memberRefNumber\": \"1\"\n      }\n    },\n    \"accident\": {\n      \"accidentInd\": \"N\"\n    },\n    \"medicalEvent\": [\n      {\n        \"id\": \"01\",\n        \"admissionDate\": \"2027-09-01\",\n        \"dischargeDate\": \"2027-09-04\"\n      }\n    ],\n    \"emergencyAdmissionInd\": \"N\",\n    \"lengthOfStay\": 3,\n    \"presentingIllnessItemNumber\": \"30026\"\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Overnight Admission
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2")
  .header("x-minor-id", "<minorId>")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"claim\": {\n    \"accountReferenceId\": \"QUOTE0002\",\n    \"compensationClaimInd\": \"N\",\n    \"facilityId\": \"9988770W\",\n    \"peaRequestInd\": \"Y\",\n    \"sameDayInd\": \"N\",\n    \"submissionAuthorityInd\": \"Y\",\n    \"typeCode\": \"ECF\",\n    \"patient\": {\n      \"identity\": {\n        \"dateOfBirth\": \"1993-08-14\",\n        \"familyName\": \"NASH\",\n        \"givenName\": \"Hazel\",\n        \"sex\": \"2\"\n      },\n      \"healthFund\": {\n        \"memberNumber\": \"1234567\",\n        \"organisation\": \"TST\",\n        \"memberRefNumber\": \"1\"\n      }\n    },\n    \"accident\": {\n      \"accidentInd\": \"N\"\n    },\n    \"medicalEvent\": [\n      {\n        \"id\": \"01\",\n        \"admissionDate\": \"2027-09-01\",\n        \"dischargeDate\": \"2027-09-04\"\n      }\n    ],\n    \"emergencyAdmissionInd\": \"N\",\n    \"lengthOfStay\": 3,\n    \"presentingIllnessItemNumber\": \"30026\"\n  }\n}")
  .asString();
```

```php Overnight Admission
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2', [
  'body' => '{
  "claim": {
    "accountReferenceId": "QUOTE0002",
    "compensationClaimInd": "N",
    "facilityId": "9988770W",
    "peaRequestInd": "Y",
    "sameDayInd": "N",
    "submissionAuthorityInd": "Y",
    "typeCode": "ECF",
    "patient": {
      "identity": {
        "dateOfBirth": "1993-08-14",
        "familyName": "NASH",
        "givenName": "Hazel",
        "sex": "2"
      },
      "healthFund": {
        "memberNumber": "1234567",
        "organisation": "TST",
        "memberRefNumber": "1"
      }
    },
    "accident": {
      "accidentInd": "N"
    },
    "medicalEvent": [
      {
        "id": "01",
        "admissionDate": "2027-09-01",
        "dischargeDate": "2027-09-04"
      }
    ],
    "emergencyAdmissionInd": "N",
    "lengthOfStay": 3,
    "presentingIllnessItemNumber": "30026"
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
    'x-minor-id' => '<minorId>',
  ],
]);

echo $response->getBody();
```

```csharp Overnight Admission
using RestSharp;

var client = new RestClient("https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2");
var request = new RestRequest(Method.POST);
request.AddHeader("x-minor-id", "<minorId>");
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"claim\": {\n    \"accountReferenceId\": \"QUOTE0002\",\n    \"compensationClaimInd\": \"N\",\n    \"facilityId\": \"9988770W\",\n    \"peaRequestInd\": \"Y\",\n    \"sameDayInd\": \"N\",\n    \"submissionAuthorityInd\": \"Y\",\n    \"typeCode\": \"ECF\",\n    \"patient\": {\n      \"identity\": {\n        \"dateOfBirth\": \"1993-08-14\",\n        \"familyName\": \"NASH\",\n        \"givenName\": \"Hazel\",\n        \"sex\": \"2\"\n      },\n      \"healthFund\": {\n        \"memberNumber\": \"1234567\",\n        \"organisation\": \"TST\",\n        \"memberRefNumber\": \"1\"\n      }\n    },\n    \"accident\": {\n      \"accidentInd\": \"N\"\n    },\n    \"medicalEvent\": [\n      {\n        \"id\": \"01\",\n        \"admissionDate\": \"2027-09-01\",\n        \"dischargeDate\": \"2027-09-04\"\n      }\n    ],\n    \"emergencyAdmissionInd\": \"N\",\n    \"lengthOfStay\": 3,\n    \"presentingIllnessItemNumber\": \"30026\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Overnight Admission
import Foundation

let headers = [
  "x-minor-id": "<minorId>",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["claim": [
    "accountReferenceId": "QUOTE0002",
    "compensationClaimInd": "N",
    "facilityId": "9988770W",
    "peaRequestInd": "Y",
    "sameDayInd": "N",
    "submissionAuthorityInd": "Y",
    "typeCode": "ECF",
    "patient": [
      "identity": [
        "dateOfBirth": "1993-08-14",
        "familyName": "NASH",
        "givenName": "Hazel",
        "sex": "2"
      ],
      "healthFund": [
        "memberNumber": "1234567",
        "organisation": "TST",
        "memberRefNumber": "1"
      ]
    ],
    "accident": ["accidentInd": "N"],
    "medicalEvent": [
      [
        "id": "01",
        "admissionDate": "2027-09-01",
        "dischargeDate": "2027-09-04"
      ]
    ],
    "emergencyAdmissionInd": "N",
    "lengthOfStay": 3,
    "presentingIllnessItemNumber": "30026"
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://test-api.rebateright.com.au/Medicare/onlineeligibilitycheck/hf/v2")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```