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

# Batch

POST https://pre-api.joincandidhealth.com/eligibility-checks/v1/batch
Content-Type: application/json

Sends a batch of eligibility checks to payers through Stedi.

Reference: https://docs.joincandidhealth.com/api-reference/pre-encounter/eligibility-checks/v-1/batch

## Authentication

- OAuth2 — send the obtained token as `Authorization: Bearer <token>`

## Servers

- `https://pre-api.joincandidhealth.com` (Production, default)
- `https://pre-api-staging.joincandidhealth.com` (Staging)
- `https://sandbox-pre-api.joincandidhealth.com` (CandidSandbox)
- `https://staging-pre-api.joincandidhealth.com` (CandidStaging)
- `http://localhost:4000` (Local)

## Request

### Body (application/json)

This endpoint expects a list of EligibilityRequest.

- `list of EligibilityRequest`

## Response

### 200

- `batch_id` (string, required)
- `submitted_at` (datetime, required)

## Types

### EligibilityRequest

An object representing the data for an eligibility request.

- `payer_id` (string, required) — Supported payer ID values can be found [here](https://www.stedi.com/healthcare/network).
- `provider` (Provider, required)
- `subscriber` (MemberInfo, required) — The primary policyholder for the insurance plan or a dependent with a unique member ID. If a dependent has a unique member ID, include their information here and leave dependent undefined.
- `submitter_transaction_identifier` (string, optional) — A unique identifier for the eligibility check within the batch. Candid returns this identifier in the response for the /batch/\{batch\_id} polling endpoint so you can correlate benefit responses with the original eligibility check.
- `dependent` (MemberInfo, optional) — If a dependent has a unique member ID, include their information as subscriber and leave this field undefined.
- `encounter` (Encounter, optional)
- `get_existing_check_initiated_after` (datetime, optional) — If not provided, this endpoint will run a fresh eligibility check. If provided, it will return an existing successful eligibility check if one exists that was initiated after provided date with the same parameters (Date of Service, Payer ID, Provider, Subscriber, Dependent, and Encounter).
- `source` (string, optional)
- `portal_password` (string, optional) — The password that the provider uses to log in to the payer's portal. This is not commonly used.
- `portal_username` (string, optional) — The username that the provider uses to log in to the payer's portal. This is not commonly used.

### Provider

### MemberInfo

- `first_name` (string, required)
- `last_name` (string, required)
- `member_id` (string, optional) — Stedi requires that you supply at least one of these fields in the request: memberId, dateOfBirth, or lastName. However, each payer has different requirements, so you should supply as many of the fields necessary for each payer to identify the subscriber/dependent in their system.
- `date_of_birth` (date, optional) — Stedi requires that you supply at least one of these fields in the request: memberId, dateOfBirth, or lastName. However, each payer has different requirements, so you should supply as many of the fields necessary for each payer to identify the subscriber/dependent in their system.

### Encounter

- `date_of_service` (date, optional) — Defaults to the current date if not provided.
- `service_type_codes` (list of string, optional) — Defaults to HealthBenefitPlanCoverage (30) if not provided. Not all payers support multiple service type codes, so it is recommended to only include a single code per request.

### IndividualProvider

- `npi` (string, required)
- `first_name` (string, optional)
- `last_name` (string, optional)

### OrganizationProvider

- `npi` (string, required)
- `organization_name` (string, optional)

## Examples

**Request**

```json
[
  {
    "payer_id": "payer_id",
    "provider": {
      "npi": "npi"
    },
    "subscriber": {
      "first_name": "first_name",
      "last_name": "last_name"
    }
  },
  {
    "payer_id": "payer_id",
    "provider": {
      "npi": "npi"
    },
    "subscriber": {
      "first_name": "first_name",
      "last_name": "last_name"
    }
  }
]
```

**Response**

```json
{
  "batch_id": "batch_id",
  "submitted_at": "2024-01-15T09:30:00Z"
}
```

**SDK Code**

```python
import requests

url = "https://pre-api.joincandidhealth.com/eligibility-checks/v1/batch"

payload = [
    {
        "payer_id": "payer_id",
        "provider": { "npi": "npi" },
        "subscriber": {
            "first_name": "first_name",
            "last_name": "last_name"
        }
    },
    {
        "payer_id": "payer_id",
        "provider": { "npi": "npi" },
        "subscriber": {
            "first_name": "first_name",
            "last_name": "last_name"
        }
    }
]
headers = {
    "Authorization": "<token>.",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://pre-api.joincandidhealth.com/eligibility-checks/v1/batch';
const options = {
  method: 'POST',
  headers: {Authorization: '<token>.', 'Content-Type': 'application/json'},
  body: '[{"payer_id":"payer_id","provider":{"npi":"npi"},"subscriber":{"first_name":"first_name","last_name":"last_name"}},{"payer_id":"payer_id","provider":{"npi":"npi"},"subscriber":{"first_name":"first_name","last_name":"last_name"}}]'
};

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

```go
package main

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

func main() {

	url := "https://pre-api.joincandidhealth.com/eligibility-checks/v1/batch"

	payload := strings.NewReader("[\n  {\n    \"payer_id\": \"payer_id\",\n    \"provider\": {\n      \"npi\": \"npi\"\n    },\n    \"subscriber\": {\n      \"first_name\": \"first_name\",\n      \"last_name\": \"last_name\"\n    }\n  },\n  {\n    \"payer_id\": \"payer_id\",\n    \"provider\": {\n      \"npi\": \"npi\"\n    },\n    \"subscriber\": {\n      \"first_name\": \"first_name\",\n      \"last_name\": \"last_name\"\n    }\n  }\n]")

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

	req.Header.Add("Authorization", "<token>.")
	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
require 'uri'
require 'net/http'

url = URI("https://pre-api.joincandidhealth.com/eligibility-checks/v1/batch")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<token>.'
request["Content-Type"] = 'application/json'
request.body = "[\n  {\n    \"payer_id\": \"payer_id\",\n    \"provider\": {\n      \"npi\": \"npi\"\n    },\n    \"subscriber\": {\n      \"first_name\": \"first_name\",\n      \"last_name\": \"last_name\"\n    }\n  },\n  {\n    \"payer_id\": \"payer_id\",\n    \"provider\": {\n      \"npi\": \"npi\"\n    },\n    \"subscriber\": {\n      \"first_name\": \"first_name\",\n      \"last_name\": \"last_name\"\n    }\n  }\n]"

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

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

HttpResponse<String> response = Unirest.post("https://pre-api.joincandidhealth.com/eligibility-checks/v1/batch")
  .header("Authorization", "<token>.")
  .header("Content-Type", "application/json")
  .body("[\n  {\n    \"payer_id\": \"payer_id\",\n    \"provider\": {\n      \"npi\": \"npi\"\n    },\n    \"subscriber\": {\n      \"first_name\": \"first_name\",\n      \"last_name\": \"last_name\"\n    }\n  },\n  {\n    \"payer_id\": \"payer_id\",\n    \"provider\": {\n      \"npi\": \"npi\"\n    },\n    \"subscriber\": {\n      \"first_name\": \"first_name\",\n      \"last_name\": \"last_name\"\n    }\n  }\n]")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://pre-api.joincandidhealth.com/eligibility-checks/v1/batch', [
  'body' => '[
  {
    "payer_id": "payer_id",
    "provider": {
      "npi": "npi"
    },
    "subscriber": {
      "first_name": "first_name",
      "last_name": "last_name"
    }
  },
  {
    "payer_id": "payer_id",
    "provider": {
      "npi": "npi"
    },
    "subscriber": {
      "first_name": "first_name",
      "last_name": "last_name"
    }
  }
]',
  'headers' => [
    'Authorization' => '<token>.',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://pre-api.joincandidhealth.com/eligibility-checks/v1/batch");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<token>.");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "[\n  {\n    \"payer_id\": \"payer_id\",\n    \"provider\": {\n      \"npi\": \"npi\"\n    },\n    \"subscriber\": {\n      \"first_name\": \"first_name\",\n      \"last_name\": \"last_name\"\n    }\n  },\n  {\n    \"payer_id\": \"payer_id\",\n    \"provider\": {\n      \"npi\": \"npi\"\n    },\n    \"subscriber\": {\n      \"first_name\": \"first_name\",\n      \"last_name\": \"last_name\"\n    }\n  }\n]", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "<token>.",
  "Content-Type": "application/json"
]
let parameters = [
  [
    "payer_id": "payer_id",
    "provider": ["npi": "npi"],
    "subscriber": [
      "first_name": "first_name",
      "last_name": "last_name"
    ]
  ],
  [
    "payer_id": "payer_id",
    "provider": ["npi": "npi"],
    "subscriber": [
      "first_name": "first_name",
      "last_name": "last_name"
    ]
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://pre-api.joincandidhealth.com/eligibility-checks/v1/batch")! 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()
```