# Providers

Page: https://sandbox.myclaimhouse.com/docs/providers

A provider is the dentist who rendered the treatment: each claim names one (`rendering_provider_id`). Providers belong to your organization and a mode, like offices.

## One provider per NPI

A provider is a person with one NPI, and one provider has that NPI in your organization and mode. A dentist who works at several of your offices or practices is one provider: providers are not scoped to an office or a practice group. What differs by place is the license, which is per state (below).

[`POST /providers`](https://sandbox.myclaimhouse.com/docs/api/createProvider.md) adds one. `licenses` holds one license per state:

```bash runnable status=200
curl "https://sandbox.myclaimhouse.com/api/v1/providers" \
  -H "Authorization: Bearer $CLAIMHOUSE_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d @- <<EOF
{
  "first_name": "Casey",
  "last_name": "Example",
  "credential": "DMD",
  "npi": "1999990066",
  "licenses": [{ "state": "GA", "number": "GA-000002" }, { "state": "TN", "number": "TN-000002" }]
}
EOF
```

An NPI already in use, on `POST` or [`PATCH`](https://sandbox.myclaimhouse.com/docs/api/updateProvider.md), answers `409 CONFLICT` with the provider that has it in `details.provider_id`. Use that ID instead:

```bash runnable status=409
curl "https://sandbox.myclaimhouse.com/api/v1/providers" \
  -H "Authorization: Bearer $CLAIMHOUSE_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{ "first_name": "Casey", "last_name": "Example", "npi": "1999990066" }'
```

Under another last name (case and punctuation aside), the NPI is another dentist's: `409 NPI_CONFLICT`, naming no one.

[`GET /providers`](https://sandbox.myclaimhouse.com/docs/api/listProviders.md) finds one by the digits of its NPI or the words of its name.

## Licenses by state

- `licenses` is a list of `{ state, number }`, one per state, in your order. On `PATCH` it replaces the list (`[]` removes them all); left out, it is kept.
- `license` (`{ number, state }`) is the older form: still accepted as a list of one, and returned as the first of `licenses`. It is deprecated; send `licenses`.
- A claim sends one license: the one for the state where the treatment happened, that is the claim's `service_location`, else the office's `default_service_location`, else the billing office. With none for that state the claim goes without one and gets the warning `NO_LICENSE_FOR_STATE`; a provider with no license at all gets `PROVIDER_LICENSE_MISSING`.

## IDs assigned by payers

`payer_provider_ids` holds a payer's own ID for the dentist, such as a Medicaid provider ID, as on an [office](https://sandbox.myclaimhouse.com/docs/offices.md#ids-assigned-by-payers): `{ payer_id, identifier }`, one per payer. A claim to that payer sends it as REF*G2 (2310B) unless the claim sends its own.

## Editing a provider

An edit applies to drafts, validated claims and claims that need attention, and to every claim queued after it. A claim already queued or sent keeps what it was queued with (its `snapshot`; see [Claims](https://sandbox.myclaimhouse.com/docs/claims.md#what-a-claim-sends-is-fixed-when-it-is-queued)), so an edit made for one practice never changes another practice's claims in flight. To change what a sent claim said, correct it.

Over [SFTP](https://sandbox.myclaimhouse.com/docs/sftp.md), a rendering NPI that belongs to a provider with another last name is refused (`npi_conflict`) rather than linked, so a mistyped NPI never lands on another dentist.
