BestRx Data Service API

Documentation
Introduction

Welcome to the BestRx Data Service API documentation

The BestRx Data Service API allows you to perform data operation at BestRx Pharmacy Management System in a simple, programmatic way using conventional HTTP requests. The endpoints are intuitive and powerful, allowing you to easily make calls to retrieve information or to execute actions.

The API documentation will start with a general overview about the design and technology that has been implemented, followed by reference information about specific endpoints.

Requests

Any tool that is fluent in HTTP can communicate with the API simply by requesting the correct URI. Requests should be made using the HTTPS protocol so that traffic is encrypted. The interface responds to different methods depending on the action required.

Method Usage
GET For simple retrieval of information you should use the GET method. The information you request will be returned to you as a JSON object. The attributes defined by the JSON object can be used to form additional requests. Any request using the GET method is read-only and will not affect any of the objects you are querying.
DELETE To destroy a resource and remove it, the DELETE method should be used. This will remove the specified object if it is found.
PUT To update the information about a resource in your account, the PUT method is available. Like the DELETE Method, the PUT method is idempotent. It sets the state of the target using the provided values, regardless of their current values. Requests using the PUT method do not need to check the current attributes of the object.
POST To create a new object, your request should specify the POST method. The POST request includes all of the attributes necessary to create a new object. When you wish to create a new object, send a POST request to the target endpoint.
HTTP Statuses

Along with the HTTP methods that the API responds to, it will also return standard HTTP statuses, including error codes.

In the event of a problem, the status will contain the error code, while the body of the response will usually contain additional information about the problem that was encountered.

In general, if the status returned is in the 200 range, it indicates that the request was fulfilled successfully and that no error was encountered.

Return codes in the 400 range typically indicate that there was an issue with the request that was sent. Among other things, this could mean that you did not authenticate correctly, that you are requesting an action that you do not have authorization for, that the object you are requesting does not exist, or that your request is malformed.

If you receive a status in the 500 range, this generally indicates a server-side problem. This means that we are having an issue on our end and cannot fulfill your request currently.

Responses

When a request is successful, a response body will typically be sent back in the form of a JSON object. An exception to this is when a DELETE request is processed, which will result in a successful HTTP 204 status and an empty response body.

Inside of this JSON object, the resource root that was the target of the request will be set as the key. This will be the singular form of the word if the request operated on a single object, and the plural form of the word if a collection was processed.

Authentication

In order to interact with the BestRx Data Service API, you or your application must authenticate. The BestRx Data Service API handles this through Basic Authentication.

Basic authentication is a simple authentication scheme built into the HTTP protocol. The client sends HTTP requests with the Authorization header that contains the word Basic word followed by a space and a base64-encoded string username:password. For example, to authorize as demo / p@55w0rd the client would send

Authorization: Basic ZGVtbzpwQDU1dzByZA==

Note: Because base64 is easily decoded, Basic authentication should only be used together with other security mechanisms such as HTTPS/SSL.

Examples

Throughout this document, some example API requests will be given using the http command. This will allow us to demonstrate the various endpoints in a simple, textual format.

Parameters

There are two different ways to pass parameters in a request with the API.

The best way to pass parameters is as a JSON object containing the appropriate attribute names and values as key-value pairs. When you use this format, you should specify that you are sending a JSON object in the header.

This is done by setting the Content-Type header to application/json. This ensures that your request is interpreted correctly.

Another way of passing parameters is using standard query attributes.

Using this format, you would pass the attributes within the URI itself. Tools like curl can take parameters and value as arguments to create the appropriate URI.

With curl this is done using the -F flag and then passing the key and value as an argument. The argument should take the form of a quoted string with the attribute being set to a value with an equal sign.

You could also use a standard query string if that would be easier in our application. In this case, the parameters would be embedded into the URI itself by appending a ? to the end of the URI and then setting each attribute with an equal sign. Attributes can be separated with a &.

PASS PARAMETERS AS A JSON OBJECT

curl -H "Authorization: Basic ZGVtbzpwQDU1dzByZA==" \
     -H "Content-Type: application/json" \
     -d '{"last_name": "doe", "first_name": "john"}' \
     -X POST "https://dataservice.bestrxconnect.com/patient" 

PASS PARAMETERS AS URI COMPONENTS

curl -H "Authorization: Basic ZGVtbzpwQDU1dzByZA==" \
     -F "last_name=doe" -F "first_name=john" \
     -X POST "https://dataservice.bestrxconnect.com/patient" 

PASS PARAMETERS AS A QUERY STRING

curl -H "Authorization: Basic ZGVtbzpwQDU1dzByZA==" \
     -X POST \
     "https://dataservice.bestrxconnect.com/patient?last_name=doe&first_name=john"
Cross Origin Resource Sharing
CORS

In order to make requests to the API from other domains, the API implements Cross Origin Resource Sharing (CORS) support.

CORS support is generally used to create AJAX requests outside of the domain that the request originated from. This is necessary to implement projects like control panels utilizing the API. This tells the browser that it can send requests to an outside domain.

The procedure that the browser initiates in order to perform these actions (other than GET requests) begins by sending a “preflight” request. This sets the Origin header and uses the OPTIONS method. The server will reply back with the methods it allows and some of the limits it imposes. The client then sends the actual request if it falls within the allowed constraints.

This process is usually done in the background by the browser, but you can use curl to emulate this process using the example provided. The headers that will be set to show the constraints are:

  • Access-Control-Allow-Origin: This is the domain that is sent by the client or browser as the origin of the request. It is set through an Origin header.

  • Access-Control-Allow-Methods: This specifies the allowed options for requests from that domain. This will generally be all available methods.

  • Access-Control-Expose-Headers: This will contain the headers that will be available to requests from the origin domain.

  • Access-Control-Max-Age: This is the length of time that the access is considered valid. After this expires, a new preflight should be sent.

  • Access-Control-Allow-Credentials: This will be set to true. It basically allows you to send your OAuth token for authentication.

You should not need to be concerned with the details of these headers, because the browser will typically do all of the work for you.

EXAMPLE PREFLIGHT REQUEST

curl -I -H "Origin: https://example.com" -X OPTIONS "https://dataservice.bestrxconnect.com/patient/addpatient" 

EXAMPLE PREFLIGHT RESPONSE

. . .
Access-Control-Allow-Origin: https://example.com
Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS
Access-Control-Expose-Headers: RateLimit-Limit, RateLimit-Remaining, RateLimit-Reset, Total, Link
Access-Control-Max-Age: 86400
Access-Control-Allow-Credentials: true
. . .
List of API endpoints
Prescription
POST /prescription/updategopuffstatus
UpdateGoPuffStatus
POST /prescription/updategopuffstatus

Authentication

Basic

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Basic ZGVtbzpwQDU1dzByZA==

Request body

Responses

200 200

OK

Body
application/json
Object
Drug
POST /drug/getdruginformation
GetDrugInformation
POST /drug/getdruginformation

Authentication

Basic

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Basic ZGVtbzpwQDU1dzByZA==

Request body

application/json

Responses

200 200

OK

Body
application/json
Patient

This section contains the endpoints that allow you to perform functions on patient records with the BestRx system.

This endpoints mostly covers following patient information

  1. Patient Demographics
  2. Family Information
  3. Billing Information (excluding Credit Card information)
  4. Insurance Information

Duplicate/Matching Patient Record: We will consider duplicate patient record based on patient first name, last name, date of birth, gender and zip code (if available).

Family Record: While adding new patient it will create new family record if relates_to_patient_id is empty.

Billing Information: Billing information is associated with family so if update billing information it will be updated for all patient belongs in same family.

POST /patient/submitchargeaccountpayment
POST /patient/addpatient
POST /patient/updatepatient
POST /patient/getpatient
SubmitChargeAccountPayment
POST /patient/submitchargeaccountpayment

Authentication

Basic

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Basic ZGVtbzpwQDU1dzByZA==

Request body

Responses

200 200

OK

Body
application/json
Object
Add Patient
POST /patient/addpatient

Authentication

Basic

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Basic ZGVtbzpwQDU1dzByZA==

Request body

application/json
Examples

Responses

200 200

OK

Body
application/json
Add Patient
POST https://dataservice.bestrxconnect.com/patient/addpatient HTTP/1.1 

Authorization: Basic ZGVtbzpwQDU1dzByZA==
Content-Type: application/json

{
    "PharmacyNumber": "1234567890",
    "unique_patient_id": 0,
    "allow_duplicate": false,
    "relates_to_patient_id": 0,
    "last_name": "Doe",
    "middle_name": "P",
    "first_name": "JOHN",
    "name_prefix": "Mr",
    "name_suffix": "Jr",
    "dob": "1980-01-01",
    "gender": "M",
    "address1": "1200 Jorie Blvd",
    "address2": "Suite 310",
    "city": "Oak Brook",
    "state": "IL",
    "zipcode": "60523",
    "country_code": "US",
    "home_phone": "1112223333",
    "work_phone": "4445556666",
    "cell_phone": "7778889999",
    "fax_number": "1112224444",
    "family_email": "family@doefamily.com",
    "patient_email": "john@doefamily.com",
    "marital_status": "S",
    "bill_last_name": "Karlowicz",
    "bill_first_name": "Katie",
    "bill_address_careof": "Doe, John",
    "bill_address1": "1200 Jorie Blvd",
    "bill_address2": "Suite 310",
    "bill_address_city": "Oak Brook",
    "bill_address_state": "IL",
    "bill_address_zipcode": "60523",
    "bill_phone": "6308939210",
    "patient_id_qualifier": "02",
    "patient_id": "P442-555-1225",
    "social_security_number": "111223333",
    "smoker": false,
    "loyalty_number": "PAT12345",
    "residence_code": "01",
    "dispense_by": "P",
    "340B_patient": false,
    "is_pet": false,
    "pet_name": "",
    "patient_short_remark": "give 10% discount",
    "patient_remark": "Longer remarks for to add more detailed info",
    "family_remark": "",
    "is_active": true,
    "is_deceased": false,
    "language": 0,
    "insurance_plans": [
        {
            "ins_bin": "012333",
            "ins_pcn": "ILFI",
            "ins_code": "ILFREE",
            "ins_name": "IL FREE Insurance",
            "ins_address1": "1200 Jorie Blvd",
            "ins_address2": "",
            "ins_city": "Oak Brook",
            "ins_state": "IL",
            "ins_zipcode": "60523",
            "ins_phone": "8001112222",
            "ins_remark": "Free insurance plan",
            "ins_fax_number": "8001112223",
            "ins_alternate_phone": "6308939210",
            "ins_email": "ILFREE@insurance.com",
            "ins_seq_no": 1,
            "ins_cardholder_id": "9999999901",
            "ins_person_code": "01",
            "ins_relation_code": "1",
            "ins_group": "GRPFI",
            "ins_is_primary": false
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "Data": {
        "insurance_plans": [
            {
                "ins_bin": "012333",
                "ins_pcn": "ILFI",
                "ins_code": "ILFREE",
                "ins_name": "IL FREE Insurance",
                "ins_address1": "1200 Jorie Blvd",
                "ins_address2": "",
                "ins_city": "Oak Brook",
                "ins_state": "IL",
                "ins_zipcode": "60523",
                "ins_phone": "8001112222",
                "ins_remark": "Free insurance plan",
                "ins_fax_number": "8001112223",
                "ins_alternate_phone": "6308939210",
                "ins_email": "ILFREE@insurance.com",
                "ins_seq_no": 1,
                "ins_cardholder_id": "9999999901",
                "ins_person_code": "01",
                "ins_relation_code": "1",
                "ins_group": "GRPFI",
                "ins_is_primary": true,
                "IsValid": true,
                "Messages": []
            }
        ],
        "unique_patient_id": 44410,
        "allow_duplicate": false,
        "relates_to_patient_id": 0,
        "last_name": "Doe",
        "middle_name": "P",
        "first_name": "JOHN",
        "name_prefix": "Mr",
        "name_suffix": "Jr",
        "dob": "1980-01-01T00:00:00",
        "gender": 1,
        "address1": "1200 Jorie Blvd",
        "address2": "Suite 310",
        "city": "Oak Brook",
        "state": "IL",
        "zipcode": "60523",
        "country_code": "US",
        "home_phone": "1112223333",
        "work_phone": "4445556666",
        "cell_phone": "7778889999",
        "fax_number": "1112224444",
        "family_email": "family@doefamily.com",
        "patient_email": "john@doefamily.com",
        "marital_status": "S",
        "bill_last_name": "Karlowicz",
        "bill_first_name": "Katie",
        "bill_address_careof": "Doe, John",
        "bill_address1": "1200 Jorie Blvd",
        "bill_address2": "Suite 310",
        "bill_address_city": "Oak Brook",
        "bill_address_state": "IL",
        "bill_address_zipcode": "60523",
        "bill_phone": "6308939210",
        "patient_id_qualifier": "02",
        "patient_id": "P442-555-1225",
        "social_security_number": "111223333",
        "smoker": false,
        "loyalty_number": "PAT12345",
        "residence_code": "01",
        "dispense_by": "P",
        "340B_patient": false,
        "is_pet": false,
        "pet_name": "",
        "patient_short_remark": "give 10% discount",
        "patient_remark": "Longer remarks for to add more detailed info",
        "family_remark": "",
        "is_active": true,
        "is_deceased": false,
        "language": 0,
        "PharmacyNumber": "5N201167",
        "PharmacyNCPDP": null
    },
    "IsValid": true,
    "Messages": []
}
Update Patient
POST /patient/updatepatient

Authentication

Basic

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Basic ZGVtbzpwQDU1dzByZA==

Request body

application/json

Responses

200 200

OK

Body
application/json
Update Patient
POST https://dataservice.bestrxconnect.com/patient/updatepatient HTTP/1.1 

Authorization: Basic ZGVtbzpwQDU1dzByZA==
Content-Type: application/json

{
    "PharmacyNumber": "1234567890",
    "unique_patient_id": 44410,
    "allow_duplicate": false,
    "relates_to_patient_id": 0,
    "last_name": "Doe",
    "middle_name": "P",
    "first_name": "Johnson",
    "name_prefix": "Mr",
    "name_suffix": "Sr",
    "dob": "1981-01-01",
    "gender": "M",
    "address1": "1200 Jorie Blvd",
    "address2": "Suite 330",
    "city": "Oak Brook",
    "state": "IL",
    "zipcode": "60123",
    "country_code": "US",
    "home_phone": "1112223333",
    "work_phone": "4445556666",
    "cell_phone": "7778889999",
    "fax_number": "1112224444",
    "family_email": "family@doefamily.com",
    "patient_email": "john@doefamily.com",
    "marital_status": "S",
    "bill_last_name": "Karlowicz",
    "bill_first_name": "Katie",
    "bill_address_careof": "Doe, John",
    "bill_address1": "1200 Jorie Blvd",
    "bill_address2": "Suite 310",
    "bill_address_city": "Oak Brook",
    "bill_address_state": "IL",
    "bill_address_zipcode": "60523",
    "bill_phone": "6308939210",
    "patient_id_qualifier": "02",
    "patient_id": "P442-555-1225",
    "social_security_number": "111223333",
    "smoker": false,
    "loyalty_number": "PAT12345",
    "residence_code": "01",
    "dispense_by": "P",
    "340B_patient": false,
    "is_pet": false,
    "pet_name": "",
    "patient_short_remark": "give 10% discount",
    "patient_remark": "Longer remarks for to add more detailed info",
    "family_remark": "",
    "is_active": true,
    "is_deceased": false,
    "language": 0,
    "insurance_plans": [
        {
            "ins_bin": "012333",
            "ins_pcn": "ILFI",
            "ins_code": "ILFREE",
            "ins_name": "IL FREE Insurance",
            "ins_address1": "1200 Jorie Blvd",
            "ins_address2": "",
            "ins_city": "Oak Brook",
            "ins_state": "IL",
            "ins_zipcode": "60523",
            "ins_phone": "8001112222",
            "ins_remark": "Free insurance plan",
            "ins_fax_number": "8001112223",
            "ins_alternate_phone": "6308939210",
            "ins_email": "ILFREE@insurance.com",
            "ins_seq_no": 1,
            "ins_cardholder_id": "9999999901",
            "ins_person_code": "01",
            "ins_relation_code": "1",
            "ins_group": "GRPFI",
            "ins_is_primary": false
        }
    ]
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "Data": {
        "insurance_plans": [
            {
                "ins_bin": "012333",
                "ins_pcn": "ILFI",
                "ins_code": "ILFREE",
                "ins_name": "IL FREE Insurance",
                "ins_address1": "1200 Jorie Blvd",
                "ins_address2": "",
                "ins_city": "Oak Brook",
                "ins_state": "IL",
                "ins_zipcode": "60523",
                "ins_phone": "8001112222",
                "ins_remark": "Free insurance plan",
                "ins_fax_number": "8001112223",
                "ins_alternate_phone": "6308939210",
                "ins_email": "ILFREE@insurance.com",
                "ins_seq_no": 1,
                "ins_cardholder_id": "9999999901",
                "ins_person_code": "01",
                "ins_relation_code": "1",
                "ins_group": "GRPFI",
                "ins_is_primary": true,
                "IsValid": true,
                "Messages": []
            }
        ],
        "unique_patient_id": 44410,
        "allow_duplicate": false,
        "relates_to_patient_id": 0,
        "last_name": "Doe",
        "middle_name": "P",
        "first_name": "Johnson",
        "name_prefix": "Mr",
        "name_suffix": "Sr",
        "dob": "1981-01-01T00:00:00",
        "gender": 1,
        "address1": "1200 Jorie Blvd",
        "address2": "Suite 330",
        "city": "Oak Brook",
        "state": "IL",
        "zipcode": "60123",
        "country_code": "US",
        "home_phone": "1112223333",
        "work_phone": "4445556666",
        "cell_phone": "7778889999",
        "fax_number": "1112224444",
        "family_email": "family@doefamily.com",
        "patient_email": "john@doefamily.com",
        "marital_status": "S",
        "bill_last_name": "Karlowicz",
        "bill_first_name": "Katie",
        "bill_address_careof": "Doe, John",
        "bill_address1": "1200 Jorie Blvd",
        "bill_address2": "Suite 310",
        "bill_address_city": "Oak Brook",
        "bill_address_state": "IL",
        "bill_address_zipcode": "60523",
        "bill_phone": "6308939210",
        "patient_id_qualifier": "02",
        "patient_id": "P442-555-1225",
        "social_security_number": "111223333",
        "smoker": false,
        "loyalty_number": "PAT12345",
        "residence_code": "01",
        "dispense_by": "P",
        "340B_patient": false,
        "is_pet": false,
        "pet_name": "",
        "patient_short_remark": "give 10% discount",
        "patient_remark": "Longer remarks for to add more detailed info",
        "family_remark": "",
        "is_active": true,
        "is_deceased": false,
        "language": 0,
        "PharmacyNumber": "5N201167",
        "PharmacyNCPDP": null
    },
    "IsValid": true,
    "Messages": []
}
Get Patient
POST /patient/getpatient

Authentication

Basic

Request headers

Content-Type
string required
Example:
application/json
Authorization
string required
Example:
Basic ZGVtbzpwQDU1dzByZA==

Request body

application/json

Responses

200 200

OK

Body
application/json
GetPatient
POST https://dataservice.bestrxconnect.com/patient/getpatient HTTP/1.1 

Authorization: Basic ZGVtbzpwQDU1dzByZA==
Content-Type: application/json

{
    "unique_patient_id": 44410,
    "PharmacyNumber": "1234567890",
    "PharmacyNCPDP": ""
}

HTTP/1.1 200 OK 

Content-Type: application/json

{
    "Data": {
        "insurance_plans": [
            {
                "ins_bin": "012333",
                "ins_pcn": "ILFI",
                "ins_code": "ILFREE",
                "ins_name": "IL FREE Insurance",
                "ins_address1": "1200 Jorie Blvd",
                "ins_address2": "",
                "ins_city": "Oak Brook",
                "ins_state": "IL",
                "ins_zipcode": "60523",
                "ins_phone": "8001112222",
                "ins_remark": "Free insurance plan",
                "ins_fax_number": "8001112223",
                "ins_alternate_phone": "6308939210",
                "ins_email": "ILFREE@insurance.com",
                "ins_seq_no": 1,
                "ins_cardholder_id": "9999999901",
                "ins_person_code": "01",
                "ins_relation_code": "1",
                "ins_group": "GRPFI",
                "ins_is_primary": true,
                "IsValid": true,
                "Messages": []
            }
        ],
        "unique_patient_id": 44410,
        "allow_duplicate": false,
        "relates_to_patient_id": 44410,
        "last_name": "DOE",
        "middle_name": "P",
        "first_name": "JOHN",
        "name_prefix": "Mr",
        "name_suffix": "Jr",
        "dob": "1980-01-01T00:00:00",
        "gender": 1,
        "address1": "1200 Jorie Blvd",
        "address2": "Suite 310",
        "city": "Oak Brook",
        "state": "IL",
        "zipcode": "60523",
        "country_code": "US",
        "home_phone": "1112223333",
        "work_phone": "4445556666",
        "cell_phone": "7778889999",
        "fax_number": "1112224444",
        "family_email": "family@doefamily.com",
        "patient_email": "john@doefamily.com",
        "marital_status": "S",
        "bill_last_name": "Karlowicz",
        "bill_first_name": "Katie",
        "bill_address_careof": "Doe, John",
        "bill_address1": "1200 Jorie Blvd",
        "bill_address2": "Suite 310",
        "bill_address_city": "Oak Brook",
        "bill_address_state": "IL",
        "bill_address_zipcode": "60523",
        "bill_phone": "6308939210",
        "patient_id_qualifier": "02",
        "patient_id": "P442-555-1225",
        "social_security_number": "111223333",
        "smoker": false,
        "loyalty_number": "PAT12345",
        "residence_code": "01",
        "dispense_by": "P",
        "340B_patient": false,
        "is_pet": false,
        "pet_name": "",
        "patient_short_remark": "give 10% discount",
        "patient_remark": "Longer remarks for to add more detailed info",
        "family_remark": "",
        "is_active": true,
        "is_deceased": false,
        "language": 0,
        "PharmacyNumber": "5N201167",
        "PharmacyNCPDP": null
    },
    "IsValid": true,
    "Messages": []
}
Data Reference
ChargeAccountPaymentRequestModel
Object
pharmacy
patient
txnDetails
DrugGetInfoRequestModel
Object
Type
string
Enumeration:
Rx
POS
ProductID
string
IncludeEquivalentDrug
boolean
PatientGetRequest
Object
unique_patient_id
integer

Unique identifier of the patient in the BestRx system.

example: 4567

PharmacyNumber
string

NPI of the pharmacy. Either PharmacyNumber or PharmacyNCPDP is required.

example: 1234567890

PharmacyNCPDP
string

NCPDP of the pharmacy. Either PharmacyNumber or PharmacyNCPDP is required.

example: 1122334

Methods: Get Patient
PatientInfoRequest
Object
unique_patient_id
integer int32

Unique identifier of the patient in the BestRx system.

example: 4567

allow_duplicate
boolean
Default:
false
relates_to_patient_id
integer int32 nullable

Indicates the patient record record number belongs to same family in BestRx system. Set this value in order to link patient with existing family.

last_name
string required

Patient’s last name

example: DOE

middle_name
string

Patient’s middle name

first_name
string required

Patient’s first name

example: JOHN

name_prefix
string

Prefix to patient’s name (ie Mr. Mrs., etc)

name_suffix
string

Suffix to patient’s name (ie Jr, III, etc)

dob
string date-time required

Patient date of birth in YYYY-MM-DD format

gender
string required

Patient’s gender (M/F)

Enumeration:
M
F
address1
string

Patient street address line 1

address2
string

Patient street address line 2 ( ie Unit Number or other identifying info)

city
string

Patient’s city portion of address

state
string

Patient’s state portion of address

zipcode
string

Patient’s zip code

country_code
string

Patient’s country code

Default:
US
home_phone
string

Patient’s home phone number

work_phone
string

Patient’s work phone number

cell_phone
string

Patient’s cell phone number

fax_number
string

Family’s shared fax number

family_email
string

Family’s shared email address

patient_email
string

Patient’s email address

marital_status
string

Patient’s marital status

Enumeration:
S

Single

M

Married

W

Widow

D

Divorced

bill_last_name
string

Patient’s last name in billing information

bill_first_name
string

Patient’s first name in billing information

bill_address_careof
string

Care of name in billing information

bill_address1
string

Patient street address line 1 in billing information

bill_address2
string

Patient street address line 2 (i.e. Unit Number or other identifying info) in billing information

bill_address_city
string

Patient’s city portion of address in billing information

bill_address_state
string

Patient’s state portion of address in billing information

bill_address_zipcode
string

Patient’s zip code portion of address in billing information

bill_phone
string

Patient’s phone number in billing information

patient_id_qualifier
string

Patient ID qualifier

01 = Social Security Number

02 = Driver’s License Number

03 = U.S. Military ID

04 = Non-SSN-based patient identifier assigned by health plan

05 = SSN-based patient identifier assigned by health plan

06 = Medicaid ID

07 = State Issued ID

08 = Passport ID

09 = Medicare HIC #

10 = Employer Assigned ID

11 = Payer/PBM Assigned ID

12 = Alien Number (Gov’t Permanent Residence #)

13 = Government Student VISA Number

14 = Indian Tribal ID

1J = Facility ID Number

EA = Medical Record Identification Number (EHR)

UI = Unique System ID

99 = Other

patient_id
string

Patient identification number

social_security_number
string

Patient’s social security number

smoker
boolean

Set true if patient is smoker

Default:
false
loyalty_number
string

Patient’s loyalty number

residence_code
string nullable

Patient’s residence code 00 = Not Specified

01 = Home

02 = Skilled Nursing Facility

03 = Nursing Facility

04 = Assisted Living Facility

05 = Custodial Care Facility

06 = Group Home

07 = Inpatient Psychiatric Facility

08 = Psychiatric Facility

09 = Intermediate Care Facility/Mentally Retarded

10 = Residential Substance Abuse Treatment Facility

11 = Hospice

12 = Psychiatric Residential Treatment Facility

13 = Comprehensive Inpatient Rehabilitation Facility

14 = Homeless Shelter

15 = Correctional Institution

dispense_by
string

Patient’s default dispense method

Enumeration:
P

Pickup

D

Delivery

M

Mail

Default:
P
340B_patient
boolean

Set it to true for 340B patient

Default:
false
is_pet
boolean

Indicates whether the patient is an animal

Default:
false
pet_name
string

Name of the Pet

patient_short_remark
string

Patient’s short remark

patient_remark
string

Patient’s long remark

family_remark
string

Patient’s family remark

is_active
boolean

Indicates whether the patient is active

Default:
true
is_deceased
boolean

Indicates whether the patient is deceased

Default:
false
language
string

Patient’s language

Enumeration:
English
Spanish
Arabic
Bengali
Chinese
Haitian_Creole
French
Gujarati
Hindi
Korean
Polish
Russian
Urdu
Vietnamese
Hebrew
Persian
Bosnian
Italian
Greek
German
Portuguese
Tagalog
Japanese
Armenian
Default:
English
insurance_plans

Array of insurance plans linked to this patient. Please refer to the Insurance Plan section of this document for more info.

PharmacyNumber
string

NPI of the pharmacy.

example: 1234567890

PharmacyNCPDP
string

NCPDP of the pharmacy.

example: 1122334

PatientInfoResponse
Object
IsValid
boolean
Messages
Array of MessageInfo
PatientInfo
Object
insurance_plans

Array of insurance plans linked to this patient. Please refer to the Insurance Plan section of this document for more info.

unique_patient_id
integer int32

Unique identifier of the patient in the BestRx system.

example: 4567

allow_duplicate
boolean
relates_to_patient_id
integer int32

Indicates the patient record record number belongs to same family in BestRx system.

last_name
string

Patient’s last name

example: DOE

middle_name
string

Patient’s middle name

first_name
string

Patient’s first name

example: JOHN

name_prefix
string

Prefix to patient’s name (ie Mr. Mrs., etc)

name_suffix
string

Suffix to patient’s name (ie Jr, III, etc)

dob
string date-time

Patient date of birth in YYYY-MM-DD format

gender
string

Patient’s gender (M/F)

Enumeration:
M
F
address1
string

Patient street address line 1

address2
string

Patient street address line 2 ( ie Unit Number or other identifying info)

city
string

Patient’s city portion of address

state
string

Patient’s state portion of address

zipcode
string

Patient’s zip code

country_code
string

Patient’s country code

home_phone
string

Patient’s home phone number

work_phone
string

Patient’s work phone number

cell_phone
string

Patient’s cell phone number

fax_number
string

Family’s shared fax number

family_email
string

Family’s shared email address

patient_email
string

Patient’s email address

marital_status
string

Patient’s marital status

Enumeration:
S

Single

M

Married

W

Widow

D

Divorced

bill_last_name
string

Patient’s last name in billing information

bill_first_name
string

Patient’s first name in billing information

bill_address_careof
string

Care of name in billing information

bill_address1
string

Patient street address line 1 in billing information

bill_address2
string

Patient street address line 2 (i.e. Unit Number or other identifying info) in billing information

bill_address_city
string

Patient’s city portion of address in billing information

bill_address_state
string

Patient’s zip code portion of address in billing information

bill_address_zipcode
string

Patient’s phone number in billing information

bill_phone
string

Patient’s phone number in billing information

patient_id_qualifier
string

Patient ID qualifier

01 = Social Security Number

02 = Driver’s License Number

03 = U.S. Military ID

04 = Non-SSN-based patient identifier assigned by health plan

05 = SSN-based patient identifier assigned by health plan

06 = Medicaid ID

07 = State Issued ID

08 = Passport ID

09 = Medicare HIC #

10 = Employer Assigned ID

11 = Payer/PBM Assigned ID

12 = Alien Number (Gov’t Permanent Residence #)

13 = Government Student VISA Number

14 = Indian Tribal ID

1J = Facility ID Number

EA = Medical Record Identification Number (EHR)

UI = Unique System ID

99 = Other

patient_id
string

Patient identification number

social_security_number
string

Patient’s social security number

smoker
boolean

Set true if patient is smoker

Default:
false
loyalty_number
string

Patient’s loyalty number

residence_code
string

Patient’s residence code 00 = Not Specified

01 = Home

02 = Skilled Nursing Facility

03 = Nursing Facility

04 = Assisted Living Facility

05 = Custodial Care Facility

06 = Group Home

07 = Inpatient Psychiatric Facility

08 = Psychiatric Facility

09 = Intermediate Care Facility/Mentally Retarded

10 = Residential Substance Abuse Treatment Facility

11 = Hospice

12 = Psychiatric Residential Treatment Facility

13 = Comprehensive Inpatient Rehabilitation Facility

14 = Homeless Shelter

15 = Correctional Institution

dispense_by
string

Patient’s default dispense method

Enumeration:
P

Pickup

D

Delivery

M

Mail

Default:
P
340B_patient
boolean

Set it to true for 340B patient

is_pet
boolean

Indicates whether the patient is an animal

pet_name
string

Name of the Pet

patient_short_remark
string

Patient’s short remark

patient_remark
string

Patient’s long remark

family_remark
string

Patient’s family remark

is_active
boolean

Indicates whether the patient is active

is_deceased
boolean

Indicates whether the patient is deceased

language
string

Patient’s language

Enumeration:
English
Spanish
Arabic
Bengali
Chinese
Haitian_Creole
French
Gujarati
Hindi
Korean
Polish
Russian
Urdu
Vietnamese
Hebrew
Persian
Bosnian
Italian
Greek
German
Portuguese
Tagalog
Japanese
Armenian
PharmacyNumber
string

NPI of the pharmacy.

example: 1234567890

PharmacyNCPDP
string

NCPDP of the pharmacy.

example: 1122334

PatientInsuranceRequest
Object
ins_bin
string

Insurance BIN

ins_pcn
string required

Process Control Number

Example:
ILFREE
ins_code
string

Unique code to identify insurance plan in BestRx system

ins_name
string

Name of the insurance plan

Example:
IL Free Insurance
ins_address1
string

Insurance street address line 1

Example:
1200 Jorie Blvd
ins_address2
string

Insurance street address line 2 ( ie Unit Number or other identifying info)

ins_city
string

City portion of Insurance address

Example:
Oak Brook
ins_state
string

State portion of Insurance address

Example:
IL
ins_zipcode
string

zip code

Example:
60523
ins_phone
string

Phone number

Example:
8001112222
ins_remark
string

Remarks

Example:
Free insurance plan
ins_fax_number
string

Fax number

Example:
8001112223
ins_alternate_phone
string

Altername phone number

Example:
6308939210
ins_email
string

email address of insurance plan

Example:
ILFREE@insurance.com
ins_seq_no
integer int32
ins_cardholder_id
string

Patient’s insurance identification number

Example:
9999999901
ins_person_code
string

Person code

Example:
01
ins_relation_code
string

Patient’s relationship with insurance cardholder

1 - Cardholder

2 - Spouse

3 - Child

4 - Other

5 - Student

6 - Disabled Dependent

7 - Adult Dependent

8 - Significant Other

X - Send Blank Code

ins_group
string

Patient’s insurance group number

Example:
GRPFI
ins_is_primary
boolean

Indicate true if this is the primary insurance for patient. If patient has only one insurace on file it will be primary by default.

Default:
false
Example:
true
PatientInsuranceResponse
Object
ins_bin
string
ins_pcn
string
ins_code
string
ins_name
string
ins_address1
string
ins_address2
string
ins_city
string
ins_state
string
ins_zipcode
string
ins_phone
string
ins_remark
string
ins_fax_number
string
ins_alternate_phone
string
ins_email
string
ins_seq_no
integer int32
ins_cardholder_id
string
ins_person_code
string
ins_relation_code
string
ins_group
string
ins_is_primary
boolean
IsValid
boolean
Messages
Array of MessageInfo
Types: PatientInfo
Product
Object
SKU
string
Description
string
ShortDescription
string
CurrentQOH
integer int32
TaxRate
number double
RegPrice
number double
Status
string
Drug
Object
DrugName
string
NDC
string
PkgSize
number double
UnitOfMeasure
integer int32
AWP
number double
DirectPrice
number double
FedMACPrice
number double
CustomDispensePrice
number double
AcquisitionCost
number double
CurrentQOH
number double
MinimumQOH
number double
Manufacturer
string
LotExpDate
string
LotNo
string
ControlClass
integer int32
GenericDrug
boolean
MaintenanceMedication
boolean
ActiveIndicator
boolean
PreferredDrug
boolean
CompoundDrug
boolean
340B
boolean
Remarks
string
UpdateGoPuffStatusRequestModel
Object
ExternalMsgID
string
Status
string
Enumeration:
LOCK
UNLOCK
DrugGetInfoResponseModel
Object
Drug
Array of Drug
Product
DrugGetInfoResponseModel
Object
IsValid
boolean
Messages
Array of MessageInfo
BaseRequestModel
Object
PharmacyNumber
string
PharmacyNCPDP
string
Patient
Object
unique_patient_id
integer int64
dob
string date-time
Pharmacy
Object
PharmacyNumber
string
TxnDetails
Object
txnDate
string date-time
txnAmount
number double
remarks
string
MessageInfo
Object
MessageCode
string
Message
string
MessageType
string
Enumeration:
Information
Warning
Error
Success
Unknown
Headers
Content-Type
string required
Applied to all operations
Example:
application/json
Authorization
string required
Applied to all operations
Example:
Basic ZGVtbzpwQDU1dzByZA==