Pharmacy API (1.0.0)

API reference for pharmacies to integrate with PHIL.

Download OpenAPI description
Languages
Servers
Mock server
https://docs.partner-api.phil.us/_mock/apis/

Partner APIs

Your APIs.

Operations

Request and Response Data

Details on request and response data.

TransferRequest

metadataobject(RequestMetadata)required

additional information about the request and response data

metadata.​requestIDstringrequired

unique identifier for an API request

metadata.​patientReferenceIDstringrequired

unique identifier for our patient profile

metadata.​requestTimestampstring(date-time)required

timestamp for the API request.

metadata.​retryCountinteger

number of times that this request has been retried

metadata.​property name*anyadditional property
patientobject(Patient)required

Patient details

patient.​nameobject(Name)required
patient.​name.​lastNamestring[ 1 .. 35 ] charactersrequired
patient.​name.​firstNamestring[ 1 .. 35 ] charactersrequired
patient.​name.​middleNamestring or null[ 1 .. 35 ] charactersrequired
patient.​name.​prefixstring or null[ 1 .. 10 ] charactersrequired
patient.​name.​suffixstring or null[ 1 .. 10 ] charactersrequired
patient.​dateOfBirthstring(date)required
Example: "1992-03-20"
patient.​genderstringrequired

Code identifying the sex of the individual.:

  • M - Male
  • F - Female
  • U - Not specified or unknown
Enum"M""F""U"
patient.​addressobject(Address)required
patient.​address.​addressLine1string[ 1 .. 40 ] charactersrequired
patient.​address.​addressLine2string or null[ 1 .. 40 ] charactersrequired

Use only when needed and AddressLine1 has been used

patient.​address.​citystring[ 1 .. 35 ] charactersrequired
patient.​address.​statestring= 2 charactersrequired

2-letter code for the state

Example: "WA"
patient.​address.​postalCodestringrequired

5-digit or 9-digit postalCode

Example: [74729,"74729-0140"]
patient.​address.​countryCodestring[ 1 .. 2 ] charactersrequired
patient.​emailstring or null(email)required
Example: "patient@example.com"
patient.​contactInfoobject or null(ContactInfo)required
patient.​contactInfo.​countryCodestringrequired

phone number coutry code

Example: "+1"
patient.​contactInfo.​phoneNumberstring^\d{10}$required

10-digit phone number

Example: "3231234532"
patient.​allergyDetailsobject(AllergyDetails)required
patient.​allergyDetails.​allergiesDescriptorstringrequired
Enum"KNOWN_ALLERGIES_INCLUDED""NO_KNOWN_ALLERGIES""NOT_AVAILABLE"
patient.​allergyDetails.​allergiesArray of strings>= 0 itemsrequired

a list of allergy descriptions

prescriberobject(Prescriber)required

a licensed healthcare professional who authorized the prescription for the patient

prescriber.​deastring or nullrequired

DEA registration number

prescriber.​npistringrequired

a 10-digit identifier for the pharmacy

prescriber.​nameobject(Name)required
prescriber.​name.​lastNamestring[ 1 .. 35 ] charactersrequired
prescriber.​name.​firstNamestring[ 1 .. 35 ] charactersrequired
prescriber.​name.​middleNamestring or null[ 1 .. 35 ] charactersrequired
prescriber.​name.​prefixstring or null[ 1 .. 10 ] charactersrequired
prescriber.​name.​suffixstring or null[ 1 .. 10 ] charactersrequired
prescriber.​addressobject(Address)required
prescriber.​address.​addressLine1string[ 1 .. 40 ] charactersrequired
prescriber.​address.​addressLine2string or null[ 1 .. 40 ] charactersrequired

Use only when needed and AddressLine1 has been used

prescriber.​address.​citystring[ 1 .. 35 ] charactersrequired
prescriber.​address.​statestring= 2 charactersrequired

2-letter code for the state

Example: "WA"
prescriber.​address.​postalCodestringrequired

5-digit or 9-digit postalCode

Example: [74729,"74729-0140"]
prescriber.​address.​countryCodestring[ 1 .. 2 ] charactersrequired
prescriber.​faxNumberstring or nullrequired

prescriber fax number

prescriber.​emailstring or null(email)required
Example: "doctor@example.com"
prescriber.​contactInfoobject or null(ContactInfo)required
prescriber.​contactInfo.​countryCodestringrequired

phone number coutry code

Example: "+1"
prescriber.​contactInfo.​phoneNumberstring^\d{10}$required

10-digit phone number

Example: "3231234532"
prescriptionobject(Prescription)required
prescription.​rxNumberstringrequired

a unique number that identifies the prescription

prescription.​prescribedNDCstring[ 1 .. 11 ] charactersrequired

a uniqie 11-digit code that identifies the prescribed medication

Example: "47335050696"
prescription.​dispensedNDCstring or null[ 1 .. 11 ] charactersrequired

a uniqie 11-digit code that identifies the medication to be dispensed. If the same as prescribedNDC, value will be null.

prescription.​medicationNamestringrequired

prescribed medication name

prescription.​drugFormstringrequired

prescribed medication form (capsules, tablets, ointment, etc.)

prescription.​drugStrengthstringrequired

prescribed medication strength

Example: "0.03 MG"
prescription.​daysSupplyintegerrequired

prescribed days of supply

Example: 30
prescription.​dawCodeinteger or null[ 0 .. 9 ]required

dispense as written

prescription.​sigstringrequired

prescription sig to specify how much, how often, and how to take a medication

prescription.​faxImageURLstring or nullrequired

transfer fax image URL

prescription.​quantityWrittennumberrequired

prescription medication quantity written

Example: 8.4
prescription.​quantityDispensednumberrequired

Prescription quantity that we want dispensed for each order (may be different than what's written)

prescription.​refillsAuthorizedintegerrequired

the number of prescription refills originally written, including first fill

prescription.​refillsRemainingintegerrequired

the number of subsequent refills remaining on the prescription

prescription.​writtenDatestring(date-time)required

Prescription written date

Example: "2024-09-11T12:00:00.000Z"
prescription.​firstFilledDatestring or null(date-time)required

prescription first filled date

prescription.​lastFilledDatestring or null(date-time)required

prescription last filled date

prescription.​expirationDatestring(date-time)required

date the prescription expires

Example: "2025-09-15T12:00:00.000Z"
prescription.​canSubstitutebooleanrequired

whether or not prescription can be substituted for another

prescription.​icdCodestring or nullrequired

a standardized code assigned to diagnose medical conditions

sendingPharmacyobject(Pharmacy)required

pharamcy details used for sending pharmacy (PHIL) or receiving pharmacy (partner pharmacies)

sendingPharmacy.​deastring or nullrequired

DEA registration number

sendingPharmacy.​npistringrequired

a 10-digit identifier for the pharmacy

sendingPharmacy.​namestringrequired

pharamcy name

sendingPharmacy.​pharmacistobject(Name)required
sendingPharmacy.​pharmacist.​lastNamestring[ 1 .. 35 ] charactersrequired
sendingPharmacy.​pharmacist.​firstNamestring[ 1 .. 35 ] charactersrequired
sendingPharmacy.​pharmacist.​middleNamestring or null[ 1 .. 35 ] charactersrequired
sendingPharmacy.​pharmacist.​prefixstring or null[ 1 .. 10 ] charactersrequired
sendingPharmacy.​pharmacist.​suffixstring or null[ 1 .. 10 ] charactersrequired
sendingPharmacy.​addressobject(Address)required
sendingPharmacy.​address.​addressLine1string[ 1 .. 40 ] charactersrequired
sendingPharmacy.​address.​addressLine2string or null[ 1 .. 40 ] charactersrequired

Use only when needed and AddressLine1 has been used

sendingPharmacy.​address.​citystring[ 1 .. 35 ] charactersrequired
sendingPharmacy.​address.​statestring= 2 charactersrequired

2-letter code for the state

Example: "WA"
sendingPharmacy.​address.​postalCodestringrequired

5-digit or 9-digit postalCode

Example: [74729,"74729-0140"]
sendingPharmacy.​address.​countryCodestring[ 1 .. 2 ] charactersrequired
sendingPharmacy.​emailstring(email)required
Example: "pharmacy@example.com"
sendingPharmacy.​contactInfoobject or null(ContactInfo)required
sendingPharmacy.​contactInfo.​countryCodestringrequired

phone number coutry code

Example: "+1"
sendingPharmacy.​contactInfo.​phoneNumberstring^\d{10}$required

10-digit phone number

Example: "3231234532"
receivingPharmacyobject(Pharmacy)required

pharamcy details used for sending pharmacy (PHIL) or receiving pharmacy (partner pharmacies)

receivingPharmacy.​deastring or nullrequired

DEA registration number

receivingPharmacy.​npistringrequired

a 10-digit identifier for the pharmacy

receivingPharmacy.​namestringrequired

pharamcy name

receivingPharmacy.​pharmacistobject(Name)required
receivingPharmacy.​pharmacist.​lastNamestring[ 1 .. 35 ] charactersrequired
receivingPharmacy.​pharmacist.​firstNamestring[ 1 .. 35 ] charactersrequired
receivingPharmacy.​pharmacist.​middleNamestring or null[ 1 .. 35 ] charactersrequired
receivingPharmacy.​pharmacist.​prefixstring or null[ 1 .. 10 ] charactersrequired
receivingPharmacy.​pharmacist.​suffixstring or null[ 1 .. 10 ] charactersrequired
receivingPharmacy.​addressobject(Address)required
receivingPharmacy.​address.​addressLine1string[ 1 .. 40 ] charactersrequired
receivingPharmacy.​address.​addressLine2string or null[ 1 .. 40 ] charactersrequired

Use only when needed and AddressLine1 has been used

receivingPharmacy.​address.​citystring[ 1 .. 35 ] charactersrequired
receivingPharmacy.​address.​statestring= 2 charactersrequired

2-letter code for the state

Example: "WA"
receivingPharmacy.​address.​postalCodestringrequired

5-digit or 9-digit postalCode

Example: [74729,"74729-0140"]
receivingPharmacy.​address.​countryCodestring[ 1 .. 2 ] charactersrequired
receivingPharmacy.​emailstring(email)required
Example: "pharmacy@example.com"
receivingPharmacy.​contactInfoobject or null(ContactInfo)required
receivingPharmacy.​contactInfo.​countryCodestringrequired

phone number coutry code

Example: "+1"
receivingPharmacy.​contactInfo.​phoneNumberstring^\d{10}$required

10-digit phone number

Example: "3231234532"
primaryInsuranceobject or null(Insurance)required
primaryInsurance.​planNamestringrequired

Patient insurance plan name

primaryInsurance.​cardHolderIDstring[ 1 .. 35 ] charactersrequired

Patient insurance ID number

primaryInsurance.​cardHolderNameobject(Name)required
primaryInsurance.​cardHolderName.​lastNamestring[ 1 .. 35 ] charactersrequired
primaryInsurance.​cardHolderName.​firstNamestring[ 1 .. 35 ] charactersrequired
primaryInsurance.​cardHolderName.​middleNamestring or null[ 1 .. 35 ] charactersrequired
primaryInsurance.​cardHolderName.​prefixstring or null[ 1 .. 10 ] charactersrequired
primaryInsurance.​cardHolderName.​suffixstring or null[ 1 .. 10 ] charactersrequired
primaryInsurance.​groupNumberstring or nullrequired

Patient insurance group number

primaryInsurance.​binstring or nullrequired

Patient insurance bin

primaryInsurance.​pcnstring or nullrequired

Patient insurance PCN

primaryInsurance.​personCodestring or null^\d{3}$required

Patient insurance person code

secondaryInsuranceobject or null(Insurance)required
secondaryInsurance.​planNamestringrequired

Patient insurance plan name

secondaryInsurance.​cardHolderIDstring[ 1 .. 35 ] charactersrequired

Patient insurance ID number

secondaryInsurance.​cardHolderNameobject(Name)required
secondaryInsurance.​cardHolderName.​lastNamestring[ 1 .. 35 ] charactersrequired
secondaryInsurance.​cardHolderName.​firstNamestring[ 1 .. 35 ] charactersrequired
secondaryInsurance.​cardHolderName.​middleNamestring or null[ 1 .. 35 ] charactersrequired
secondaryInsurance.​cardHolderName.​prefixstring or null[ 1 .. 10 ] charactersrequired
secondaryInsurance.​cardHolderName.​suffixstring or null[ 1 .. 10 ] charactersrequired
secondaryInsurance.​groupNumberstring or nullrequired

Patient insurance group number

secondaryInsurance.​binstring or nullrequired

Patient insurance bin

secondaryInsurance.​pcnstring or nullrequired

Patient insurance PCN

secondaryInsurance.​personCodestring or null^\d{3}$required

Patient insurance person code

{ "metadata": { "requestID": "string", "patientReferenceID": "string", "requestTimestamp": "2019-08-24T14:15:22Z", "retryCount": 0 }, "patient": { "name": {}, "dateOfBirth": "1992-03-20", "gender": "M", "address": {}, "email": "patient@example.com", "contactInfo": {}, "allergyDetails": {} }, "prescriber": { "dea": "string", "npi": "string", "name": {}, "address": {}, "faxNumber": "string", "email": "doctor@example.com", "contactInfo": {} }, "prescription": { "rxNumber": "string", "prescribedNDC": "47335050696", "dispensedNDC": "string", "medicationName": "string", "drugForm": "string", "drugStrength": "0.03 MG", "daysSupply": 30, "dawCode": 9, "sig": "string", "faxImageURL": "string", "quantityWritten": 8.4, "quantityDispensed": 0, "refillsAuthorized": 0, "refillsRemaining": 0, "writtenDate": "2024-09-11T12:00:00.000Z", "firstFilledDate": "2019-08-24T14:15:22Z", "lastFilledDate": "2019-08-24T14:15:22Z", "expirationDate": "2025-09-15T12:00:00.000Z", "canSubstitute": true, "icdCode": "string" }, "sendingPharmacy": { "dea": "string", "npi": "string", "name": "string", "pharmacist": {}, "address": {}, "email": "pharmacy@example.com", "contactInfo": {} }, "receivingPharmacy": { "dea": "string", "npi": "string", "name": "string", "pharmacist": {}, "address": {}, "email": "pharmacy@example.com", "contactInfo": {} }, "primaryInsurance": { "planName": "string", "cardHolderID": "string", "cardHolderName": {}, "groupNumber": "string", "bin": "string", "pcn": "string", "personCode": "string" }, "secondaryInsurance": { "planName": "string", "cardHolderID": "string", "cardHolderName": {}, "groupNumber": "string", "bin": "string", "pcn": "string", "personCode": "string" } }

TransferResponse

requestIDstringrequired

the requestID from the request metadata

metadataobjectrequired

additional information about the request and response data

metadata.​responseTypestring(ResponseType)required

Specifies the response types:

  • RECEIVED - the request has been received, but not yet processed. Requires a follow-up callback to confirm that the request has been completed. For more information, see Callbacks.
  • CONFIRMED - the request is completed and has been fully processed.
  • ERROR - the request to was unsuccessful.
Enum"RECEIVED""CONFIRMED""ERROR"
metadata.​referenceIDstringrequired

unique identifier for the prescription.

metadata.​responseIDstringrequired

unique identifier for an API response.

metadata.​responseTimestampstring(date-time)required

timestamp for the API response.

metadata.​property name*anyadditional property
errorobject(Error)

required if response type is an error

prescriptionobject(Prescription)
{ "requestID": "string", "metadata": { "responseType": "RECEIVED", "referenceID": "string", "responseID": "string", "responseTimestamp": "2019-08-24T14:15:22Z" }, "error": { "type": "INVALID_INFO", "description": "quantityDispensed amount exceeds the refillsRemaining" }, "prescription": { "rxNumber": "string", "prescribedNDC": "47335050696", "dispensedNDC": "string", "medicationName": "string", "drugForm": "string", "drugStrength": "0.03 MG", "daysSupply": 30, "dawCode": 9, "sig": "string", "faxImageURL": "string", "quantityWritten": 8.4, "quantityDispensed": 0, "refillsAuthorized": 0, "refillsRemaining": 0, "writtenDate": "2024-09-11T12:00:00.000Z", "firstFilledDate": "2019-08-24T14:15:22Z", "lastFilledDate": "2019-08-24T14:15:22Z", "expirationDate": "2025-09-15T12:00:00.000Z", "canSubstitute": true, "icdCode": "string" } }