
# Quickstart

This guide walks through submitting a member enrollment snapshot and polling for results.

## 1. Submit a Snapshot

POST an array of member snapshot objects to `/api-integrations/ichrax/v1/member-snapshots`. Each object represents one employee and their enrollment.

```json
[
  {
    "company": { "partner_company_id": "COMP-001", "name": "Example Company", "tin": "12-3456789" },
    "enrollment_action": "new_enrollment",
    "employee": {
      "person": {
        "partner_individual_id": "EMP-001",
        "first_name": "Jane",
        "last_name": "Smith",
        "date_of_birth": "1985-03-15",
        "sex": "F",
        "ssn": "123-45-6789",
        "home_address": {
          "street_one": "123 Main St",
          "city": "Springfield",
          "state": "IL",
          "zip_code": "62701",
          "county_fips_id": "17167"
        },
        "mailing_address": {
          "street_one": "123 Main St",
          "city": "Springfield",
          "state": "IL",
          "zip_code": "62701",
          "county_fips_id": "17167"
        }
      },
      "employment": {
        "employment_status": "full-time",
        "employment_dates": {
          "hire_date": "2020-06-01"
        }
      }
    },
    "coverage": {
      "carrier_id": "anthem",
      "plan_hios_id": "12345IL0010001-01",
      "plan_type": "ppo",
      "coverage_members": [
        {
          "partner_individual_id": "EMP-001",
          "action": "enroll",
          "effective_start_date": "2026-01-01",
          "effective_end_date": "2026-12-31"
        }
      ]
    },
    "events": [
      {
        "id": "EVT-001",
        "type": "coverage",
        "date": "2026-01-01",
        "reason": "open_enrollment"
      }
    ]
  }
]
```

A successful `202 Accepted` response returns a `snapshot_id` for polling:

```json
{
  "snapshot_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "items": []
}
```

## 2. Poll for Status

GET `/api-integrations/ichrax/v1/member-snapshots/{snapshot_id}` until processing completes:

```http
GET /api-integrations/ichrax/v1/member-snapshots/a1b2c3d4-e5f6-7890-abcd-ef1234567890
x-api-key: your-api-key-here
```

The response includes a top-level `status` and per-member results in `body`:

```json
{
  "snapshot_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "completed",
  "body": [
    {
      "partner_individual_id": "EMP-001",
      "code": 200,
      "carrier_application_id": "APP-1029384",
      "messages": []
    }
  ]
}
```

Poll until `status` is no longer `pending` or `processing`. A `completed` status does not guarantee all members succeeded — always check individual `code` values.

`carrier_application_id` is the carrier's own reference for the member's application (an Oscar application id, an Anthem ACN, and so on). It is `null` until the carrier issues one and is returned whether or not the transmission succeeded, so it is the number to quote when contacting the carrier.

## 3. Check Current Coverage

GET `/api-integrations/ichrax/v1/coverage/{partner_individual_id}` with the subscriber's `partner_individual_id` to see the coverage their family holds on a date:

```http
GET /api-integrations/ichrax/v1/coverage/EMP-001?as_of=2026-09-03
x-api-key: your-api-key-here
```

The response groups the family's coverage by plan. Each plan lists every covered member with their own coverage dates:

```json
{
  "partner_individual_id": "EMP-001",
  "as_of": "2026-09-03",
  "coverages": [
    {
      "internal_company_id": "ACME",
      "carrier_id": "12345",
      "plan_hios_id": "12345NY0010001",
      "plan_year": 2026,
      "members": [
        { "partner_individual_id": "EMP-001", "relationship": "subscriber", "effective_date": "2026-01-01", "end_date": "2026-12-31" },
        { "partner_individual_id": "DEP-001", "relationship": "spouse", "effective_date": "2026-03-01", "end_date": "2026-12-31" }
      ]
    }
  ]
}
```

`as_of` defaults to today. Pass a future date to confirm an enrollment that has not started yet, for example `as_of=2027-01-01` during open enrollment. The id in the path must be the subscriber's; a dependent's id returns `404`. A subscriber whose coverage has all ended before `as_of` returns `200` with an empty `coverages` array, while a subscriber with no recorded coverage at all returns `404`.

## Per-Member Status Codes

| Code | Meaning |
|------|---------|
| `200` | Member processed successfully |
| `207` | Partial success — review messages |
| `400` | Validation failure — member not submitted |
| `500` | Internal error processing this member |

## Adding Dependents

Include a `dependents` array alongside the employee. Dependents must also be listed in `coverage_members` within the coverage record.

```json
{
  "company": { "partner_company_id": "COMP-001", "name": "Example Company", "tin": "12-3456789" },
  "employee": { "..." },
  "dependents": [
    {
      "relationship": "spouse",
      "person": {
        "partner_individual_id": "DEP-001",
        "first_name": "John",
        "last_name": "Smith",
        "date_of_birth": "1983-07-22",
        "sex": "M",
        "home_address": { "..." },
        "mailing_address": { "..." }
      }
    }
  ],
  "coverage": {
    "carrier_id": "anthem",
    "plan_hios_id": "12345IL0010001-01",
    "coverage_members": [
      { "partner_individual_id": "EMP-001", "action": "enroll", "effective_start_date": "2026-01-01", "effective_end_date": "2026-12-31" },
      { "partner_individual_id": "DEP-001", "action": "enroll", "effective_start_date": "2026-01-01", "effective_end_date": "2026-12-31" }
    ]
  }
}
```

## Anthem-Specific Configuration

For Anthem plans, pass an `AnthemVendorInboundContext` object in `carrier_specific_config`:

```json
{
  "coverage": {
    "carrier_id": "anthem",
    "plan_hios_id": "12345IL0010001-01",
    "carrier_specific_config": {
      "electronic_communication_consent": true,
      "establish_hsa": false,
      "current_coverage_is_anthem": false,
      "pediatric_dental_purchased": false
    },
    "coverage_members": [ "..." ]
  }
}
```

## Full Enrollment Example

A complete `new_enrollment` snapshot exercising every optional section — person contact and details, employment, PCP and prior coverage, agent, agency, payment, and carrier-specific config. `coverage_members[].event_id` references an entry in the top-level `events` array.

```json
[
  {
    "company": {
      "partner_company_id": "acme-corp",
      "name": "Acme Corp",
      "tin": "1234"
    },
    "enrollment_action": "new_enrollment",
    "employee": {
      "person": {
        "partner_individual_id": "7741052",
        "first_name": "Jane",
        "last_name": "Smith",
        "date_of_birth": "1987-04-19",
        "sex": "F",
        "ssn": "123-45-6789",
        "marital_status": "domestic-partner",
        "home_address": {
          "street_one": "345 Sample Street",
          "city": "Indianapolis",
          "state": "IN",
          "zip_code": "46203",
          "county_fips_id": "18097"
        },
        "mailing_address": {
          "street_one": "345 Sample Street",
          "city": "Indianapolis",
          "state": "IN",
          "zip_code": "46203",
          "county_fips_id": "18097"
        },
        "contact": {
          "email": "jane.smith@example.com",
          "phone": "3175550148",
          "preferred_language": "en",
          "preferred_method": "EMAIL"
        },
        "details": {
          "tobacco": {
            "user": false
          }
        }
      },
      "employment": {
        "employment_status": "full-time",
        "employment_dates": {
          "hire_date": "2025-01-01"
        }
      }
    },
    "coverage": {
      "carrier_id": "17575",
      "plan_hios_id": "17575IN0990010",
      "carrier_plan_id": "8XTB",
      "plan_type": "hmo",
      "carrier_specific_config": {
        "agent_tin": "QWPLZMNTRB",
        "agency_tin": "VXRDFHJKLP",
        "is_agent_assisted": true,
        "electronic_communication_consent": true,
        "establish_hsa": false,
        "current_coverage_is_anthem": false,
        "is_agree_to_electronic_signature": true,
        "is_read_completed_app": true,
        "is_agree_to_mem_communication": true,
        "is_read_understand_enroll_form": true,
        "have_disabled_dependent": false,
        "pediatric_dental_purchased": false,
        "members": [
          {
            "partner_individual_id": "7741052",
            "is_legal_resident": true,
            "is_incarcerated": false,
            "is_medicare_eligible": false,
            "is_medicare_enrolled": false,
            "is_medicaid_enrolled": false
          }
        ]
      },
      "coverage_members": [
        {
          "partner_individual_id": "7741052",
          "action": "enroll",
          "effective_start_date": "2026-07-01",
          "effective_end_date": "2026-12-31",
          "event_id": "ichra-effective",
          "pcp_details": {
            "npi": "1538291746"
          },
          "prior_coverage": {
            "coverage_end_date": "2026-03-31",
            "term_with_new_policy": true
          }
        }
      ],
      "agent": {
        "first_name": "Robert",
        "last_name": "Hartley",
        "phone": "8035550172",
        "email_address": "licensing@example-agency.com",
        "address": {
          "street_one": "76 Harbor Rd",
          "city": "Columbia",
          "state": "SC",
          "zip_code": "29201"
        }
      },
      "agency": {
        "name": "Hartley Benefits Group",
        "tin": "VXRDFHJKLP",
        "email": "licensing@example-agency.com",
        "address": {
          "street_one": "76 Harbor Rd",
          "city": "Columbia",
          "state": "SC",
          "zip_code": "29201"
        }
      },
      "payment": {
        "monthly_premium": 713.72,
        "billing_address": {
          "street_one": "440 Oak Hollow Dr",
          "city": "Dublin",
          "state": "OH",
          "zip_code": "43017"
        },
        "credit_card": {
          "card_type": "VISA",
          "card_holder_name": "Jane Smith",
          "card_number": "4111111111111111",
          "expiration_date": "06/2031",
          "security_code": "417"
        }
      }
    },
    "events": [
      {
        "id": "ichra-effective",
        "type": "coverage",
        "date": "2026-06-01",
        "reason": "new_hire"
      }
    ]
  }
]
```
