# Eligibility Check

POST https://Medicare/onlineeligibilitycheck/medicare/v2
Content-Type: application/json

Reference: https://developers.rebateright.com.au/rebate-right/advanced/v-4/eligibility-check

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /Medicare/onlineeligibilitycheck/medicare/v2:
    post:
      operationId: eligibility-check
      summary: Eligibility Check
      tags:
        - subpackage_advanced.subpackage_advanced/v4
      parameters:
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
        - name: x-minor-id
          in: header
          required: false
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Advanced_V4_Eligibility
                  Check_Response_200
      requestBody:
        content:
          application/json:
            schema:
              type: string
servers:
  - url: https:/
components:
  schemas:
    MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaClaimSummary:
      type: object
      properties:
        accountReferenceId:
          type: string
      required:
        - accountReferenceId
      title: >-
        MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaClaimSummary
    MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaMedicareStatusStatus:
      type: object
      properties:
        code:
          type: integer
        text:
          type: string
      required:
        - code
        - text
      title: >-
        MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaMedicareStatusStatus
    MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaMedicareStatus:
      type: object
      properties:
        status:
          $ref: >-
            #/components/schemas/MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaMedicareStatusStatus
      required:
        - status
      title: >-
        MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaMedicareStatus
    MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaMedicareClaimEstimationMedicalEventItemsServiceItems:
      type: object
      properties:
        id:
          type: string
        benefit:
          type: integer
        itemNumber:
          type: string
        scheduleFee:
          type: integer
        chargeAmount:
          type: string
        dateOfService:
          type: string
          format: date
        explanationCode:
          type: string
      required:
        - id
        - benefit
        - itemNumber
        - scheduleFee
        - chargeAmount
        - dateOfService
        - explanationCode
      title: >-
        MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaMedicareClaimEstimationMedicalEventItemsServiceItems
    MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaMedicareClaimEstimationMedicalEventItems:
      type: object
      properties:
        id:
          type: string
        service:
          type: array
          items:
            $ref: >-
              #/components/schemas/MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaMedicareClaimEstimationMedicalEventItemsServiceItems
      required:
        - id
        - service
      title: >-
        MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaMedicareClaimEstimationMedicalEventItems
    MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaMedicareClaimEstimation:
      type: object
      properties:
        medicalEvent:
          type: array
          items:
            $ref: >-
              #/components/schemas/MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaMedicareClaimEstimationMedicalEventItems
        lodgementDate:
          type: string
          format: date
      required:
        - medicalEvent
        - lodgementDate
      title: >-
        MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaMedicareClaimEstimation
    Advanced_V4_Eligibility Check_Response_200:
      type: object
      properties:
        status:
          type: string
        claimSummary:
          $ref: >-
            #/components/schemas/MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaClaimSummary
        correlationId:
          type: string
        medicareStatus:
          $ref: >-
            #/components/schemas/MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaMedicareStatus
        medicareClaimEstimation:
          $ref: >-
            #/components/schemas/MedicareOnlineeligibilitycheckMedicareV2PostResponsesContentApplicationJsonSchemaMedicareClaimEstimation
      required:
        - status
        - claimSummary
        - correlationId
        - medicareStatus
        - medicareClaimEstimation
      title: Advanced_V4_Eligibility Check_Response_200
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

```

## SDK Code Examples

```python 14111
import requests

url = "https://https/Medicare/onlineeligibilitycheck/medicare/v2"

headers = {
    "x-minor-id": "{{MinorId}}",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript 14111
const url = 'https://https/Medicare/onlineeligibilitycheck/medicare/v2';
const options = {
  method: 'POST',
  headers: {
    'x-minor-id': '{{MinorId}}',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: undefined
};

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

```go 14111
package main

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

func main() {

	url := "https://https/Medicare/onlineeligibilitycheck/medicare/v2"

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

	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 14111
require 'uri'
require 'net/http'

url = URI("https://https/Medicare/onlineeligibilitycheck/medicare/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'

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

```java 14111
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/Medicare/onlineeligibilitycheck/medicare/v2")
  .header("x-minor-id", "{{MinorId}}")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/Medicare/onlineeligibilitycheck/medicare/v2', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
    'x-minor-id' => '{{MinorId}}',
  ],
]);

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

```csharp 14111
using RestSharp;

var client = new RestClient("https://https/Medicare/onlineeligibilitycheck/medicare/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");
IRestResponse response = client.Execute(request);
```

```swift 14111
import Foundation

let headers = [
  "x-minor-id": "{{MinorId}}",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://https/Medicare/onlineeligibilitycheck/medicare/v2")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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()
```

```python v1
import requests

url = "https://https/Medicare/onlineeligibilitycheck/medicare/v2"

headers = {
    "x-minor-id": "{{MinorId}}",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript v1
const url = 'https://https/Medicare/onlineeligibilitycheck/medicare/v2';
const options = {
  method: 'POST',
  headers: {
    'x-minor-id': '{{MinorId}}',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: undefined
};

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

```go v1
package main

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

func main() {

	url := "https://https/Medicare/onlineeligibilitycheck/medicare/v2"

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

	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 v1
require 'uri'
require 'net/http'

url = URI("https://https/Medicare/onlineeligibilitycheck/medicare/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'

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

```java v1
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/Medicare/onlineeligibilitycheck/medicare/v2")
  .header("x-minor-id", "{{MinorId}}")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/Medicare/onlineeligibilitycheck/medicare/v2', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
    'x-minor-id' => '{{MinorId}}',
  ],
]);

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

```csharp v1
using RestSharp;

var client = new RestClient("https://https/Medicare/onlineeligibilitycheck/medicare/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");
IRestResponse response = client.Execute(request);
```

```swift v1
import Foundation

let headers = [
  "x-minor-id": "{{MinorId}}",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://https/Medicare/onlineeligibilitycheck/medicare/v2")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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()
```

```python v2
import requests

url = "https://https/Medicare/onlineeligibilitycheck/medicare/v2"

headers = {
    "x-minor-id": "{{MinorId}}",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript v2
const url = 'https://https/Medicare/onlineeligibilitycheck/medicare/v2';
const options = {
  method: 'POST',
  headers: {
    'x-minor-id': '{{MinorId}}',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: undefined
};

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

```go v2
package main

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

func main() {

	url := "https://https/Medicare/onlineeligibilitycheck/medicare/v2"

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

	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 v2
require 'uri'
require 'net/http'

url = URI("https://https/Medicare/onlineeligibilitycheck/medicare/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'

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

```java v2
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/Medicare/onlineeligibilitycheck/medicare/v2")
  .header("x-minor-id", "{{MinorId}}")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/Medicare/onlineeligibilitycheck/medicare/v2', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
    'x-minor-id' => '{{MinorId}}',
  ],
]);

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

```csharp v2
using RestSharp;

var client = new RestClient("https://https/Medicare/onlineeligibilitycheck/medicare/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");
IRestResponse response = client.Execute(request);
```

```swift v2
import Foundation

let headers = [
  "x-minor-id": "{{MinorId}}",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://https/Medicare/onlineeligibilitycheck/medicare/v2")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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()
```

```python Pre Eligible
import requests

url = "https://https/Medicare/onlineeligibilitycheck/medicare/v2"

headers = {
    "x-minor-id": "{{MinorId}}",
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Pre Eligible
const url = 'https://https/Medicare/onlineeligibilitycheck/medicare/v2';
const options = {
  method: 'POST',
  headers: {
    'x-minor-id': '{{MinorId}}',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: undefined
};

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

```go Pre Eligible
package main

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

func main() {

	url := "https://https/Medicare/onlineeligibilitycheck/medicare/v2"

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

	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 Pre Eligible
require 'uri'
require 'net/http'

url = URI("https://https/Medicare/onlineeligibilitycheck/medicare/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'

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

```java Pre Eligible
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/Medicare/onlineeligibilitycheck/medicare/v2")
  .header("x-minor-id", "{{MinorId}}")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Pre Eligible
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/Medicare/onlineeligibilitycheck/medicare/v2', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
    'x-minor-id' => '{{MinorId}}',
  ],
]);

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

```csharp Pre Eligible
using RestSharp;

var client = new RestClient("https://https/Medicare/onlineeligibilitycheck/medicare/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");
IRestResponse response = client.Execute(request);
```

```swift Pre Eligible
import Foundation

let headers = [
  "x-minor-id": "{{MinorId}}",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://https/Medicare/onlineeligibilitycheck/medicare/v2")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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()
```

```python Advanced_V4_Eligibility Check_example
import requests

url = "https://https/Medicare/onlineeligibilitycheck/medicare/v2"

payload = "{
    \"claim\": {
        // \"accident\": {
        //     \"accidentDate\": \"2024-08-18\",
        //     \"accidentInd\": \"342335234455720\"
        // },
        \"accountReferenceId\": \"12345ss\",
        \"serviceTypeCode\": \"O\",
        \"submissionAuthorityInd\": \"Y\",
        \"typeCode\": \"ECM\",
        // \"claimTypeCode\": \"eg\",
        // \"compensationClaimInd\": \"c\",
        // \"emergencyAdmissionInd\": \"i\",
        // \"facilityId\": \"7797981847748608\",
        // \"fundPayeeId\": \"5169752460754944\",
        // \"hospitalInd\": \"l\",
        // \"lengthOfStay\": 3855220,
          \"patient\": {
            \"identity\": {
                \"dateOfBirth\": \"2009-02-08\",
                \"familyName\": \"FLETCHER\",
                \"givenName\": \"Clint\",
                \"sex\":\"1\"
            },
            \"medicare\": {
                \"memberNumber\": \"4951525561\",
                \"memberRefNumber\": \"3\"
            }
        },
        \"medicalEvent\": [
            {
                // \"admissionDate\": \"2018-07-20\",
                // \"dischargeDate\": \"2020-11-29\",
                // \"financialInterestDisclosureInd\": \"k\",
                \"id\": \"01\",
                // \"ifcIssueCode\": \"p\",
                // \"referral\": {
                //     \"issueDate\": \"2008-06-10\",
                //     \"period\": \"a\",
                //     \"periodCode\": \"z\",
                //     \"provider\": {
                //         \"providerNumber\": \"329866954145792\"
                //     },
                //     \"typeCode\": \"o\"
                // },
                // \"referralOverrideCode\": \"3681760944586752\",
                \"serviceProvider\": {
                    \"providerNumber\": \"2447781L\"
                },
                \"service\": [
                    {
                        \"id\": \"0001\",
                        \"chargeAmount\": \"10000\",
                        \"itemNumber\": \"124\",
                        \"dateOfService\":\"2026-04-01\"
                    }
                ]
            }
        ]
      
        ,\"principalProvider\": {
            \"providerNumber\": \"2447781L\"
        }
        // \"senderContact\": {
        //     \"emailAddress\": \"a@b.c\",
        //     \"name\": \"Eva Oliver\",
        //     \"phoneNumber\": \"(988) 778-6816\"
        // },
    }
}"
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 Advanced_V4_Eligibility Check_example
const url = 'https://https/Medicare/onlineeligibilitycheck/medicare/v2';
const options = {
  method: 'POST',
  headers: {
    'x-minor-id': '{{MinorId}}',
    'x-api-key': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '"{\r\n    \"claim\": {\r\n        // \"accident\": {\r\n        //     \"accidentDate\": \"2024-08-18\",\r\n        //     \"accidentInd\": \"342335234455720\"\r\n        // },\r\n        \"accountReferenceId\": \"12345ss\",\r\n        \"serviceTypeCode\": \"O\",\r\n        \"submissionAuthorityInd\": \"Y\",\r\n        \"typeCode\": \"ECM\",\r\n        // \"claimTypeCode\": \"eg\",\r\n        // \"compensationClaimInd\": \"c\",\r\n        // \"emergencyAdmissionInd\": \"i\",\r\n        // \"facilityId\": \"7797981847748608\",\r\n        // \"fundPayeeId\": \"5169752460754944\",\r\n        // \"hospitalInd\": \"l\",\r\n        // \"lengthOfStay\": 3855220,\r\n          \"patient\": {\r\n            \"identity\": {\r\n                \"dateOfBirth\": \"2009-02-08\",\r\n                \"familyName\": \"FLETCHER\",\r\n                \"givenName\": \"Clint\",\r\n                \"sex\":\"1\"\r\n            },\r\n            \"medicare\": {\r\n                \"memberNumber\": \"4951525561\",\r\n                \"memberRefNumber\": \"3\"\r\n            }\r\n        },\r\n        \"medicalEvent\": [\r\n            {\r\n                // \"admissionDate\": \"2018-07-20\",\r\n                // \"dischargeDate\": \"2020-11-29\",\r\n                // \"financialInterestDisclosureInd\": \"k\",\r\n                \"id\": \"01\",\r\n                // \"ifcIssueCode\": \"p\",\r\n                // \"referral\": {\r\n                //     \"issueDate\": \"2008-06-10\",\r\n                //     \"period\": \"a\",\r\n                //     \"periodCode\": \"z\",\r\n                //     \"provider\": {\r\n                //         \"providerNumber\": \"329866954145792\"\r\n                //     },\r\n                //     \"typeCode\": \"o\"\r\n                // },\r\n                // \"referralOverrideCode\": \"3681760944586752\",\r\n                \"serviceProvider\": {\r\n                    \"providerNumber\": \"2447781L\"\r\n                },\r\n                \"service\": [\r\n                    {\r\n                        \"id\": \"0001\",\r\n                        \"chargeAmount\": \"10000\",\r\n                        \"itemNumber\": \"124\",\r\n                        \"dateOfService\":\"2026-04-01\"\r\n                    }\r\n                ]\r\n            }\r\n        ]\r\n      \r\n        ,\"principalProvider\": {\r\n            \"providerNumber\": \"2447781L\"\r\n        }\r\n        // \"senderContact\": {\r\n        //     \"emailAddress\": \"a@b.c\",\r\n        //     \"name\": \"Eva Oliver\",\r\n        //     \"phoneNumber\": \"(988) 778-6816\"\r\n        // },\r\n    }\r\n}"'
};

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

```go Advanced_V4_Eligibility Check_example
package main

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

func main() {

	url := "https://https/Medicare/onlineeligibilitycheck/medicare/v2"

	payload := strings.NewReader("\"{\\r\\n    \\\"claim\\\": {\\r\\n        // \\\"accident\\\": {\\r\\n        //     \\\"accidentDate\\\": \\\"2024-08-18\\\",\\r\\n        //     \\\"accidentInd\\\": \\\"342335234455720\\\"\\r\\n        // },\\r\\n        \\\"accountReferenceId\\\": \\\"12345ss\\\",\\r\\n        \\\"serviceTypeCode\\\": \\\"O\\\",\\r\\n        \\\"submissionAuthorityInd\\\": \\\"Y\\\",\\r\\n        \\\"typeCode\\\": \\\"ECM\\\",\\r\\n        // \\\"claimTypeCode\\\": \\\"eg\\\",\\r\\n        // \\\"compensationClaimInd\\\": \\\"c\\\",\\r\\n        // \\\"emergencyAdmissionInd\\\": \\\"i\\\",\\r\\n        // \\\"facilityId\\\": \\\"7797981847748608\\\",\\r\\n        // \\\"fundPayeeId\\\": \\\"5169752460754944\\\",\\r\\n        // \\\"hospitalInd\\\": \\\"l\\\",\\r\\n        // \\\"lengthOfStay\\\": 3855220,\\r\\n          \\\"patient\\\": {\\r\\n            \\\"identity\\\": {\\r\\n                \\\"dateOfBirth\\\": \\\"2009-02-08\\\",\\r\\n                \\\"familyName\\\": \\\"FLETCHER\\\",\\r\\n                \\\"givenName\\\": \\\"Clint\\\",\\r\\n                \\\"sex\\\":\\\"1\\\"\\r\\n            },\\r\\n            \\\"medicare\\\": {\\r\\n                \\\"memberNumber\\\": \\\"4951525561\\\",\\r\\n                \\\"memberRefNumber\\\": \\\"3\\\"\\r\\n            }\\r\\n        },\\r\\n        \\\"medicalEvent\\\": [\\r\\n            {\\r\\n                // \\\"admissionDate\\\": \\\"2018-07-20\\\",\\r\\n                // \\\"dischargeDate\\\": \\\"2020-11-29\\\",\\r\\n                // \\\"financialInterestDisclosureInd\\\": \\\"k\\\",\\r\\n                \\\"id\\\": \\\"01\\\",\\r\\n                // \\\"ifcIssueCode\\\": \\\"p\\\",\\r\\n                // \\\"referral\\\": {\\r\\n                //     \\\"issueDate\\\": \\\"2008-06-10\\\",\\r\\n                //     \\\"period\\\": \\\"a\\\",\\r\\n                //     \\\"periodCode\\\": \\\"z\\\",\\r\\n                //     \\\"provider\\\": {\\r\\n                //         \\\"providerNumber\\\": \\\"329866954145792\\\"\\r\\n                //     },\\r\\n                //     \\\"typeCode\\\": \\\"o\\\"\\r\\n                // },\\r\\n                // \\\"referralOverrideCode\\\": \\\"3681760944586752\\\",\\r\\n                \\\"serviceProvider\\\": {\\r\\n                    \\\"providerNumber\\\": \\\"2447781L\\\"\\r\\n                },\\r\\n                \\\"service\\\": [\\r\\n                    {\\r\\n                        \\\"id\\\": \\\"0001\\\",\\r\\n                        \\\"chargeAmount\\\": \\\"10000\\\",\\r\\n                        \\\"itemNumber\\\": \\\"124\\\",\\r\\n                        \\\"dateOfService\\\":\\\"2026-04-01\\\"\\r\\n                    }\\r\\n                ]\\r\\n            }\\r\\n        ]\\r\\n      \\r\\n        ,\\\"principalProvider\\\": {\\r\\n            \\\"providerNumber\\\": \\\"2447781L\\\"\\r\\n        }\\r\\n        // \\\"senderContact\\\": {\\r\\n        //     \\\"emailAddress\\\": \\\"a@b.c\\\",\\r\\n        //     \\\"name\\\": \\\"Eva Oliver\\\",\\r\\n        //     \\\"phoneNumber\\\": \\\"(988) 778-6816\\\"\\r\\n        // },\\r\\n    }\\r\\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 Advanced_V4_Eligibility Check_example
require 'uri'
require 'net/http'

url = URI("https://https/Medicare/onlineeligibilitycheck/medicare/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 = "\"{\\r\\n    \\\"claim\\\": {\\r\\n        // \\\"accident\\\": {\\r\\n        //     \\\"accidentDate\\\": \\\"2024-08-18\\\",\\r\\n        //     \\\"accidentInd\\\": \\\"342335234455720\\\"\\r\\n        // },\\r\\n        \\\"accountReferenceId\\\": \\\"12345ss\\\",\\r\\n        \\\"serviceTypeCode\\\": \\\"O\\\",\\r\\n        \\\"submissionAuthorityInd\\\": \\\"Y\\\",\\r\\n        \\\"typeCode\\\": \\\"ECM\\\",\\r\\n        // \\\"claimTypeCode\\\": \\\"eg\\\",\\r\\n        // \\\"compensationClaimInd\\\": \\\"c\\\",\\r\\n        // \\\"emergencyAdmissionInd\\\": \\\"i\\\",\\r\\n        // \\\"facilityId\\\": \\\"7797981847748608\\\",\\r\\n        // \\\"fundPayeeId\\\": \\\"5169752460754944\\\",\\r\\n        // \\\"hospitalInd\\\": \\\"l\\\",\\r\\n        // \\\"lengthOfStay\\\": 3855220,\\r\\n          \\\"patient\\\": {\\r\\n            \\\"identity\\\": {\\r\\n                \\\"dateOfBirth\\\": \\\"2009-02-08\\\",\\r\\n                \\\"familyName\\\": \\\"FLETCHER\\\",\\r\\n                \\\"givenName\\\": \\\"Clint\\\",\\r\\n                \\\"sex\\\":\\\"1\\\"\\r\\n            },\\r\\n            \\\"medicare\\\": {\\r\\n                \\\"memberNumber\\\": \\\"4951525561\\\",\\r\\n                \\\"memberRefNumber\\\": \\\"3\\\"\\r\\n            }\\r\\n        },\\r\\n        \\\"medicalEvent\\\": [\\r\\n            {\\r\\n                // \\\"admissionDate\\\": \\\"2018-07-20\\\",\\r\\n                // \\\"dischargeDate\\\": \\\"2020-11-29\\\",\\r\\n                // \\\"financialInterestDisclosureInd\\\": \\\"k\\\",\\r\\n                \\\"id\\\": \\\"01\\\",\\r\\n                // \\\"ifcIssueCode\\\": \\\"p\\\",\\r\\n                // \\\"referral\\\": {\\r\\n                //     \\\"issueDate\\\": \\\"2008-06-10\\\",\\r\\n                //     \\\"period\\\": \\\"a\\\",\\r\\n                //     \\\"periodCode\\\": \\\"z\\\",\\r\\n                //     \\\"provider\\\": {\\r\\n                //         \\\"providerNumber\\\": \\\"329866954145792\\\"\\r\\n                //     },\\r\\n                //     \\\"typeCode\\\": \\\"o\\\"\\r\\n                // },\\r\\n                // \\\"referralOverrideCode\\\": \\\"3681760944586752\\\",\\r\\n                \\\"serviceProvider\\\": {\\r\\n                    \\\"providerNumber\\\": \\\"2447781L\\\"\\r\\n                },\\r\\n                \\\"service\\\": [\\r\\n                    {\\r\\n                        \\\"id\\\": \\\"0001\\\",\\r\\n                        \\\"chargeAmount\\\": \\\"10000\\\",\\r\\n                        \\\"itemNumber\\\": \\\"124\\\",\\r\\n                        \\\"dateOfService\\\":\\\"2026-04-01\\\"\\r\\n                    }\\r\\n                ]\\r\\n            }\\r\\n        ]\\r\\n      \\r\\n        ,\\\"principalProvider\\\": {\\r\\n            \\\"providerNumber\\\": \\\"2447781L\\\"\\r\\n        }\\r\\n        // \\\"senderContact\\\": {\\r\\n        //     \\\"emailAddress\\\": \\\"a@b.c\\\",\\r\\n        //     \\\"name\\\": \\\"Eva Oliver\\\",\\r\\n        //     \\\"phoneNumber\\\": \\\"(988) 778-6816\\\"\\r\\n        // },\\r\\n    }\\r\\n}\""

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

```java Advanced_V4_Eligibility Check_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/Medicare/onlineeligibilitycheck/medicare/v2")
  .header("x-minor-id", "{{MinorId}}")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("\"{\\r\\n    \\\"claim\\\": {\\r\\n        // \\\"accident\\\": {\\r\\n        //     \\\"accidentDate\\\": \\\"2024-08-18\\\",\\r\\n        //     \\\"accidentInd\\\": \\\"342335234455720\\\"\\r\\n        // },\\r\\n        \\\"accountReferenceId\\\": \\\"12345ss\\\",\\r\\n        \\\"serviceTypeCode\\\": \\\"O\\\",\\r\\n        \\\"submissionAuthorityInd\\\": \\\"Y\\\",\\r\\n        \\\"typeCode\\\": \\\"ECM\\\",\\r\\n        // \\\"claimTypeCode\\\": \\\"eg\\\",\\r\\n        // \\\"compensationClaimInd\\\": \\\"c\\\",\\r\\n        // \\\"emergencyAdmissionInd\\\": \\\"i\\\",\\r\\n        // \\\"facilityId\\\": \\\"7797981847748608\\\",\\r\\n        // \\\"fundPayeeId\\\": \\\"5169752460754944\\\",\\r\\n        // \\\"hospitalInd\\\": \\\"l\\\",\\r\\n        // \\\"lengthOfStay\\\": 3855220,\\r\\n          \\\"patient\\\": {\\r\\n            \\\"identity\\\": {\\r\\n                \\\"dateOfBirth\\\": \\\"2009-02-08\\\",\\r\\n                \\\"familyName\\\": \\\"FLETCHER\\\",\\r\\n                \\\"givenName\\\": \\\"Clint\\\",\\r\\n                \\\"sex\\\":\\\"1\\\"\\r\\n            },\\r\\n            \\\"medicare\\\": {\\r\\n                \\\"memberNumber\\\": \\\"4951525561\\\",\\r\\n                \\\"memberRefNumber\\\": \\\"3\\\"\\r\\n            }\\r\\n        },\\r\\n        \\\"medicalEvent\\\": [\\r\\n            {\\r\\n                // \\\"admissionDate\\\": \\\"2018-07-20\\\",\\r\\n                // \\\"dischargeDate\\\": \\\"2020-11-29\\\",\\r\\n                // \\\"financialInterestDisclosureInd\\\": \\\"k\\\",\\r\\n                \\\"id\\\": \\\"01\\\",\\r\\n                // \\\"ifcIssueCode\\\": \\\"p\\\",\\r\\n                // \\\"referral\\\": {\\r\\n                //     \\\"issueDate\\\": \\\"2008-06-10\\\",\\r\\n                //     \\\"period\\\": \\\"a\\\",\\r\\n                //     \\\"periodCode\\\": \\\"z\\\",\\r\\n                //     \\\"provider\\\": {\\r\\n                //         \\\"providerNumber\\\": \\\"329866954145792\\\"\\r\\n                //     },\\r\\n                //     \\\"typeCode\\\": \\\"o\\\"\\r\\n                // },\\r\\n                // \\\"referralOverrideCode\\\": \\\"3681760944586752\\\",\\r\\n                \\\"serviceProvider\\\": {\\r\\n                    \\\"providerNumber\\\": \\\"2447781L\\\"\\r\\n                },\\r\\n                \\\"service\\\": [\\r\\n                    {\\r\\n                        \\\"id\\\": \\\"0001\\\",\\r\\n                        \\\"chargeAmount\\\": \\\"10000\\\",\\r\\n                        \\\"itemNumber\\\": \\\"124\\\",\\r\\n                        \\\"dateOfService\\\":\\\"2026-04-01\\\"\\r\\n                    }\\r\\n                ]\\r\\n            }\\r\\n        ]\\r\\n      \\r\\n        ,\\\"principalProvider\\\": {\\r\\n            \\\"providerNumber\\\": \\\"2447781L\\\"\\r\\n        }\\r\\n        // \\\"senderContact\\\": {\\r\\n        //     \\\"emailAddress\\\": \\\"a@b.c\\\",\\r\\n        //     \\\"name\\\": \\\"Eva Oliver\\\",\\r\\n        //     \\\"phoneNumber\\\": \\\"(988) 778-6816\\\"\\r\\n        // },\\r\\n    }\\r\\n}\"")
  .asString();
```

```php Advanced_V4_Eligibility Check_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/Medicare/onlineeligibilitycheck/medicare/v2', [
  'body' => '"{\\r\\n    \\"claim\\": {\\r\\n        // \\"accident\\": {\\r\\n        //     \\"accidentDate\\": \\"2024-08-18\\",\\r\\n        //     \\"accidentInd\\": \\"342335234455720\\"\\r\\n        // },\\r\\n        \\"accountReferenceId\\": \\"12345ss\\",\\r\\n        \\"serviceTypeCode\\": \\"O\\",\\r\\n        \\"submissionAuthorityInd\\": \\"Y\\",\\r\\n        \\"typeCode\\": \\"ECM\\",\\r\\n        // \\"claimTypeCode\\": \\"eg\\",\\r\\n        // \\"compensationClaimInd\\": \\"c\\",\\r\\n        // \\"emergencyAdmissionInd\\": \\"i\\",\\r\\n        // \\"facilityId\\": \\"7797981847748608\\",\\r\\n        // \\"fundPayeeId\\": \\"5169752460754944\\",\\r\\n        // \\"hospitalInd\\": \\"l\\",\\r\\n        // \\"lengthOfStay\\": 3855220,\\r\\n          \\"patient\\": {\\r\\n            \\"identity\\": {\\r\\n                \\"dateOfBirth\\": \\"2009-02-08\\",\\r\\n                \\"familyName\\": \\"FLETCHER\\",\\r\\n                \\"givenName\\": \\"Clint\\",\\r\\n                \\"sex\\":\\"1\\"\\r\\n            },\\r\\n            \\"medicare\\": {\\r\\n                \\"memberNumber\\": \\"4951525561\\",\\r\\n                \\"memberRefNumber\\": \\"3\\"\\r\\n            }\\r\\n        },\\r\\n        \\"medicalEvent\\": [\\r\\n            {\\r\\n                // \\"admissionDate\\": \\"2018-07-20\\",\\r\\n                // \\"dischargeDate\\": \\"2020-11-29\\",\\r\\n                // \\"financialInterestDisclosureInd\\": \\"k\\",\\r\\n                \\"id\\": \\"01\\",\\r\\n                // \\"ifcIssueCode\\": \\"p\\",\\r\\n                // \\"referral\\": {\\r\\n                //     \\"issueDate\\": \\"2008-06-10\\",\\r\\n                //     \\"period\\": \\"a\\",\\r\\n                //     \\"periodCode\\": \\"z\\",\\r\\n                //     \\"provider\\": {\\r\\n                //         \\"providerNumber\\": \\"329866954145792\\"\\r\\n                //     },\\r\\n                //     \\"typeCode\\": \\"o\\"\\r\\n                // },\\r\\n                // \\"referralOverrideCode\\": \\"3681760944586752\\",\\r\\n                \\"serviceProvider\\": {\\r\\n                    \\"providerNumber\\": \\"2447781L\\"\\r\\n                },\\r\\n                \\"service\\": [\\r\\n                    {\\r\\n                        \\"id\\": \\"0001\\",\\r\\n                        \\"chargeAmount\\": \\"10000\\",\\r\\n                        \\"itemNumber\\": \\"124\\",\\r\\n                        \\"dateOfService\\":\\"2026-04-01\\"\\r\\n                    }\\r\\n                ]\\r\\n            }\\r\\n        ]\\r\\n      \\r\\n        ,\\"principalProvider\\": {\\r\\n            \\"providerNumber\\": \\"2447781L\\"\\r\\n        }\\r\\n        // \\"senderContact\\": {\\r\\n        //     \\"emailAddress\\": \\"a@b.c\\",\\r\\n        //     \\"name\\": \\"Eva Oliver\\",\\r\\n        //     \\"phoneNumber\\": \\"(988) 778-6816\\"\\r\\n        // },\\r\\n    }\\r\\n}"',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
    'x-minor-id' => '{{MinorId}}',
  ],
]);

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

```csharp Advanced_V4_Eligibility Check_example
using RestSharp;

var client = new RestClient("https://https/Medicare/onlineeligibilitycheck/medicare/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", "\"{\\r\\n    \\\"claim\\\": {\\r\\n        // \\\"accident\\\": {\\r\\n        //     \\\"accidentDate\\\": \\\"2024-08-18\\\",\\r\\n        //     \\\"accidentInd\\\": \\\"342335234455720\\\"\\r\\n        // },\\r\\n        \\\"accountReferenceId\\\": \\\"12345ss\\\",\\r\\n        \\\"serviceTypeCode\\\": \\\"O\\\",\\r\\n        \\\"submissionAuthorityInd\\\": \\\"Y\\\",\\r\\n        \\\"typeCode\\\": \\\"ECM\\\",\\r\\n        // \\\"claimTypeCode\\\": \\\"eg\\\",\\r\\n        // \\\"compensationClaimInd\\\": \\\"c\\\",\\r\\n        // \\\"emergencyAdmissionInd\\\": \\\"i\\\",\\r\\n        // \\\"facilityId\\\": \\\"7797981847748608\\\",\\r\\n        // \\\"fundPayeeId\\\": \\\"5169752460754944\\\",\\r\\n        // \\\"hospitalInd\\\": \\\"l\\\",\\r\\n        // \\\"lengthOfStay\\\": 3855220,\\r\\n          \\\"patient\\\": {\\r\\n            \\\"identity\\\": {\\r\\n                \\\"dateOfBirth\\\": \\\"2009-02-08\\\",\\r\\n                \\\"familyName\\\": \\\"FLETCHER\\\",\\r\\n                \\\"givenName\\\": \\\"Clint\\\",\\r\\n                \\\"sex\\\":\\\"1\\\"\\r\\n            },\\r\\n            \\\"medicare\\\": {\\r\\n                \\\"memberNumber\\\": \\\"4951525561\\\",\\r\\n                \\\"memberRefNumber\\\": \\\"3\\\"\\r\\n            }\\r\\n        },\\r\\n        \\\"medicalEvent\\\": [\\r\\n            {\\r\\n                // \\\"admissionDate\\\": \\\"2018-07-20\\\",\\r\\n                // \\\"dischargeDate\\\": \\\"2020-11-29\\\",\\r\\n                // \\\"financialInterestDisclosureInd\\\": \\\"k\\\",\\r\\n                \\\"id\\\": \\\"01\\\",\\r\\n                // \\\"ifcIssueCode\\\": \\\"p\\\",\\r\\n                // \\\"referral\\\": {\\r\\n                //     \\\"issueDate\\\": \\\"2008-06-10\\\",\\r\\n                //     \\\"period\\\": \\\"a\\\",\\r\\n                //     \\\"periodCode\\\": \\\"z\\\",\\r\\n                //     \\\"provider\\\": {\\r\\n                //         \\\"providerNumber\\\": \\\"329866954145792\\\"\\r\\n                //     },\\r\\n                //     \\\"typeCode\\\": \\\"o\\\"\\r\\n                // },\\r\\n                // \\\"referralOverrideCode\\\": \\\"3681760944586752\\\",\\r\\n                \\\"serviceProvider\\\": {\\r\\n                    \\\"providerNumber\\\": \\\"2447781L\\\"\\r\\n                },\\r\\n                \\\"service\\\": [\\r\\n                    {\\r\\n                        \\\"id\\\": \\\"0001\\\",\\r\\n                        \\\"chargeAmount\\\": \\\"10000\\\",\\r\\n                        \\\"itemNumber\\\": \\\"124\\\",\\r\\n                        \\\"dateOfService\\\":\\\"2026-04-01\\\"\\r\\n                    }\\r\\n                ]\\r\\n            }\\r\\n        ]\\r\\n      \\r\\n        ,\\\"principalProvider\\\": {\\r\\n            \\\"providerNumber\\\": \\\"2447781L\\\"\\r\\n        }\\r\\n        // \\\"senderContact\\\": {\\r\\n        //     \\\"emailAddress\\\": \\\"a@b.c\\\",\\r\\n        //     \\\"name\\\": \\\"Eva Oliver\\\",\\r\\n        //     \\\"phoneNumber\\\": \\\"(988) 778-6816\\\"\\r\\n        // },\\r\\n    }\\r\\n}\"", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Advanced_V4_Eligibility Check_example
import Foundation

let headers = [
  "x-minor-id": "{{MinorId}}",
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = "{
    \"claim\": {
        // \"accident\": {
        //     \"accidentDate\": \"2024-08-18\",
        //     \"accidentInd\": \"342335234455720\"
        // },
        \"accountReferenceId\": \"12345ss\",
        \"serviceTypeCode\": \"O\",
        \"submissionAuthorityInd\": \"Y\",
        \"typeCode\": \"ECM\",
        // \"claimTypeCode\": \"eg\",
        // \"compensationClaimInd\": \"c\",
        // \"emergencyAdmissionInd\": \"i\",
        // \"facilityId\": \"7797981847748608\",
        // \"fundPayeeId\": \"5169752460754944\",
        // \"hospitalInd\": \"l\",
        // \"lengthOfStay\": 3855220,
          \"patient\": {
            \"identity\": {
                \"dateOfBirth\": \"2009-02-08\",
                \"familyName\": \"FLETCHER\",
                \"givenName\": \"Clint\",
                \"sex\":\"1\"
            },
            \"medicare\": {
                \"memberNumber\": \"4951525561\",
                \"memberRefNumber\": \"3\"
            }
        },
        \"medicalEvent\": [
            {
                // \"admissionDate\": \"2018-07-20\",
                // \"dischargeDate\": \"2020-11-29\",
                // \"financialInterestDisclosureInd\": \"k\",
                \"id\": \"01\",
                // \"ifcIssueCode\": \"p\",
                // \"referral\": {
                //     \"issueDate\": \"2008-06-10\",
                //     \"period\": \"a\",
                //     \"periodCode\": \"z\",
                //     \"provider\": {
                //         \"providerNumber\": \"329866954145792\"
                //     },
                //     \"typeCode\": \"o\"
                // },
                // \"referralOverrideCode\": \"3681760944586752\",
                \"serviceProvider\": {
                    \"providerNumber\": \"2447781L\"
                },
                \"service\": [
                    {
                        \"id\": \"0001\",
                        \"chargeAmount\": \"10000\",
                        \"itemNumber\": \"124\",
                        \"dateOfService\":\"2026-04-01\"
                    }
                ]
            }
        ]
      
        ,\"principalProvider\": {
            \"providerNumber\": \"2447781L\"
        }
        // \"senderContact\": {
        //     \"emailAddress\": \"a@b.c\",
        //     \"name\": \"Eva Oliver\",
        //     \"phoneNumber\": \"(988) 778-6816\"
        // },
    }
}" as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://https/Medicare/onlineeligibilitycheck/medicare/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()
```