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

Prescription Transfer

Request

PHIL will perform a prescription transfer request to a partner pharmacy to transfer ownership of a prescription. This endpoint specifies the request we will send and the response that we expect to get back.

Bodyapplication/jsonrequired

A JSON object containing transfer request information

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

curl -i -X POST \
  https://docs.partner-api.phil.us/_mock/apis/v1/transfer \
  -H 'Authorization: YOUR_API_KEY_HERE' \
  -H 'Content-Type: application/json' \
  -d '{
    "metadata": {
      "requestID": "6a742tg3aof9f94t35270",
      "requestTimestamp": "2024-09-11T12:12:00Z",
      "patientReferenceID": "9as1tg3aofr5ata5cs84"
    },
    "patient": {
      "name": {
        "firstName": "John",
        "middleName": null,
        "lastName": "Doe",
        "prefix": null,
        "suffix": "Jr."
      },
      "dateOfBirth": "1992-03-20",
      "gender": "M",
      "address": {
        "addressLine1": "410 Terry Ave N",
        "addressLine2": null,
        "city": "Seattle",
        "state": "WA",
        "postalCode": "74729",
        "countryCode": "US"
      },
      "email": "patient@example.com",
      "contactInfo": {
        "countryCode": "+1",
        "phoneNumber": "3231234532"
      },
      "allergyDetails": {
        "allergiesDescriptor": "KNOWN_ALLERGIES_INCLUDED",
        "allergies": [
          "Peanuts",
          "soybeans",
          "crustacean shellfish"
        ]
      }
    },
    "prescriber": {
      "dea": "F91234563",
      "npi": "0987654321",
      "name": {
        "firstName": "Dorothy",
        "middleName": "Andrews",
        "lastName": "Stevens",
        "prefix": "Dr.",
        "suffix": null
      },
      "address": {
        "addressLine1": "5372 W Common St",
        "addressLine2": "Ste 210",
        "city": "Seattle",
        "state": "WA",
        "postalCode": "74729",
        "countryCode": "US"
      },
      "faxNumber": "7732229999",
      "email": "doctor@example.com",
      "contactInfo": null
    },
    "prescription": {
      "rxNumber": "rx1234",
      "prescribedNDC": "82667090002",
      "dispensedNDC": null,
      "medicationName": "TYRVAYA® (VARENICLINE SOLUTION) NASAL SPRAY 0.03 MG",
      "drugForm": "Nasal spray",
      "drugStrength": "0.03 MG",
      "daysSupply": 30,
      "dawCode": 1,
      "icdCode": null,
      "sig": "TAKE 1 TABLET DAILY|TOME 1 TABLETA AL DIA",
      "faxImageURL": null,
      "quantityWritten": 8.4,
      "quantityDispensed": 8.4,
      "refillsAuthorized": 5,
      "refillsRemaining": 3,
      "canSubstitute": false,
      "firstFilledDate": null,
      "lastFilledDate": null,
      "writtenDate": "2024-09-11T12:00:00Z",
      "expirationDate": "2025-09-11T12:00:00Z"
    },
    "sendingPharmacy": {
      "dea": "1M34URHXA",
      "npi": "0987654321",
      "name": "PhilRx, LLC",
      "address": {
        "addressLine1": "1234 Common St",
        "addressLine2": null,
        "city": "Scottsdale",
        "state": "AZ",
        "postalCode": "12345",
        "countryCode": "US"
      },
      "pharmacist": {
        "firstName": "Kyle",
        "middleName": null,
        "lastName": "Abrams",
        "prefix": null,
        "suffix": null
      },
      "email": "phil-user@phil.us",
      "contactInfo": {
        "countryCode": "+1",
        "phoneNumber": "3433548364"
      }
    },
    "receivingPharmacy": {
      "npi": "1234567890",
      "name": "ABC Pharmacy",
      "dea": "CW1184915",
      "address": {
        "addressLine1": "123 Turn st",
        "addressLine2": null,
        "city": "Atlanta",
        "state": "GA",
        "postalCode": "12346",
        "countryCode": "US"
      },
      "pharmacist": {
        "firstName": "Georgina",
        "middleName": null,
        "lastName": "Kade",
        "prefix": null,
        "suffix": null
      },
      "email": "partner-user@partner.com",
      "contactInfo": {
        "countryCode": "+1",
        "phoneNumber": "4347231846"
      }
    },
    "primaryInsurance": {
      "planName": "0600CASHPAY",
      "cardHolderID": "44444444",
      "cardHolderName": {
        "firstName": "John",
        "middleName": null,
        "lastName": "Doe",
        "prefix": null,
        "suffix": "Jr."
      },
      "groupNumber": "GROUP1234332",
      "bin": "600428",
      "pcn": "06000001",
      "personCode": null
    },
    "secondaryInsurance": null
  }'

Responses

Partner has received request or completed transfer.

Bodyapplication/json
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)
Response
application/json

This is an ansynchronous response indicating that the transfer request was received but not fully processed and transferred. A callback to confirm that the transfer request has been fully processed is expected.

{ "requestID": "6a742tg3aof9f94t35270", "metadata": { "referenceID": "a83sad719545352gsv721", "responseType": "RECEIVED", "responseID": "ga1t6291sg6310374gs73", "responseTimestamp": "2024-09-11T12:26:00Z" } }

Request and Response Data

Details on request and response data.