> 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.

# Medicare and Health Fund Verification

POST https://test-api.rebateright.com.au/Medicare/patientverification/v1
Content-Type: application/json

**Does this patient match Medicare and their health fund?**

That is the question this endpoint answers in one request, from the patient's details, their
Medicare card and their health fund membership card.

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

Medicare checks the patient first. The health fund checks the membership only when Medicare
returns code `0`. Any other Medicare code, including a partial match such as a corrected
Individual Reference Number (IRN), skips the fund check and returns health fund code `9674`.

The fund checks the membership as at `dateOfService`.

Send `typeCode` as `OPV`. To check the health fund alone, use
[Health Fund Verification](/api-reference/health-funds/health-fund-verification). To check
Medicare alone, use [Patient Verification](/api-reference/medicare-eligibility/patient-verification).

#### Common Medicare status codes (`medicareStatus.status.code`)

| Code             | Meaning                                                                                                                                    |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `0`              | Patient matched on Medicare                                                                                                                |
| `8015` to `8022` | Accepted, but not an exact match. `text` names the detail to check. For a wrong IRN (`8016`), `currentMembership` holds the correct value. |
| `9633`           | A new Medicare card has been issued, so the details differ from Medicare's records                                                         |
| `9650`           | The card number or the patient details did not match Medicare                                                                              |

#### Health fund status codes (`healthFundStatus.status.code`)

`0` means the fund holds the membership. `9674` means the fund check was skipped, because
Medicare returned a code other than `0`. [Health Fund Verification](/api-reference/health-funds/health-fund-verification)
lists the other codes a fund returns.

#### Validation errors (`400`)

| Code                          | Meaning                                                                                                                                                        |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `9202`                        | A submitted field failed its checks. The `reason` in `serviceMessage` names the field and the problem.                                                         |
| `2030`                        | The request does not fit this check. `typeCode` is not `OPV`, `medicare` or `healthFund` is missing, or `dateOfService` is before the patient's date of birth. |
| `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.                 |

#### Using this check

[Patient verification](/health-fund-checks#patient-verification) sets out the hospital cover rule,
and how Services Australia requires software to use this check.

**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/medicare-and-health-fund-verification

## 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.

- `patient` (MedicarePatientverificationV1PostRequestBodyContentApplicationJsonSchemaPatient, required)
- `typeCode` (enum, required) — Must be `OPV` on this endpoint. Any other value returns `400` with code `2030`. | Code | Meaning | |------|---------| | `OPV` | Medicare and health fund |
  - Allowed values: `OPV`
- `dateOfService` (date, optional) — Optional. The date Medicare and the fund check the details against. Defaults to today when omitted. It cannot be in the future, 2 years or more in the past, or before the patient's date of birth.

## Response

### 200

OK

- `correlationId` (string, required) — Unique identifier for this transaction. Use it for tracing and support.
- `medicareStatus` (MedicarePatientverificationV1PostResponsesContentApplicationJsonSchemaMedicareStatus, required) — The outcome of the Medicare check.
- `healthFundStatus` (MedicarePatientverificationV1PostResponsesContentApplicationJsonSchemaHealthFundStatus, required) — The outcome of the health fund check. It carries code `9674` when the fund check was skipped.

## 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`.

- `PostMedicarePatientverificationV1RequestBadRequestError`

## Types

### MedicarePatientverificationV1PostRequestBodyContentApplicationJsonSchemaPatient

- `identity` (MedicarePatientverificationV1PostRequestBodyContentApplicationJsonSchemaPatientIdentity, required)
- `medicare` (MedicarePatientverificationV1PostRequestBodyContentApplicationJsonSchemaPatientMedicare, required)
- `healthFund` (MedicarePatientverificationV1PostRequestBodyContentApplicationJsonSchemaPatientHealthFund, required)
- `alsoKnownAs` (MedicarePatientverificationV1PostRequestBodyContentApplicationJsonSchemaPatientAlsoKnownAs, optional) — Optional. The patient's name as the fund holds it, when it differs from the name Medicare holds. Leave it out rather than send it empty.

### MedicarePatientverificationV1PostResponsesContentApplicationJsonSchemaMedicareStatus

The outcome of the Medicare check.

- `status` (MedicarePatientverificationV1PostResponsesContentApplicationJsonSchemaMedicareStatusStatus, optional)
- `currentMembership` (MedicarePatientverificationV1PostResponsesContentApplicationJsonSchemaMedicareStatusCurrentMembership, optional) — Present when the patient's Medicare card details differ from what was submitted.
- `currentMember` (MedicarePatientverificationV1PostResponsesContentApplicationJsonSchemaMedicareStatusCurrentMember, optional) — Present when the patient's name on Medicare differs from what was submitted.

### MedicarePatientverificationV1PostResponsesContentApplicationJsonSchemaHealthFundStatus

The outcome of the health fund check. It carries code `9674` when the fund check was skipped.

- `status` (MedicarePatientverificationV1PostResponsesContentApplicationJsonSchemaHealthFundStatusStatus, optional)

### Service message

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

### Structure error

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

### MedicarePatientverificationV1PostRequestBodyContentApplicationJsonSchemaPatientIdentity

- `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 or inadequately described |
  - Allowed values: `1`, `2`, `3`, `9`
- `secondInitial` (string, optional) — Optional. The initial of the patient's second given name, a single letter.

### MedicarePatientverificationV1PostRequestBodyContentApplicationJsonSchemaPatientMedicare

- `memberNumber` (string, required) — The patient's 10-digit Medicare card number. It must pass the Medicare check-digit routine, and its 10th digit cannot be `0`.
- `memberRefNumber` (string, required) — The patient's Individual Reference Number (IRN), the digit from 1 to 9 beside their name on the card.

### MedicarePatientverificationV1PostRequestBodyContentApplicationJsonSchemaPatientHealthFund

- `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.

### MedicarePatientverificationV1PostRequestBodyContentApplicationJsonSchemaPatientAlsoKnownAs

Optional. The patient's name as the fund holds it, when it differs from the name Medicare holds. 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`.

### MedicarePatientverificationV1PostResponsesContentApplicationJsonSchemaMedicareStatusStatus

- `code` (integer, required) — Medicare status code, such as `0` for a match or `8016` for a wrong IRN.
- `text` (string, required) — The message to show the user, exactly as supplied.

### MedicarePatientverificationV1PostResponsesContentApplicationJsonSchemaMedicareStatusCurrentMembership

Present when the patient's Medicare card details differ from what was submitted.

- `memberNumber` (string, optional) — Corrected Medicare card number.
- `memberRefNumber` (string, optional) — Corrected IRN.

### MedicarePatientverificationV1PostResponsesContentApplicationJsonSchemaMedicareStatusCurrentMember

Present when the patient's name on Medicare differs from what was submitted.

- `givenName` (string, optional) — Patient's given name as held by Medicare.

### MedicarePatientverificationV1PostResponsesContentApplicationJsonSchemaHealthFundStatusStatus

- `code` (integer, required) — Health fund status code, such as `0` when the fund holds the membership.
- `text` (string, required) — The message to show the user, exactly as supplied.

### MedicarePatientverificationV1PostResponsesContentApplicationJsonSchemaOneOf0ServiceMessageItems

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

## Examples

### Both Matched

**Request**

```json
{
  "patient": {
    "identity": {
      "dateOfBirth": "1993-08-14",
      "familyName": "NASH",
      "givenName": "Hazel",
      "sex": "2"
    },
    "medicare": {
      "memberNumber": "2954536421",
      "memberRefNumber": "1"
    },
    "healthFund": {
      "memberNumber": "1234567",
      "organisation": "TST",
      "memberRefNumber": "1"
    }
  },
  "typeCode": "OPV",
  "dateOfService": "2026-10-21"
}
```

**Response**

```json
{
  "correlationId": "urn:uuid:MDE00000fe1f8c78043246cd",
  "medicareStatus": {
    "status": {
      "code": 0,
      "text": "Patient is eligible to claim for Medicare with details provided."
    }
  },
  "healthFundStatus": {
    "status": {
      "code": 0,
      "text": "Patient is known to the Health Fund specified in the request."
    }
  }
}
```

**SDK Code**

```python Both Matched
import requests

url = "https://test-api.rebateright.com.au/Medicare/patientverification/v1"

payload = {
    "patient": {
        "identity": {
            "dateOfBirth": "1993-08-14",
            "familyName": "NASH",
            "givenName": "Hazel",
            "sex": "2"
        },
        "medicare": {
            "memberNumber": "2954536421",
            "memberRefNumber": "1"
        },
        "healthFund": {
            "memberNumber": "1234567",
            "organisation": "TST",
            "memberRefNumber": "1"
        }
    },
    "typeCode": "OPV",
    "dateOfService": "2026-10-21"
}
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 Both Matched
const url = 'https://test-api.rebateright.com.au/Medicare/patientverification/v1';
const options = {
  method: 'POST',
  headers: {
    'x-minor-id': '<minorId>',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"patient":{"identity":{"dateOfBirth":"1993-08-14","familyName":"NASH","givenName":"Hazel","sex":"2"},"medicare":{"memberNumber":"2954536421","memberRefNumber":"1"},"healthFund":{"memberNumber":"1234567","organisation":"TST","memberRefNumber":"1"}},"typeCode":"OPV","dateOfService":"2026-10-21"}'
};

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

```go Both Matched
package main

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

func main() {

	url := "https://test-api.rebateright.com.au/Medicare/patientverification/v1"

	payload := strings.NewReader("{\n  \"patient\": {\n    \"identity\": {\n      \"dateOfBirth\": \"1993-08-14\",\n      \"familyName\": \"NASH\",\n      \"givenName\": \"Hazel\",\n      \"sex\": \"2\"\n    },\n    \"medicare\": {\n      \"memberNumber\": \"2954536421\",\n      \"memberRefNumber\": \"1\"\n    },\n    \"healthFund\": {\n      \"memberNumber\": \"1234567\",\n      \"organisation\": \"TST\",\n      \"memberRefNumber\": \"1\"\n    }\n  },\n  \"typeCode\": \"OPV\",\n  \"dateOfService\": \"2026-10-21\"\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 Both Matched
require 'uri'
require 'net/http'

url = URI("https://test-api.rebateright.com.au/Medicare/patientverification/v1")

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  \"patient\": {\n    \"identity\": {\n      \"dateOfBirth\": \"1993-08-14\",\n      \"familyName\": \"NASH\",\n      \"givenName\": \"Hazel\",\n      \"sex\": \"2\"\n    },\n    \"medicare\": {\n      \"memberNumber\": \"2954536421\",\n      \"memberRefNumber\": \"1\"\n    },\n    \"healthFund\": {\n      \"memberNumber\": \"1234567\",\n      \"organisation\": \"TST\",\n      \"memberRefNumber\": \"1\"\n    }\n  },\n  \"typeCode\": \"OPV\",\n  \"dateOfService\": \"2026-10-21\"\n}"

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

```java Both Matched
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://test-api.rebateright.com.au/Medicare/patientverification/v1")
  .header("x-minor-id", "<minorId>")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"patient\": {\n    \"identity\": {\n      \"dateOfBirth\": \"1993-08-14\",\n      \"familyName\": \"NASH\",\n      \"givenName\": \"Hazel\",\n      \"sex\": \"2\"\n    },\n    \"medicare\": {\n      \"memberNumber\": \"2954536421\",\n      \"memberRefNumber\": \"1\"\n    },\n    \"healthFund\": {\n      \"memberNumber\": \"1234567\",\n      \"organisation\": \"TST\",\n      \"memberRefNumber\": \"1\"\n    }\n  },\n  \"typeCode\": \"OPV\",\n  \"dateOfService\": \"2026-10-21\"\n}")
  .asString();
```

```php Both Matched
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://test-api.rebateright.com.au/Medicare/patientverification/v1', [
  'body' => '{
  "patient": {
    "identity": {
      "dateOfBirth": "1993-08-14",
      "familyName": "NASH",
      "givenName": "Hazel",
      "sex": "2"
    },
    "medicare": {
      "memberNumber": "2954536421",
      "memberRefNumber": "1"
    },
    "healthFund": {
      "memberNumber": "1234567",
      "organisation": "TST",
      "memberRefNumber": "1"
    }
  },
  "typeCode": "OPV",
  "dateOfService": "2026-10-21"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
    'x-minor-id' => '<minorId>',
  ],
]);

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

```csharp Both Matched
using RestSharp;

var client = new RestClient("https://test-api.rebateright.com.au/Medicare/patientverification/v1");
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  \"patient\": {\n    \"identity\": {\n      \"dateOfBirth\": \"1993-08-14\",\n      \"familyName\": \"NASH\",\n      \"givenName\": \"Hazel\",\n      \"sex\": \"2\"\n    },\n    \"medicare\": {\n      \"memberNumber\": \"2954536421\",\n      \"memberRefNumber\": \"1\"\n    },\n    \"healthFund\": {\n      \"memberNumber\": \"1234567\",\n      \"organisation\": \"TST\",\n      \"memberRefNumber\": \"1\"\n    }\n  },\n  \"typeCode\": \"OPV\",\n  \"dateOfService\": \"2026-10-21\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Both Matched
import Foundation

let headers = [
  "x-minor-id": "<minorId>",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "patient": [
    "identity": [
      "dateOfBirth": "1993-08-14",
      "familyName": "NASH",
      "givenName": "Hazel",
      "sex": "2"
    ],
    "medicare": [
      "memberNumber": "2954536421",
      "memberRefNumber": "1"
    ],
    "healthFund": [
      "memberNumber": "1234567",
      "organisation": "TST",
      "memberRefNumber": "1"
    ]
  ],
  "typeCode": "OPV",
  "dateOfService": "2026-10-21"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://test-api.rebateright.com.au/Medicare/patientverification/v1")! 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()
```

### IRN Corrected

**Request**

```json
{
  "patient": {
    "identity": {
      "dateOfBirth": "1993-08-14",
      "familyName": "NASH",
      "givenName": "Hazel",
      "sex": "2"
    },
    "medicare": {
      "memberNumber": "2954536421",
      "memberRefNumber": "2"
    },
    "healthFund": {
      "memberNumber": "1234567",
      "organisation": "TST",
      "memberRefNumber": "1"
    }
  },
  "typeCode": "OPV",
  "dateOfService": "2026-10-21"
}
```

**Response**

```json
{
  "correlationId": "urn:uuid:MDE000009e01bdceca224fb3",
  "medicareStatus": {
    "status": {
      "code": 8016,
      "text": "Patient Verification has been accepted however patient details were not an exact match. Please check patient Individual Reference Number (IRN) before claiming."
    },
    "currentMembership": {
      "memberRefNumber": "1"
    }
  },
  "healthFundStatus": {
    "status": {
      "code": 9674,
      "text": "Fund patient validation not undertaken as the Medicare validation was unsuccessful."
    }
  }
}
```

**SDK Code**

```python IRN Corrected
import requests

url = "https://test-api.rebateright.com.au/Medicare/patientverification/v1"

payload = {
    "patient": {
        "identity": {
            "dateOfBirth": "1993-08-14",
            "familyName": "NASH",
            "givenName": "Hazel",
            "sex": "2"
        },
        "medicare": {
            "memberNumber": "2954536421",
            "memberRefNumber": "2"
        },
        "healthFund": {
            "memberNumber": "1234567",
            "organisation": "TST",
            "memberRefNumber": "1"
        }
    },
    "typeCode": "OPV",
    "dateOfService": "2026-10-21"
}
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 IRN Corrected
const url = 'https://test-api.rebateright.com.au/Medicare/patientverification/v1';
const options = {
  method: 'POST',
  headers: {
    'x-minor-id': '<minorId>',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"patient":{"identity":{"dateOfBirth":"1993-08-14","familyName":"NASH","givenName":"Hazel","sex":"2"},"medicare":{"memberNumber":"2954536421","memberRefNumber":"2"},"healthFund":{"memberNumber":"1234567","organisation":"TST","memberRefNumber":"1"}},"typeCode":"OPV","dateOfService":"2026-10-21"}'
};

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

```go IRN Corrected
package main

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

func main() {

	url := "https://test-api.rebateright.com.au/Medicare/patientverification/v1"

	payload := strings.NewReader("{\n  \"patient\": {\n    \"identity\": {\n      \"dateOfBirth\": \"1993-08-14\",\n      \"familyName\": \"NASH\",\n      \"givenName\": \"Hazel\",\n      \"sex\": \"2\"\n    },\n    \"medicare\": {\n      \"memberNumber\": \"2954536421\",\n      \"memberRefNumber\": \"2\"\n    },\n    \"healthFund\": {\n      \"memberNumber\": \"1234567\",\n      \"organisation\": \"TST\",\n      \"memberRefNumber\": \"1\"\n    }\n  },\n  \"typeCode\": \"OPV\",\n  \"dateOfService\": \"2026-10-21\"\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 IRN Corrected
require 'uri'
require 'net/http'

url = URI("https://test-api.rebateright.com.au/Medicare/patientverification/v1")

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  \"patient\": {\n    \"identity\": {\n      \"dateOfBirth\": \"1993-08-14\",\n      \"familyName\": \"NASH\",\n      \"givenName\": \"Hazel\",\n      \"sex\": \"2\"\n    },\n    \"medicare\": {\n      \"memberNumber\": \"2954536421\",\n      \"memberRefNumber\": \"2\"\n    },\n    \"healthFund\": {\n      \"memberNumber\": \"1234567\",\n      \"organisation\": \"TST\",\n      \"memberRefNumber\": \"1\"\n    }\n  },\n  \"typeCode\": \"OPV\",\n  \"dateOfService\": \"2026-10-21\"\n}"

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

```java IRN Corrected
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://test-api.rebateright.com.au/Medicare/patientverification/v1")
  .header("x-minor-id", "<minorId>")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"patient\": {\n    \"identity\": {\n      \"dateOfBirth\": \"1993-08-14\",\n      \"familyName\": \"NASH\",\n      \"givenName\": \"Hazel\",\n      \"sex\": \"2\"\n    },\n    \"medicare\": {\n      \"memberNumber\": \"2954536421\",\n      \"memberRefNumber\": \"2\"\n    },\n    \"healthFund\": {\n      \"memberNumber\": \"1234567\",\n      \"organisation\": \"TST\",\n      \"memberRefNumber\": \"1\"\n    }\n  },\n  \"typeCode\": \"OPV\",\n  \"dateOfService\": \"2026-10-21\"\n}")
  .asString();
```

```php IRN Corrected
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://test-api.rebateright.com.au/Medicare/patientverification/v1', [
  'body' => '{
  "patient": {
    "identity": {
      "dateOfBirth": "1993-08-14",
      "familyName": "NASH",
      "givenName": "Hazel",
      "sex": "2"
    },
    "medicare": {
      "memberNumber": "2954536421",
      "memberRefNumber": "2"
    },
    "healthFund": {
      "memberNumber": "1234567",
      "organisation": "TST",
      "memberRefNumber": "1"
    }
  },
  "typeCode": "OPV",
  "dateOfService": "2026-10-21"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
    'x-minor-id' => '<minorId>',
  ],
]);

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

```csharp IRN Corrected
using RestSharp;

var client = new RestClient("https://test-api.rebateright.com.au/Medicare/patientverification/v1");
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  \"patient\": {\n    \"identity\": {\n      \"dateOfBirth\": \"1993-08-14\",\n      \"familyName\": \"NASH\",\n      \"givenName\": \"Hazel\",\n      \"sex\": \"2\"\n    },\n    \"medicare\": {\n      \"memberNumber\": \"2954536421\",\n      \"memberRefNumber\": \"2\"\n    },\n    \"healthFund\": {\n      \"memberNumber\": \"1234567\",\n      \"organisation\": \"TST\",\n      \"memberRefNumber\": \"1\"\n    }\n  },\n  \"typeCode\": \"OPV\",\n  \"dateOfService\": \"2026-10-21\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift IRN Corrected
import Foundation

let headers = [
  "x-minor-id": "<minorId>",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "patient": [
    "identity": [
      "dateOfBirth": "1993-08-14",
      "familyName": "NASH",
      "givenName": "Hazel",
      "sex": "2"
    ],
    "medicare": [
      "memberNumber": "2954536421",
      "memberRefNumber": "2"
    ],
    "healthFund": [
      "memberNumber": "1234567",
      "organisation": "TST",
      "memberRefNumber": "1"
    ]
  ],
  "typeCode": "OPV",
  "dateOfService": "2026-10-21"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://test-api.rebateright.com.au/Medicare/patientverification/v1")! 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()
```

### Medicare Not Matched

**Request**

```json
{
  "patient": {
    "identity": {
      "dateOfBirth": "1979-09-13",
      "familyName": "Doe",
      "givenName": "John",
      "sex": "1"
    },
    "medicare": {
      "memberNumber": "2398125261",
      "memberRefNumber": "1"
    },
    "healthFund": {
      "memberNumber": "1234567",
      "organisation": "TST",
      "memberRefNumber": "1"
    }
  },
  "typeCode": "OPV",
  "dateOfService": "2026-10-21"
}
```

**Response**

```json
{
  "correlationId": "urn:uuid:MDE000005284643b487c411f",
  "medicareStatus": {
    "status": {
      "code": 9650,
      "text": "The card number and/or patient details submitted did not match Medicare checks. Please verify the details and resubmit with additional information if available."
    }
  },
  "healthFundStatus": {
    "status": {
      "code": 9674,
      "text": "Fund patient validation not undertaken as the Medicare validation was unsuccessful."
    }
  }
}
```

**SDK Code**

```python Medicare Not Matched
import requests

url = "https://test-api.rebateright.com.au/Medicare/patientverification/v1"

payload = {
    "patient": {
        "identity": {
            "dateOfBirth": "1979-09-13",
            "familyName": "Doe",
            "givenName": "John",
            "sex": "1"
        },
        "medicare": {
            "memberNumber": "2398125261",
            "memberRefNumber": "1"
        },
        "healthFund": {
            "memberNumber": "1234567",
            "organisation": "TST",
            "memberRefNumber": "1"
        }
    },
    "typeCode": "OPV",
    "dateOfService": "2026-10-21"
}
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 Medicare Not Matched
const url = 'https://test-api.rebateright.com.au/Medicare/patientverification/v1';
const options = {
  method: 'POST',
  headers: {
    'x-minor-id': '<minorId>',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"patient":{"identity":{"dateOfBirth":"1979-09-13","familyName":"Doe","givenName":"John","sex":"1"},"medicare":{"memberNumber":"2398125261","memberRefNumber":"1"},"healthFund":{"memberNumber":"1234567","organisation":"TST","memberRefNumber":"1"}},"typeCode":"OPV","dateOfService":"2026-10-21"}'
};

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

```go Medicare Not Matched
package main

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

func main() {

	url := "https://test-api.rebateright.com.au/Medicare/patientverification/v1"

	payload := strings.NewReader("{\n  \"patient\": {\n    \"identity\": {\n      \"dateOfBirth\": \"1979-09-13\",\n      \"familyName\": \"Doe\",\n      \"givenName\": \"John\",\n      \"sex\": \"1\"\n    },\n    \"medicare\": {\n      \"memberNumber\": \"2398125261\",\n      \"memberRefNumber\": \"1\"\n    },\n    \"healthFund\": {\n      \"memberNumber\": \"1234567\",\n      \"organisation\": \"TST\",\n      \"memberRefNumber\": \"1\"\n    }\n  },\n  \"typeCode\": \"OPV\",\n  \"dateOfService\": \"2026-10-21\"\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 Medicare Not Matched
require 'uri'
require 'net/http'

url = URI("https://test-api.rebateright.com.au/Medicare/patientverification/v1")

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  \"patient\": {\n    \"identity\": {\n      \"dateOfBirth\": \"1979-09-13\",\n      \"familyName\": \"Doe\",\n      \"givenName\": \"John\",\n      \"sex\": \"1\"\n    },\n    \"medicare\": {\n      \"memberNumber\": \"2398125261\",\n      \"memberRefNumber\": \"1\"\n    },\n    \"healthFund\": {\n      \"memberNumber\": \"1234567\",\n      \"organisation\": \"TST\",\n      \"memberRefNumber\": \"1\"\n    }\n  },\n  \"typeCode\": \"OPV\",\n  \"dateOfService\": \"2026-10-21\"\n}"

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

```java Medicare Not Matched
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://test-api.rebateright.com.au/Medicare/patientverification/v1")
  .header("x-minor-id", "<minorId>")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"patient\": {\n    \"identity\": {\n      \"dateOfBirth\": \"1979-09-13\",\n      \"familyName\": \"Doe\",\n      \"givenName\": \"John\",\n      \"sex\": \"1\"\n    },\n    \"medicare\": {\n      \"memberNumber\": \"2398125261\",\n      \"memberRefNumber\": \"1\"\n    },\n    \"healthFund\": {\n      \"memberNumber\": \"1234567\",\n      \"organisation\": \"TST\",\n      \"memberRefNumber\": \"1\"\n    }\n  },\n  \"typeCode\": \"OPV\",\n  \"dateOfService\": \"2026-10-21\"\n}")
  .asString();
```

```php Medicare Not Matched
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://test-api.rebateright.com.au/Medicare/patientverification/v1', [
  'body' => '{
  "patient": {
    "identity": {
      "dateOfBirth": "1979-09-13",
      "familyName": "Doe",
      "givenName": "John",
      "sex": "1"
    },
    "medicare": {
      "memberNumber": "2398125261",
      "memberRefNumber": "1"
    },
    "healthFund": {
      "memberNumber": "1234567",
      "organisation": "TST",
      "memberRefNumber": "1"
    }
  },
  "typeCode": "OPV",
  "dateOfService": "2026-10-21"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
    'x-minor-id' => '<minorId>',
  ],
]);

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

```csharp Medicare Not Matched
using RestSharp;

var client = new RestClient("https://test-api.rebateright.com.au/Medicare/patientverification/v1");
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  \"patient\": {\n    \"identity\": {\n      \"dateOfBirth\": \"1979-09-13\",\n      \"familyName\": \"Doe\",\n      \"givenName\": \"John\",\n      \"sex\": \"1\"\n    },\n    \"medicare\": {\n      \"memberNumber\": \"2398125261\",\n      \"memberRefNumber\": \"1\"\n    },\n    \"healthFund\": {\n      \"memberNumber\": \"1234567\",\n      \"organisation\": \"TST\",\n      \"memberRefNumber\": \"1\"\n    }\n  },\n  \"typeCode\": \"OPV\",\n  \"dateOfService\": \"2026-10-21\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Medicare Not Matched
import Foundation

let headers = [
  "x-minor-id": "<minorId>",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "patient": [
    "identity": [
      "dateOfBirth": "1979-09-13",
      "familyName": "Doe",
      "givenName": "John",
      "sex": "1"
    ],
    "medicare": [
      "memberNumber": "2398125261",
      "memberRefNumber": "1"
    ],
    "healthFund": [
      "memberNumber": "1234567",
      "organisation": "TST",
      "memberRefNumber": "1"
    ]
  ],
  "typeCode": "OPV",
  "dateOfService": "2026-10-21"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://test-api.rebateright.com.au/Medicare/patientverification/v1")! 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()
```