βοΈ Prescriber Creation β Field Reference
This endpoint creates new prescriber records for a single clinic. All validations follow CreatePrescriberDto constraints.
| Field | Type | Description | Required |
|---|---|---|---|
| x-api-key | String | API Key for authentication | Y |
| clinicId | String | Clinic ID in header overrides route parameter | Y |
| Field | Type | Description | Required |
|---|---|---|---|
| fName | String | Prescriberβs first name β mandatory | Y |
| lName | String | Prescriberβs last name β mandatory | Y |
| username | String | Unique username β mandatory | Y |
| String | Email address β required if SMS consents are true. | Y | |
| phone | String | Numeric, 10β15 characters. β mandatory | Y |
| gender | String | βMβ / βFβ / βOβ. β optional | N |
| dateOfBirth | String | Format βYYYY-MM-DDβ. β optional | N |
| Field | Type | Description | Required |
|---|---|---|---|
| details.npi | Number | 10-digit NPI β mandatory | Y |
| details.dea | String | DEA number β conditional mandatory for controlled medications. | Y |
| details.speciality | String | Medical specialty β optional | N |
| details.providerType | String | Free-form text β optional | N |
| Field | Type | Description | Required |
|---|---|---|---|
| mailingAddress.address1 | String | mandatory | Y |
| mailingAddress.address2 | String | optional | N |
| mailingAddress.city | String | Validated city format β mandatory | Y |
| mailingAddress.state | String | Valid 2-letter US state β mandatory | Y |
| mailingAddress.zipCode | String | 5-digit numeric only β mandatory | Y |
| mailingAddress.country | String | Defaults to βUSβ. | Y |
| Field | Type | Description | Required |
|---|---|---|---|
| ifBillingSameAsMailing | boolean | βtrue/falseβ ,if true, billing uses mailing address. | Y |
| billingAddress | Address Object | Required only if not same as mailing. Billing Address object is optional only if βifBillingSameAsMailingβ is set to true | Y/N |
| Field | Type | Description | Required |
|---|---|---|---|
| authSmsConsent | boolean | boolean (true/false) β mandatory | Y |
| smsConsent | boolean | boolean β optional | N |
| dataRatesSmsConsent | boolean | boolean, defaults to true. β optional | N |
| Notice | Details |
|---|---|
| Validation | Field-level validation applied before processing. |
| Errors | Returns 401 for invalid API key/clinicId; 400 for invalid payload. |
| Bulk restriction | This endpoint handles 1 prescriber only. |
| Status Code | Error | Description | Solution |
|---|---|---|---|
| 401 | Authentication failed | Invalid API key or clinicId combination | Correct combination of ClinicId and API key to be provided |
| 400 | Validation failed | First name is required and can only contain letters (A-Z, a-z). No spaces, hyphens, apostrophes, numbers, special, binary, or SQL injection characters allowed. | First name cannot be empty. Provide name satisfying the conditions |
| 400 | Validation failed | Last name is required and can only contain letters (A-Z, a-z). No spaces, hyphens, apostrophes, numbers, special, binary, or SQL injection characters allowed. | Last Name cannot be empty. Provide name satisfying the conditions |
| 400 | Validation failed | Date of Birth is required, must be in YYYY-MM-DD format, year must be after 1900, and age must be 18 or older | DOB should be in proper format |
| 400 | Validation failed | gender must be one of M(male), F (female), O (other/unknown) | Provide proper Gender |
| 400 | Validation failed | email must be a valid email address and only contain letters, numbers, @, and . (no multiple consecutive dots or more than one @ symbol) | |
| 400 | Validation failed | phone must be 10 digits, optionally prefixed by +1, and contain only numbers | |
| 400 | Validation failed | NPI Registry validation failed: Invalid NPI type. Only individual NPIs (Type 1) are allowed. | Valid NPI needs to be provided |
| 400 | Validation failed | Failed to update prescriber/user/address: Failed to update user, please try again later | User Name should be unique and match with Prescriber NPI |
| 400 | Validation failed | Prescriber already exists but could not find user for update. | UserName and PrescriberNPI does not match. |
| 400 | Validation failed | address.address1 is required, must not contain βP.O Boxβ, βPOBoxβ, or βPost Office Boxβ, cannot have special, binary, or SQL injection characters, and must not contain script injection | |
| 400 | Validation failed | address.zipCode must be exactly 5 digits or 9 digits in format 12345-1234 |