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

# Create Ordering Provider

POST https://api.joincandidhealth.com/api/encounter-providers/v2/{service_line_id}/create-ordering-provider
Content-Type: application/json

Reference: https://docs.joincandidhealth.com/api-reference/encounter-providers/v-2/create-ordering-provider

## Authentication

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

## Servers

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

## Request

### Path parameters

- `service_line_id` (UUID, required)

### Body (application/json)

This endpoint expects an OrderingProvider.

- `npi` (string, required) — A National Provider Identifier is a unique 10-digit identification number issued to health care providers in the United States
- `address` (StreetAddressLongZip, optional)
- `first_name` (string, optional) — If the provider is an individual, this should be set instead of organization name
- `last_name` (string, optional) — If the provider is an individual, this should be set instead of organization name
- `organization_name` (string, optional) — If the provider is an organization, this should be set instead of first + last name
- `taxonomy_code` (string, optional)

## Response

### 200

- `address` (StreetAddressLongZip, required)
- `npi` (string, required)
- `provider_id` (UUID, required)
- `first_name` (string, optional) — If the provider is an individual, this should be set instead of organization name
- `last_name` (string, optional) — If the provider is an individual, this should be set instead of organization name
- `organization_name` (string, optional) — If the provider is an organization, this should be set instead of first + last name
- `provider_commercial_license_type` (enum, optional) — 837i Loop2010BB G2 Provider Commercial Number
  - Allowed values: `0`, `A`, `B`, `C`, `D`, `E`, `F`, `G`, `H`, `I`
- `qualifier` (enum, optional)
  - Allowed values: `DQ`, `DN`, `DK`, `P3`
- `secondary_identification` (ProviderSecondaryIdentification, optional) — Only one of provider_commercial_license_type or secondary_identification may be provided 837i Loop2010BB G2 Secondary Identification
- `tax_id` (string, optional)
- `taxonomy_code` (string, optional)

## Errors

### 409 Entity Conflict Error

- `errorName` ("EntityConflictError", required)
- `content` (EntityConflictErrorMessage, required)

### 422 HTTP Request Validations Error

- `errorName` ("HttpRequestValidationsError", required)
- `content` (list of RequestValidationError, required)

### 404 Entity Not Found Error

- `errorName` ("EntityNotFoundError", required)
- `content` (EntityNotFoundErrorMessage, required)

## Types

### StreetAddressLongZip

- `address1` (string, required)
- `city` (string, required)
- `state` (enum, required)
  - Allowed values: `AA`, `AE`, `AP`, `AL`, `AK`, `AS`, `AZ`, `AR`, `CA`, `CO`, `CT`, `DC`, `DE`, `FL`, `FM`, `GA`, `GU`, `HI`, `ID`, `IL`, `IN`, `IA`, `KS`, `KY`, `LA`, `ME`, `MD`, `MA`, `MH`, `MI`, `MN`, `MP`, `MS`, `MO`, `MT`, `NE`, `NV`, `NH`, `NJ`, `NM`, `NY`, `NC`, `ND`, `OH`, `OK`, `OR`, `PA`, `PR`, `PW`, `RI`, `SC`, `SD`, `TN`, `TX`, `UT`, `VI`, `VT`, `VA`, `WA`, `WV`, `WI`, `WY`, `FC`
- `zip_code` (string, required) — 5-digit zip code
- `zip_plus_four_code` (string, required) — 4-digit zip add-on code https://en.wikipedia.org/wiki/ZIP_Code#ZIP+4
- `address2` (string, optional)

### ProviderSecondaryIdentification

- `reference_identification` (string, required) — Represents REF02 on the EDI 837 Loop 2010BB Billing Provider Secondary Identification segment. Value cannot exceed 50 characters
- `reference_identification_qualifier` (enum, optional) — Represents REF01 on the EDI 837 Loop 2010BB Provider Secondary Identification segment.
  - Allowed values: `0B`, `1G`, `G2`, `LU`

### EntityConflictErrorMessage

- `entity_name` (string, required)

### RequestValidationError

- `fieldName` (string, required)
- `humanReadableMessage` (string, optional)

### EntityNotFoundErrorMessage

- `id` (string, required)

## Examples

**Request**

```json
{
  "npi": "npi"
}
```

**Response**

```json
{
  "address": {
    "address1": "address1",
    "city": "city",
    "state": "AA",
    "zip_code": "zip_code",
    "zip_plus_four_code": "zip_plus_four_code",
    "address2": "address2"
  },
  "npi": "npi",
  "provider_id": "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32",
  "first_name": "first_name",
  "last_name": "last_name",
  "organization_name": "organization_name",
  "provider_commercial_license_type": "0",
  "qualifier": "DQ",
  "secondary_identification": {
    "reference_identification": "reference_identification",
    "reference_identification_qualifier": "0B"
  },
  "tax_id": "tax_id",
  "taxonomy_code": "taxonomy_code"
}
```

**SDK Code**

```python
import requests

url = "https://api.joincandidhealth.com/api/encounter-providers/v2/d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32/create-ordering-provider"

payload = { "npi": "npi" }
headers = {
    "Authorization": "<token>.",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.joincandidhealth.com/api/encounter-providers/v2/d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32/create-ordering-provider';
const options = {
  method: 'POST',
  headers: {Authorization: '<token>.', 'Content-Type': 'application/json'},
  body: '{"npi":"npi"}'
};

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://api.joincandidhealth.com/api/encounter-providers/v2/d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32/create-ordering-provider"

	payload := strings.NewReader("{\n  \"npi\": \"npi\"\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://api.joincandidhealth.com/api/encounter-providers/v2/d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32/create-ordering-provider")

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  \"npi\": \"npi\"\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://api.joincandidhealth.com/api/encounter-providers/v2/d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32/create-ordering-provider")
  .header("Authorization", "<token>.")
  .header("Content-Type", "application/json")
  .body("{\n  \"npi\": \"npi\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.joincandidhealth.com/api/encounter-providers/v2/d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32/create-ordering-provider', [
  'body' => '{
  "npi": "npi"
}',
  'headers' => [
    'Authorization' => '<token>.',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.joincandidhealth.com/api/encounter-providers/v2/d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32/create-ordering-provider");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<token>.");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"npi\": \"npi\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.joincandidhealth.com/api/encounter-providers/v2/d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32/create-ordering-provider")! 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()
```