# Prescription Transfer

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.

Endpoint: POST /v1/transfer
Version: 1.0.0
Security: ApiKeyAuth, BearerTokenAuth

## Security:

  - `ApiKeyAuth` (unknown)
    apiKey in header Authorization

  - `BearerTokenAuth` (unknown)
    http bearer

## Request body:

  - `application/json` (unknown)
    A JSON object containing transfer request information

## Request fields (application/json):

  - `metadata` (object, required)
    additional information about the request and response data

  - `metadata.requestID` (string, required)
    unique identifier for an API request

  - `metadata.patientReferenceID` (string, required)
    unique identifier for our patient profile

  - `metadata.requestTimestamp` (string, required)
    timestamp for the API request.

  - `metadata.retryCount` (integer)
    number of times that this request has been retried

  - `patient` (object, required)
    Patient details

  - `patient.name` (object, required)

  - `patient.name.lastName` (string, required)

  - `patient.name.firstName` (string, required)

  - `patient.name.middleName` (string, required)

  - `patient.name.prefix` (string, required)

  - `patient.name.suffix` (string, required)

  - `patient.dateOfBirth` (string, required)
    Example: 1992-03-20

  - `patient.gender` (string, required)
    Code identifying the sex of the individual.:
* M - Male
* F - Female
* U - Not specified or unknown
    Enum: "M", "F", "U"

  - `patient.address` (object, required)

  - `patient.address.addressLine1` (string, required)

  - `patient.address.addressLine2` (string, required)
    Use only when needed and AddressLine1 has been used

  - `patient.address.city` (string, required)

  - `patient.address.state` (string, required)
    2-letter code for the state
    Example: WA

  - `patient.address.postalCode` (string, required)
    5-digit or 9-digit postalCode
    Example: [74729,"74729-0140"]

  - `patient.address.countryCode` (string, required)

  - `patient.email` (string, required)
    Example: patient@example.com

  - `patient.contactInfo` (object, required)

  - `patient.contactInfo.countryCode` (string, required)
    phone number coutry code
    Example: +1

  - `patient.contactInfo.phoneNumber` (string, required)
    10-digit phone number
    Example: 3231234532

  - `patient.allergyDetails` (object, required)

  - `patient.allergyDetails.allergiesDescriptor` (string, required)
    Enum: "KNOWN_ALLERGIES_INCLUDED", "NO_KNOWN_ALLERGIES", "NOT_AVAILABLE"

  - `patient.allergyDetails.allergies` (array, required)
    a list of allergy descriptions

  - `prescriber` (object, required)
    a licensed healthcare professional who authorized the prescription for the patient

  - `prescriber.dea` (string, required)
    DEA registration number

  - `prescriber.npi` (string, required)
    a 10-digit identifier for the pharmacy

  - `prescriber.faxNumber` (string, required)
    prescriber fax number

  - `prescriber.email` (string, required)
    Example: doctor@example.com

  - `prescription` (object, required)

  - `prescription.rxNumber` (string, required)
    a unique number that identifies the prescription

  - `prescription.prescribedNDC` (string, required)
    a uniqie 11-digit code that identifies the prescribed medication
    Example: 47335050696

  - `prescription.dispensedNDC` (string, required)
    a uniqie 11-digit code that identifies the medication to be dispensed. If the same as prescribedNDC, value will be null.

  - `prescription.medicationName` (string, required)
    prescribed medication name

  - `prescription.drugForm` (string, required)
    prescribed medication form (capsules, tablets, ointment, etc.)

  - `prescription.drugStrength` (string, required)
    prescribed medication strength
    Example: 0.03 MG

  - `prescription.daysSupply` (integer, required)
    prescribed days of supply
    Example: 30

  - `prescription.dawCode` (integer, required)
    dispense as written

  - `prescription.sig` (string, required)
    prescription sig to specify how much, how often, and how to take a medication

  - `prescription.faxImageURL` (string, required)
    transfer fax image URL

  - `prescription.quantityWritten` (number, required)
    prescription medication quantity written
    Example: 8.4

  - `prescription.quantityDispensed` (number, required)
    Prescription quantity that we want dispensed for each order (may be different than what's written)

  - `prescription.refillsAuthorized` (integer, required)
    the number of prescription refills originally written, including first fill

  - `prescription.refillsRemaining` (integer, required)
    the number of subsequent refills remaining on the prescription

  - `prescription.writtenDate` (string, required)
    Prescription written date
    Example: 2024-09-11T12:00:00.000Z

  - `prescription.firstFilledDate` (string, required)
    prescription first filled date

  - `prescription.lastFilledDate` (string, required)
    prescription last filled date

  - `prescription.expirationDate` (string, required)
    date the prescription expires
    Example: 2025-09-15T12:00:00.000Z

  - `prescription.canSubstitute` (boolean, required)
    whether or not prescription can be substituted for another

  - `prescription.icdCode` (string, required)
    a standardized code assigned to diagnose medical conditions

  - `sendingPharmacy` (object, required)
    pharamcy details used for sending pharmacy (PHIL) or receiving pharmacy (partner pharmacies)

  - `sendingPharmacy.dea` (string, required)
    DEA registration number

  - `sendingPharmacy.npi` (string, required)
    a 10-digit identifier for the pharmacy

  - `sendingPharmacy.name` (string, required)
    pharamcy name

  - `sendingPharmacy.email` (string, required)
    Example: pharmacy@example.com

  - `primaryInsurance` (object, required)

  - `primaryInsurance.planName` (string, required)
    Patient insurance plan name

  - `primaryInsurance.cardHolderID` (string, required)
    Patient insurance ID number

  - `primaryInsurance.groupNumber` (string, required)
    Patient insurance group number

  - `primaryInsurance.bin` (string, required)
    Patient insurance bin

  - `primaryInsurance.pcn` (string, required)
    Patient insurance PCN

  - `primaryInsurance.personCode` (string, required)
    Patient insurance person code

## Request examples:

  - `Transfer Request` (unknown)

## Response 200:

  - `200` (unknown)
    Partner has received request or completed transfer.

## Response 200 fields (application/json):

  - `requestID` (string, required)
    the requestID from the request metadata

  - `metadata` (object, required)
    additional information about the request and response data

  - `metadata.responseType` (string, 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](/guides/callbacks).
* CONFIRMED - the request is completed and has been fully processed.
* ERROR - the request to was unsuccessful.
    Enum: "RECEIVED", "CONFIRMED", "ERROR"

  - `metadata.referenceID` (string, required)
    unique identifier for the prescription.

  - `metadata.responseID` (string, required)
    unique identifier for an API response.

  - `metadata.responseTimestamp` (string, required)
    timestamp for the API response.

  - `error` (object)
    required if response type is an error

  - `error.type` (string)
    Specifies the error types:
* MISSING_INFO - missing required field
* INVALID_INFO - the data does not match the expected value (e.g. no refills remaining, etc.)
* RX_EXPIRED - the prescription is expired
* SPEC_MISMATCH - the data fields does not match the expected specifications
* DUPLICATE_REQUEST - a request has already been submitted
* OTHER
    Enum: "MISSING_INFO", "INVALID_INFO", "RX_EXPIRED", "SPEC_MISMATCH", "DUPLICATE_REQUEST", "OTHER"

  - `error.description` (string)
    Example: quantityDispensed amount exceeds the refillsRemaining

  - `prescription` (object)

  - `prescription.rxNumber` (string, required)
    a unique number that identifies the prescription

  - `prescription.prescribedNDC` (string, required)
    a uniqie 11-digit code that identifies the prescribed medication
    Example: 47335050696

  - `prescription.dispensedNDC` (string, required)
    a uniqie 11-digit code that identifies the medication to be dispensed. If the same as prescribedNDC, value will be null.

  - `prescription.medicationName` (string, required)
    prescribed medication name

  - `prescription.drugForm` (string, required)
    prescribed medication form (capsules, tablets, ointment, etc.)

  - `prescription.drugStrength` (string, required)
    prescribed medication strength
    Example: 0.03 MG

  - `prescription.daysSupply` (integer, required)
    prescribed days of supply
    Example: 30

  - `prescription.dawCode` (integer, required)
    dispense as written

  - `prescription.sig` (string, required)
    prescription sig to specify how much, how often, and how to take a medication

  - `prescription.faxImageURL` (string, required)
    transfer fax image URL

  - `prescription.quantityWritten` (number, required)
    prescription medication quantity written
    Example: 8.4

  - `prescription.quantityDispensed` (number, required)
    Prescription quantity that we want dispensed for each order (may be different than what's written)

  - `prescription.refillsAuthorized` (integer, required)
    the number of prescription refills originally written, including first fill

  - `prescription.refillsRemaining` (integer, required)
    the number of subsequent refills remaining on the prescription

  - `prescription.writtenDate` (string, required)
    Prescription written date
    Example: 2024-09-11T12:00:00.000Z

  - `prescription.firstFilledDate` (string, required)
    prescription first filled date

  - `prescription.lastFilledDate` (string, required)
    prescription last filled date

  - `prescription.expirationDate` (string, required)
    date the prescription expires
    Example: 2025-09-15T12:00:00.000Z

  - `prescription.canSubstitute` (boolean, required)
    whether or not prescription can be substituted for another

  - `prescription.icdCode` (string, required)
    a standardized code assigned to diagnose medical conditions

## Response 400:

  - `400` (unknown)
    Partner has received request or completed transfer.

## Response 400 fields (application/json):

  - `requestID` (string, required)
    the requestID from the request metadata

  - `metadata` (object, required)
    additional information about the request and response data

  - `metadata.responseType` (string, 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](/guides/callbacks).
* CONFIRMED - the request is completed and has been fully processed.
* ERROR - the request to was unsuccessful.
    Enum: "RECEIVED", "CONFIRMED", "ERROR"

  - `metadata.referenceID` (string, required)
    unique identifier for the prescription.

  - `metadata.responseID` (string, required)
    unique identifier for an API response.

  - `metadata.responseTimestamp` (string, required)
    timestamp for the API response.

  - `error` (object)
    required if response type is an error

  - `error.type` (string)
    Specifies the error types:
* MISSING_INFO - missing required field
* INVALID_INFO - the data does not match the expected value (e.g. no refills remaining, etc.)
* RX_EXPIRED - the prescription is expired
* SPEC_MISMATCH - the data fields does not match the expected specifications
* DUPLICATE_REQUEST - a request has already been submitted
* OTHER
    Enum: "MISSING_INFO", "INVALID_INFO", "RX_EXPIRED", "SPEC_MISMATCH", "DUPLICATE_REQUEST", "OTHER"

  - `error.description` (string)
    Example: quantityDispensed amount exceeds the refillsRemaining

  - `prescription` (object)

  - `prescription.rxNumber` (string, required)
    a unique number that identifies the prescription

  - `prescription.prescribedNDC` (string, required)
    a uniqie 11-digit code that identifies the prescribed medication
    Example: 47335050696

  - `prescription.dispensedNDC` (string, required)
    a uniqie 11-digit code that identifies the medication to be dispensed. If the same as prescribedNDC, value will be null.

  - `prescription.medicationName` (string, required)
    prescribed medication name

  - `prescription.drugForm` (string, required)
    prescribed medication form (capsules, tablets, ointment, etc.)

  - `prescription.drugStrength` (string, required)
    prescribed medication strength
    Example: 0.03 MG

  - `prescription.daysSupply` (integer, required)
    prescribed days of supply
    Example: 30

  - `prescription.dawCode` (integer, required)
    dispense as written

  - `prescription.sig` (string, required)
    prescription sig to specify how much, how often, and how to take a medication

  - `prescription.faxImageURL` (string, required)
    transfer fax image URL

  - `prescription.quantityWritten` (number, required)
    prescription medication quantity written
    Example: 8.4

  - `prescription.quantityDispensed` (number, required)
    Prescription quantity that we want dispensed for each order (may be different than what's written)

  - `prescription.refillsAuthorized` (integer, required)
    the number of prescription refills originally written, including first fill

  - `prescription.refillsRemaining` (integer, required)
    the number of subsequent refills remaining on the prescription

  - `prescription.writtenDate` (string, required)
    Prescription written date
    Example: 2024-09-11T12:00:00.000Z

  - `prescription.firstFilledDate` (string, required)
    prescription first filled date

  - `prescription.lastFilledDate` (string, required)
    prescription last filled date

  - `prescription.expirationDate` (string, required)
    date the prescription expires
    Example: 2025-09-15T12:00:00.000Z

  - `prescription.canSubstitute` (boolean, required)
    whether or not prescription can be substituted for another

  - `prescription.icdCode` (string, required)
    a standardized code assigned to diagnose medical conditions

## Response 200 examples:

  - `Transfer Request Received` (unknown)
    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.

  - `Transfer Request Confirmed` (unknown)
    This is an synchronous response indicating that the request was fully processed and transferred. This can be returned immediately as response for the transfer request or later on via the callback API.

  - `Missing Info Transfer Error` (unknown)
    This is an ansynchronous response indicating that the transfer request was could not be processed.

  - `Invalid Info Transfer Error` (unknown)
    This is an ansynchronous response indicating that the transfer request was could not be processed.

  - `Duplicate Request Transfer Error` (unknown)
    This is an ansynchronous response indicating that the transfer request was could not be processed.

  - `Rx Expired Transfer Error` (unknown)
    This is an ansynchronous response indicating that the transfer request was could not be processed.

  - `Spec Mismatch Transfer Error` (unknown)
    This is an ansynchronous response indicating that the transfer request was could not be processed.

  - `Other Transfer Error` (unknown)
    This is an ansynchronous response indicating that the transfer request was could not be processed.

## Response 400 examples:

  - `Transfer Request Received` (unknown)
    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.

  - `Transfer Request Confirmed` (unknown)
    This is an synchronous response indicating that the request was fully processed and transferred. This can be returned immediately as response for the transfer request or later on via the callback API.

  - `Missing Info Transfer Error` (unknown)
    This is an ansynchronous response indicating that the transfer request was could not be processed.

  - `Invalid Info Transfer Error` (unknown)
    This is an ansynchronous response indicating that the transfer request was could not be processed.

  - `Duplicate Request Transfer Error` (unknown)
    This is an ansynchronous response indicating that the transfer request was could not be processed.

  - `Rx Expired Transfer Error` (unknown)
    This is an ansynchronous response indicating that the transfer request was could not be processed.

  - `Spec Mismatch Transfer Error` (unknown)
    This is an ansynchronous response indicating that the transfer request was could not be processed.

  - `Other Transfer Error` (unknown)
    This is an ansynchronous response indicating that the transfer request was could not be processed.

