Download OpenAPI specification:Download
Welcome to the Foundation Health API, providing access to the Foundation Health Platform.
We set out to make it as easy as possible for you to integrate with our platform and deliver the features it offers to your patients. By focussing on connecting you to the world of healthcare through our open and accessible platform, we empower you to create exceptional patient experiences.
We're excited to collaborate with partners like you who share our vision of transforming the patient experience. Our API platform is at the core of our business, and we can't wait for you to begin using it. We're here to ensure your integration process is seamless. If you have any questions, feel free to reach out to us at contactus@foundationhealth.com
The Foundation Health Platform provides a set of RESTful, JSON-based APIs that can be used to interact with our network of pharmacies and telehealth providers in regions around the world. They are designed to be both flexible and consistent, supporting a wide range of workflows and use cases across multiple countries.
The platform supports common workflows such as submitting a telehealth consultation which we pass through to an appropriate healthcare professional; ordering medications to be delivered to your patients; requesting prescription refills, and more.
A generalised workflow for a telehealth consultation with prescribing and dispensing might look like this:
This workflow can be adapted to support OTC products, prescription transfers, or any number of other scenarios. Talk to us to learn how we can support your use case.
Note that the API is intentionally not versioned, instead we operate an additive philosophy. This ensures all customers have access to the latest features without the need to upgrade versions or deal with breaking changes.
At Foundation Health, our commitment to the security and confidentiality of Protected Health Information (PHI) is unwavering. We prioritize the integrity of your data at all times, and we take the responsibility of protecting it very seriously.
Our approach ensures strict compliance with the regulations in the various countries and regions in which we operate; including those outlined in the General Data Protection Regulations (GDPR). We take pride in providing a secure environment for your healthcare interactions, offering peace of mind to both you and your patients.
We store only the data required to facilitate your requests, and share only the necessary subset of data with your approved telehealth and/or pharmacy partners. Data is encrypted at rest with multiple levels of encryption; and in transit by TLS 1.2+. We rely on industry leading authentication solutions from Okta and Google to restrict access to the API. Customer data is carefully segregated, and isolated by region, to ensure that it is only accessible to you and does not leave the jurisdiction in which your patients reside.
A rate limit of 1024 requests per minute is in place to protect the API from abuse. If this limit is exceeded, API requests will
temporarily receive a 429: Too Many Requests
response.
In order to access the Foundation Health API, you will need a set of credentials which will be provisioned and provided to you during the onboarding process. Please reach out to us at contactus@foundationhealth.com to start the onboarding process and get your API credentials.
You will be provided with credentials for two environments specific to the region in which you operate:
The sandbox environment is functionally a mirror of the production environment, but intended only for use with test data. It can be used for developing your initial integration, end-to-end testing and any other non-production purposes. Note that test data may be removed from the sandbox environment periodically.
Once you have your credentials, you can begin making requests to the API. Start by checking out the Authentication section to see how to obtain an access token. Then see Patients to learn about managing patient records; Consultations for more on submitting health data; Prescribing for how to work with prescriptions; and Fulfillment for everything related to placing orders.
This API Changelog is an overview of changes made to the Foundation Health API. It is intended to help you keep track of changes that may affect your integration.
Date | Changes |
---|---|
2025-02-28 | Added internal_error error code |
2025-02-27 | Added invalid_answers error code |
2025-02-27 | Added options property to the answers array in the Consultation Response schema |
2025-02-24 | Added prescriber.faxNumber as an optional field when creating a Prescription |
2025-02-20 | Made requestedService a required field and removed any_available as an available shipping service when creating an Order |
2025-02-19 | Updated answers in the request schema for Consultation Responses to allow the field to be omitted for certain Consultations |
2025-02-14 | Added identityVerification.verificationScore as a property when creating a Patient |
2025-02-05 | Added order_denied webhook event |
2025-02-04 | Added order_denied error code |
2025-02-03 | Added daysSupply to the response for Prescriptions and to the PrescriptionCreated webhook payload |
2024-11-27 | Added rejectedAt and replacedAt in the response for Orders |
2024-11-25 | Added documentation on Acknowledging Webhook Events |
2024-11-21 | Added documentation on API Rate Limiting |
2024-11-19 | Added new prescription request appointment update events: Prescription Request Appointment Created, Prescription Request Appointment Rescheduled, Prescription Request Appointment Cancelled, Prescription Request Appointment No Show |
2024-11-19 | Added minimum/maximum values to the item quantities in the Prescribing and Fulfillment APIs. |
2024-11-15 | Added prescribedMedication to prescription_created webhook payload |
2024-11-15 | Added measured quantities to the Prescription API |
2024-11-14 | Added approvedAt and rejectedAt on the View Prescription Request response |
2024-11-13 | Added new optional property schedulingLink in the Prescription Request Assigned event payload |
2024-11-06 | Added new endpoint for updating a Patient |
2024-10-24 | Added prescriptionId to OrderItems |
2024-10-22 | Added 'stripe-identity' as an accepted Identity Verification Provider when creating Patients |
2024-10-10 | Updated Shipment data to include estimatedDeliveryDate field |
2024-10-07 | Added the optional pregnant boolean field to Consultation Response. |
2024-10-04 | Added the Prescription Request Denied event and exposed the reasonForDenial property on the View Prescription Request response |
2024-09-26 | Deprecated quantity property on the Prescription Requests endpoints. Please use the new refills property instead. |
2024-09-03 | Exposed downstream ID, the ID generated by our partners, in the Webhooks |
2024-09-03 | Added 'persona' as an accepted Identity Verification Provider when creating Patients |
2024-08-30 | Exposed downstreamId , the id generated by our partners, in the response for Orders and Prescription Requests |
2024-08-20 | Add 'lexis-nexis' as a valid value for the identityVerification.provider field in the Create a Patient endpoint |
2024-08-15 | Added new endpoint for prescription transfer to pharmacy associated with a Prescription |
2024-08-08 | Added optional identityVerification field in the Create a Patient endpoint |
2024-08-02 | Updated answers in the response schema for Consultation Response to only have questionId , questionText , mediaIds and text (if provided). |
2024-08-02 | Updated replacedBy field definition (string string[] ) on the Order responses |
2024-08-01 | PrescriptionRequestId changed to an optional field in PrescriptionCreated event payload |
2024-08-01 | Updated Replace an Order request to be denied if the initial order has already been rejected. |
2024-08-01 | Added optional upstreamId field to the POST Prescription Request and GET Prescription Request |
2024-07-17 | Added productIds to the PrescriptionCreated event payload |
2024-07-17 | Updated payload validation error response on Order endpoints |
2024-07-11 | Allow specific Consultation Response questions to be Optional. |
2024-06-20 | Added the Shipment Undeliverable event |
2024-05-16 | Added upstreamId in Replace an Order |
2024-05-14 | Added Order Cancellation endpoint and associated webhook events |
2024-05-14 | Enforced non-empty instructions for prescription items in Prescription |
2024-03-12 | Allow re-ordering of a subset of items on an Order when creating a replacement order |
2024-03-01 | Allow changing the shipping information on order replacement |
2024-02-21 | Added new endpoint for creating a Prescription for UK customers |
2024-02-21 | Added new endpoint for downloading media associated with a Prescription |
2024-02-19 | Added phone number format validation |
2024-02-19 | Updated Shipment status enum casing |
2024-02-19 | Added rejectionReason to GET Prescription Request response in docs |
2024-02-16 | Updated the schema of the Prescription details |
2024-02-16 | Including city in address details is now required |
2024-02-05 | If country is US then state is required to be a 2 character state code |
2024-01-31 | Corrected property name trackingNumber to trackingId in the docs |
2024-01-30 | Added OrderAssigned event when Orders are successfully assigned |
The Foundation Health API uses the OAuth 2.0 Client Credentials flow for authentication.
Begin by requesting an ID token from the /auth/token
endpoint with your client_id
and client_secret
.
The token can be cached and reused until it expires (typically after 10 minutes, the actual expiry time is included in the exp
claim of the token JWT).
All requests to the Foundation Health API must include an ID token in the Authorization
header.
The token endpoint allows you to exchange your client credentials for a time limited access token.
client_id required | string Your Client ID. Contact Foundation Health to obtain this. |
client_secret required | string Your Client Secret. Contact Foundation Health to obtain this. |
audience required | string The URL of the API the token will be used with. |
grant_type required | string The oauth grant type. Must be |
{- "client_id": "7JcHh02JLSORVjYt8E2t8IhltWOz6NO8",
- "client_secret": "oGu9v02_RF0hdEd7o7ERV3Gsth4LIv-QOgJgyLvdNHwjuXFRJQU_YIov_jviY-Gv",
- "grant_type": "client_credentials"
}
{- "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InR6cXBadExyM2tyLXQtR0xTaWZ6LSJ9.eyJpc3MiOiJodHRwczovL2ZoLXBsYXRmb3JtLmV1LmF1dGgwLmNvbS8iLCJzdWIiOiI3SmNIaDAySkxTT1JWall0OEUydDhJaGx0V096Nk5POEBjbGllbnRzIiwiYXVkIjoiaHR0cHM6Ly9kZXYuZm91bmRhdGlvbmhlYWx0aC5kZXYiLCJpYXQiOjE2ODc4NzYyNzksImV4cCI6MTY4Nzk2MjY3OSwiYXpwIjoiN0pjSGgwMkpMU09SVmpZdDhFMnQ4SWhsdFdPejZOTzgiLCJzY29wZSI6ImNyZWF0ZTpwYXRpZW50IHJlYWQ6cGF0aWVudCIsImd0eSI6ImNsaWVudC1jcmVkZW50aWFscyJ9.eFfpPHxfJ1srIoJCG76kwTR9cjZ9N4m5h8kTs6blzyyziK3kg-sa4KUkBFLjsg7QFNuroZESq-8HwoKuWGHL3ukXqehE3M66SUvxWfG2tEGIO97WR7K8RQJBfKfhHSnJw4YbYYlUBEiSllHt4TrmhYlDa9QJCmgQQIws4P6ywGyFiWovEa5PNxktz11hIbAvy1Rzw87mvFogYLei3clS7B7KJCQGudBa-TwEL84m32FOTTKHb3RS0CHZkPatPd1dQxQs25-kB7Gu0qx4UMDKYoTqnxA1CJCT7LWMRxZ7bEyWyP7tSteZfxY-QXNBVqLCCKNNHHgnFihE0qbrjgVSLQ",
- "token_type": "Bearer",
- "expires_in": 86400,
- "scope": "pat:view:own pat:create:own"
}
Create, view and manage Patients. A Patient is the subject of a Prescription Request or Consultation Response, and the intended recipient of an Order.
Create a new Patient with Foundation Health.
familyName required | string The family name of the Patient. |
givenNames required | Array of strings An array of given names of the Patient. |
required | object (Address) The address the patient has registered with their healthcare provider, where applicable. |
telephone required | string A contact telephone number for the Patient, in E164 format for example: |
email required | string A contact email address for the Patient. |
gender required | string Enum: "female" "male" "other" "unknown" The biological sex of the Patient. |
birthDate required | string The Date of Birth, in YYYY-MM-DD format, of the Patient. The Patient must be 16 years or older. |
languages | Array of strings A list of languages, in ISO 639-1 format, the patient is fluent in. |
preferredLanguage required | string The language, in ISO 639-1 format, the patient prefers to receive communications in. |
upstreamId required | string Your ID for the Patient. |
object The identity verification details for the Patient. |
{- "familyName": "Mozart",
- "givenNames": [
- "Wolfgang"
], - "address": {
- "lines": [
- "Gunzing 70"
], - "city": "Aich",
- "postalCode": "12345",
- "district": "Wolfsberg",
- "state": "Carinthia",
- "country": "at"
}, - "telephone": "+15853161972",
- "email": "mozart@gmail.com",
- "gender": "male",
- "birthDate": "2000-12-31",
- "languages": [
- "de"
], - "preferredLanguage": "de",
- "upstreamId": "123456789",
- "identityVerification": {
- "verificationToken": "123456789",
- "verificationScore": "0.9",
- "provider": "vouched"
}
}
{- "id": "pat_zydk6vb0u2up4imsj6ed6mk0",
- "type": "patient",
- "familyName": "Mozart",
- "givenNames": [
- "Wolfgang"
], - "address": {
- "lines": [
- "Gunzing 70"
], - "city": "Aich",
- "postalCode": "12345",
- "district": "Wolfsberg",
- "state": "Carinthia",
- "country": "at"
}, - "telephone": "+15853161972",
- "email": "mozart@gmail.com",
- "gender": "male",
- "birthDate": "2000-12-31",
- "languages": [
- "de"
], - "preferredLanguage": "de",
- "upstreamId": "123456789",
- "createdAt": "2023-11-15T11:15:47.082Z"
}
Create a new Patient or update an existing Patient with Foundation Health. If the payload doesn't contain changes for the existing one or multiple patients are matched, no operation is committed.
familyName required | string The family name of the Patient. |
givenNames required | Array of strings An array of given names of the Patient. |
required | object (Address) The address the patient has registered with their healthcare provider, where applicable. |
telephone required | string A contact telephone number for the Patient, in E164 format for example: |
email required | string A contact email address for the Patient. |
gender required | string Enum: "female" "male" "other" "unknown" The biological sex of the Patient. |
birthDate required | string The Date of Birth, in YYYY-MM-DD format, of the Patient. The Patient must be 16 years or older. |
languages | Array of strings A list of languages, in ISO 639-1 format, the patient is fluent in. |
preferredLanguage required | string The language, in ISO 639-1 format, the patient prefers to receive communications in. |
upstreamId required | string Your ID for the Patient. |
object The identity verification details for the Patient. |
{- "familyName": "Mozart",
- "givenNames": [
- "Wolfgang"
], - "address": {
- "lines": [
- "Gunzing 70"
], - "city": "Aich",
- "postalCode": "12345",
- "district": "Wolfsberg",
- "state": "Carinthia",
- "country": "at"
}, - "telephone": "+15853161972",
- "email": "mozart@gmail.com",
- "gender": "male",
- "birthDate": "2000-12-31",
- "languages": [
- "de"
], - "preferredLanguage": "de",
- "upstreamId": "123456789",
- "identityVerification": {
- "verificationToken": "123456789",
- "verificationScore": "0.9",
- "provider": "vouched"
}
}
{- "id": "pat_zydk6vb0u2up4imsj6ed6mk0",
- "type": "patient",
- "familyName": "Mozart",
- "givenNames": [
- "Wolfgang"
], - "address": {
- "lines": [
- "Gunzing 70"
], - "city": "Aich",
- "postalCode": "12345",
- "district": "Wolfsberg",
- "state": "Carinthia",
- "country": "at"
}, - "telephone": "+15853161972",
- "email": "mozart@gmail.com",
- "gender": "male",
- "birthDate": "2000-12-31",
- "languages": [
- "de"
], - "preferredLanguage": "de",
- "upstreamId": "123456789",
- "createdAt": "2023-11-15T11:15:47.082Z"
}
View a previously created Patient and their details.
patientId required | string Example: pat_zydk6vb0u2up4imsj6ed6mk0 The ID of the Patient to be retrieved. |
{- "id": "pat_zydk6vb0u2up4imsj6ed6mk0",
- "type": "patient",
- "familyName": "Mozart",
- "givenNames": [
- "Wolfgang"
], - "address": {
- "lines": [
- "Gunzing 70"
], - "city": "Aich",
- "postalCode": "12345",
- "district": "Wolfsberg",
- "state": "Carinthia",
- "country": "at"
}, - "telephone": "+15853161972",
- "email": "mozart@gmail.com",
- "gender": "male",
- "birthDate": "2000-12-31",
- "languages": [
- "de"
], - "preferredLanguage": "de",
- "upstreamId": "123456789",
- "createdAt": "2023-11-15T11:15:47.082Z"
}
Update the details of an existing Patient.
patientId required | string Example: pat_zydk6vb0u2up4imsj6ed6mk0 The ID of the Patient to be retrieved. |
familyName | string The family name of the Patient. |
givenNames | Array of strings An array of given names of the Patient. |
object (Address) The address the patient has registered with their healthcare provider, where applicable. | |
telephone | string A contact telephone number for the Patient, in E164 format for example: |
string A contact email address for the Patient. | |
languages | Array of strings A list of languages, in ISO 639-1 format, the patient is fluent in. |
preferredLanguage | string The language, in ISO 639-1 format, the patient prefers to receive communications in. |
object The identity verification details for the Patient. |
{- "familyName": "Mozart",
- "givenNames": [
- "Wolfgang"
], - "address": {
- "lines": [
- "Gunzing 70"
], - "city": "Aich",
- "postalCode": "12345",
- "district": "Wolfsberg",
- "state": "Carinthia",
- "country": "at"
}, - "telephone": "+15853161972",
- "email": "patient@gmail.com",
- "languages": [
- "de"
], - "preferredLanguage": "de",
- "identityVerification": {
- "verificationToken": "123456789",
- "verificationScore": "0.9",
- "provider": "vouched"
}
}
{- "id": "pat_zydk6vb0u2up4imsj6ed6mk0",
- "type": "patient",
- "familyName": "Mozart",
- "givenNames": [
- "Wolfgang"
], - "address": {
- "lines": [
- "Gunzing 70"
], - "city": "Aich",
- "postalCode": "12345",
- "district": "Wolfsberg",
- "state": "Carinthia",
- "country": "at"
}, - "telephone": "+15853161972",
- "email": "mozart@gmail.com",
- "gender": "male",
- "birthDate": "2000-12-31",
- "languages": [
- "de"
], - "preferredLanguage": "de",
- "upstreamId": "123456789",
- "createdAt": "2023-11-15T11:15:47.082Z"
}
Create new Consultation Responses.
A Consultation comprises of Questions to be posed to the Patient, and covers certain products. You must use a Consultation which is appropriate for the product you are issuing to the Patient.
For example, Consultation cons_picbnjwp72xk8ulfmvni0cc1
might cover the product SKU ab-cd-01
(a medication for erectile dysfunction), whereas Consultation cons_awcab2f6rfdldf49hhpxulkf
might cover the product SKU xy-09-76
(a medication for hair loss).
Contact Foundation Health to discuss which Consultation to use for your product.
Submit the data collected from a patient during a (asynchronous) consultation. Returns a Consultation Response which can be used to request a prescription and/or place an order for the medication(s) covered by the Consultation.
consultationId required | string The ID of the Consultation you are submitting answers to. |
language required | string <= 2 characters The language of the consultation response in ISO 639-1 format. |
patientId required | string The ID of the Patient who is the subject of this Consultation Response. |
Array of Text (object) or Options (object) or Media (object) or Text + Media (object) or Options + Media (object) A list of the patient's answers to the Consultation questions. This field is required when the Consultation has mandatory questions. | |
allergies | Array of strings A list of the patient's allergies. Required for patients located in the US; submit an empty array |
conditions | Array of strings A list of the patient's existing medical conditions. Required for patients located in the US; submit an empty array |
medications | Array of strings A list of other medications the patient is taking. Required for patients located in the US; submit an empty array |
pregnant | boolean Value indicating whether the patient is pregnant. |
{- "consultationId": "cons_picbnjwp72xk8ulfmvni0cc1",
- "language": "en",
- "patientId": "pat_a7r071k7f6k7mhpobju27ftt",
- "answers": [
- {
- "text": "175 cm"
}
], - "allergies": [
- "Peanuts"
], - "conditions": [
- "Asthma"
], - "medications": [
- "Vicodin"
], - "pregnant": false
}
{- "id": "cres_zpoa4vbf00lzdyx3mn4m1rrb",
- "type": "consultation-response",
- "consultationId": "cons_picbnjwp72xk8ulfmvni0cc1",
- "language": "en",
- "patientId": "pat_ocz4k3ecq3898i8675hixjej",
- "allergies": [
- "Peanuts"
], - "conditions": [
- "Asthma"
], - "medications": [
- "Vicodin"
], - "answers": [
- {
- "questionId": "ques_smudja5z88nx6h0ala384phr",
- "questionText": "What is your height?",
- "options": [
- "Yes"
], - "text": "175 cm",
- "mediaIds": [
- "media_irt8abh7tour86llzlrqkqiy"
]
}
], - "createdAt": "2023-11-15T11:15:47.082Z"
}
View a Consultation Response by its ID.
consultationResponseId required | string Example: cres_zpoa4vbf00lzdyx3mn4m1rrb The ID of the Consultation Response to retrieve. |
{- "id": "cres_zpoa4vbf00lzdyx3mn4m1rrb",
- "type": "consultation-response",
- "consultationId": "cons_picbnjwp72xk8ulfmvni0cc1",
- "language": "en",
- "patientId": "pat_ocz4k3ecq3898i8675hixjej",
- "allergies": [
- "Peanuts"
], - "conditions": [
- "Asthma"
], - "medications": [
- "Vicodin"
], - "answers": [
- {
- "questionId": "ques_smudja5z88nx6h0ala384phr",
- "questionText": "What is your height?",
- "options": [
- "Yes"
], - "text": "175 cm",
- "mediaIds": [
- "media_irt8abh7tour86llzlrqkqiy"
]
}
], - "createdAt": "2023-11-15T11:15:47.082Z"
}
An electronic prescription (eRx) represents digitally the generation, transmission, and filing of a prescription. In the US, the accepted standard for eRx is the “SCRIPT standard,” governed by the National Council for Prescription Drug Programs (NCPDP). Other regions have similar standards, such as the Electronic Prescription Service (EPS) in the UK; or may rely on the transmission of cryptographically signed PDF documents.
Electronic prescriptions can be written by our telehealth partners via a Prescription Request, transferred from another pharmacy, or sent by any licensed provider to our pharmacy partners via the Surescripts network. Talk with us to discuss the best approach for your use case.
If a new Prescription is required for the item(s) in an Order, then you must first submit a Prescription Request. An approved Prescription Request results in a Prescription. You will be notified of approval or rejection via webhook events, rejections may include a reason for the rejection if provided by the prescriber.
patientId required | string The ID of the Patient to create the Prescription Request for. |
consultationResponseId required | string The ID of an existing consultation response to reference when dispensing. Required for orders containing non-prescription items that need a consultation. |
required | Array of objects or objects A list of items to be prescribed. Note: Items prescribed by our partner can be different than those submitted here, based on the prescriber's review. When placing an order, you should always check the items on the Prescription to ensure they match. |
upstreamId | string The ID of the Prescription Request in your system. |
{- "patientId": "pat_zydk6vb0u2up4imsj6ed6mk0",
- "consultationResponseId": "cres_zpoa4vbf00lzdyx3mn4m1rrb",
- "items": [
- {
- "proposedInstructions": "Take one tablet twice a day",
- "sku": "MED123",
- "refills": {
- "quantityPerFill": 2,
- "numberOfFills": 12
}
}
], - "upstreamId": "123456789"
}
{- "id": "rxreq_zsgyio7qdfiliqqh0mqoe64l",
- "type": "prescription-request",
- "patientId": "pat_zydk6vb0u2up4imsj6ed6mk0",
- "approvedAt": "2023-11-15T11:15:47.082Z",
- "reasonForRejection": "The patient is not eligible for this item",
- "rejectedAt": "2023-11-15T11:15:47.082Z",
- "reasonForDenial": "Patient not eligible for new visit",
- "items": [
- {
- "proposedInstructions": "Take 1 tablet daily",
- "sku": "paracetamol-123",
- "medicationId": "med_zydk6vb0u2up4imsj6ed6mk0",
- "quantity": 24,
- "measuredQuantity": "24.000",
- "quantityUnitOfMeasure": "mg",
- "refills": {
- "quantityPerFill": 2,
- "measuredQuantityPerFill": "2.000",
- "numberOfFills": 12
}
}
], - "upstreamId": "123456789",
- "createdAt": "2023-11-15T11:15:47.082Z"
}
prescriptionRequestId required | string Example: rxreq_zydk6vb0u2up4imsj6ed6mk0 The ID of an existing prescription request. |
{- "id": "rxreq_zsgyio7qdfiliqqh0mqoe64l",
- "type": "prescription-request",
- "patientId": "pat_zydk6vb0u2up4imsj6ed6mk0",
- "approvedAt": "2023-11-15T11:15:47.082Z",
- "reasonForRejection": "The patient is not eligible for this item",
- "rejectedAt": "2023-11-15T11:15:47.082Z",
- "reasonForDenial": "Patient not eligible for new visit",
- "items": [
- {
- "proposedInstructions": "Take 1 tablet daily",
- "sku": "paracetamol-123",
- "medicationId": "med_zydk6vb0u2up4imsj6ed6mk0",
- "quantity": 24,
- "measuredQuantity": "24.000",
- "quantityUnitOfMeasure": "mg",
- "refills": {
- "quantityPerFill": 2,
- "measuredQuantityPerFill": "2.000",
- "numberOfFills": 12
}
}
], - "upstreamId": "123456789",
- "createdAt": "2023-11-15T11:15:47.082Z"
}
For use cases where you have your own prescriptions, you can submit them using this endpoint in place of creating a Prescription Request.
patientId required | string The ID of the Patient to create the Prescription for. |
mediaId required | |
upstreamId required | string Your ID of the Prescription in your system. |
required | Array of objects or objects A list of items to be prescribed. |
validFrom required | string The date at which this Prescription becomes valid, in YYYY-MM-DD format. |
validTo required | string The date at which this Prescription expires, in YYYY-MM-DD format. |
required | object (Prescriber) The registration details of the prescriber who wrote the prescription. |
note | string A note to be associated with the Prescription. |
consultationResponseId | string The ID of an existing Consultation Response that lead to the creation of this prescription. |
{- "patientId": "pat_zydk6vb0u2up4imsj6ed6mk0",
- "mediaId": "media_irt8abh7tour86llzlrqkqiy",
- "upstreamId": "123456789",
- "items": [
- {
- "instructions": "Take one tablet twice a day",
- "sku": "MED123",
- "lastFillDate": "2025-03-20",
- "refills": {
- "quantityPerFill": 2,
- "numberOfFills": 12
}
}
], - "validFrom": "2023-11-15",
- "validTo": "2023-12-15",
- "prescriber": {
- "name": "John Doe",
- "registrationNumber": "123456789",
- "registrationBody": "GMC",
- "type": "doctor",
- "phone": "+43 664 122 11 53",
- "faxNumber": "+43 664 122 11 53",
- "email": null,
- "address": {
- "lines": [
- "Gunzing 70"
], - "city": "Aich",
- "postalCode": "12345",
- "district": "Wolfsberg",
- "state": "Carinthia",
- "country": "at"
}
}, - "note": "This is a note",
- "consultationResponseId": "cres_zpoa4vbf00lzdyx3mn4m1rrb"
}
{- "id": "rx_j6lxsov0fz58pii38cy3nfzg",
- "type": "prescription",
- "patientId": "pat_zydk6vb0u2up4imsj6ed6mk0",
- "upstreamId": "123456789",
- "validFrom": "2023-11-15",
- "validTo": "2023-12-15",
- "prescriber": {
- "name": "John Doe",
- "registrationNumber": "123456789",
- "registrationBody": "GMC",
- "type": "doctor",
- "phone": "+43 664 122 11 53",
- "faxNumber": "+43 664 122 11 53",
- "email": null,
- "address": {
- "lines": [
- "Gunzing 70"
], - "city": "Aich",
- "postalCode": "12345",
- "district": "Wolfsberg",
- "state": "Carinthia",
- "country": "at"
}
}, - "requestId": "rxreq_zsgyio7qdfiliqqh0mqoe64l",
- "items": [
- {
- "instructions": "Take 1 tablet daily",
- "sku": "paracetamol-123",
- "daysSupply": 7,
- "medicationId": "med_zydk6vb0u2up4imsj6ed6mk0",
- "quantityRemaining": 24,
- "measuredQuantityRemaining": "24.000",
- "quantity": 24,
- "measuredQuantity": "24.000",
- "quantityUnitOfMeasure": "mg",
- "refills": {
- "quantityPerFill": 2,
- "measuredQuantityPerFill": "2.000",
- "numberOfFills": 12
}, - "lastFillDate": "2025-03-20"
}
], - "createdAt": "2023-11-15T11:15:47.082Z"
}
prescriptionId required | string Example: rx_kgno9ywacqudxlhij0mxidli The ID of an existing prescription. |
{- "id": "rx_j6lxsov0fz58pii38cy3nfzg",
- "type": "prescription",
- "patientId": "pat_zydk6vb0u2up4imsj6ed6mk0",
- "upstreamId": "123456789",
- "validFrom": "2023-11-15",
- "validTo": "2023-12-15",
- "prescriber": {
- "name": "John Doe",
- "registrationNumber": "123456789",
- "registrationBody": "GMC",
- "type": "doctor",
- "phone": "+43 664 122 11 53",
- "faxNumber": "+43 664 122 11 53",
- "email": null,
- "address": {
- "lines": [
- "Gunzing 70"
], - "city": "Aich",
- "postalCode": "12345",
- "district": "Wolfsberg",
- "state": "Carinthia",
- "country": "at"
}
}, - "requestId": "rxreq_zsgyio7qdfiliqqh0mqoe64l",
- "items": [
- {
- "instructions": "Take 1 tablet daily",
- "sku": "paracetamol-123",
- "daysSupply": 7,
- "medicationId": "med_zydk6vb0u2up4imsj6ed6mk0",
- "quantityRemaining": 24,
- "measuredQuantityRemaining": "24.000",
- "quantity": 24,
- "measuredQuantity": "24.000",
- "quantityUnitOfMeasure": "mg",
- "refills": {
- "quantityPerFill": 2,
- "measuredQuantityPerFill": "2.000",
- "numberOfFills": 12
}, - "lastFillDate": "2025-03-20"
}
], - "createdAt": "2023-11-15T11:15:47.082Z"
}
prescriptionId required | string Example: rx_kgno9ywacqudxlhij0mxidli The ID of an existing prescription. |
destination required | string The ID of the Pharmacy to transfer the prescription to. |
{- "destination": "tfp_zydk6vb0u2up4imsj6ed6mk0"
}
Place, view and manage Orders and their shipments. An Order is a request to ship one or more items to a Patient. An Order can be created with or without a Prescription, however if a Prescription is required for the item(s) in the Order, then you must first have submitted a Prescription Request and received a Prescription. An Order can be created with or without a Consultation Response, however if a Consultation Response is required for the item(s) in the Order, then you must first have submitted a Consultation Response for the appropriate Consultation. You will be notified as the Order is processed via a webhook.
Submit the items being ordered, the recipient's shipping information, and the IDs of any linked resources (Prescriptions or Consultaiton Responses). Returns an Order.
patientId required | string The ID of the Patient to create the Order for. |
consultationResponseId | string The ID of an existing Consultation Response to reference when dispensing. Required for orders containing non-prescription items that need a consultation. |
prescriptionId | string The ID of a Prescription belonging to the patient. Required for orders containing items that are prescribed items. The submitted Prescription needs to include all the items being ordered. This field is mutually exclusive with the |
required | Array of objects (OrderItemRequest) The product SKUs and quantities being ordered. Note: Items prescribed by our partner can be different than those on the Prescription Request, based on the prescriber's review. When placing an order, you should always check the items on the Prescription to ensure they match. |
required | object (ShippingInformationRequest) |
upstreamId required | string Your ID for the Order. |
{- "patientId": "pat_zydk6vb0u2up4imsj6ed6mk0",
- "consultationResponseId": "string",
- "prescriptionId": "rx_jgi0s0yp8yfjz48s8oro2wun",
- "items": [
- {
- "sku": "MED123",
- "quantity": 1,
- "prescriptionId": "rx_jgi0s0yp8yfjz48s8oro2wun"
}
], - "shippingInformation": {
- "address": {
- "lines": [
- "Gunzing 70"
], - "city": "Aich",
- "postalCode": "12345",
- "district": "Wolfsberg",
- "state": "Carinthia",
- "country": "at"
}, - "contactInformation": {
- "fullName": "Wolfgang Amadeus Mozart",
- "email": "mozart@gmail.com",
- "telephone": "+15853161972"
}, - "deliveryInstructions": "Please knock, do not post through the letterbox",
- "requestedService": "usps_priority"
}, - "upstreamId": "123456789"
}
{- "id": "ord_nvkgcxjp4aza6m4ajycn5jno",
- "type": "order",
- "createdAt": "2023-11-15T11:15:47.082Z",
- "patientId": "pat_a7r071k7f6k7mhpobju27ftt",
- "consultationResponseId": "cres_zpoa4vbf00lzdyx3mn4m1rrb",
- "prescriptionId": "rx_jgi0s0yp8yfjz48s8oro2wun",
- "replacedBy": [
- "ord_nvkgcxjp4aza6m4ajycn5jno"
], - "replacedAt": "2023-11-15T11:15:47.082Z",
- "replaces": "ord_nvkgcxjp4aza6m4ajycn5jno",
- "replacementReason": "The original Order was not delivered due to being lost in transit.",
- "items": [
- {
- "sku": "MED123",
- "quantity": 1,
- "prescriptionId": "rx_jgi0s0yp8yfjz48s8oro2wun"
}
], - "shippingInformation": {
- "address": {
- "lines": [
- "Gunzing 70"
], - "city": "Aich",
- "postalCode": "12345",
- "district": "Wolfsberg",
- "state": "Carinthia",
- "country": "at"
}, - "contactInformation": {
- "fullName": "Wolfgang Amadeus Mozart",
- "email": "mozart@gmail.com",
- "telephone": "+15853161972"
}, - "deliveryInstructions": "Please knock, do not post through the letterbox",
- "requestedService": "usps_priority"
}, - "upstreamId": "123456",
- "shipments": [
- {
- "id": "ship_o07m24bijbp05a9wzhee269x",
- "status": "created",
- "shippingService": "usps_priority",
- "estimatedDeliveryDate": "2023-11-15T11:15:47.082Z",
- "createdAt": "2023-11-15T11:15:47.082Z"
}
], - "reasonForRejection": "The patient is not eligible for this item",
- "rejectedAt": "2023-11-15T11:15:47.082Z",
- "reasonForCancellationFailure": "The order cannot be canceled as it has already been shipped.",
- "cancellationRequestReason": "Customer entered the wrong address.",
- "canceledAt": "2023-11-15T11:15:47.082Z",
- "cancellationRejectedAt": "2023-11-15T11:15:47.082Z",
- "cancellationRequestedAt": "2023-11-15T11:15:47.082Z"
}
View a previously created order.
orderId required | string Example: ord_nvkgcxjp4aza6m4ajycn5jno |
{- "id": "ord_nvkgcxjp4aza6m4ajycn5jno",
- "type": "order",
- "createdAt": "2023-11-15T11:15:47.082Z",
- "patientId": "pat_a7r071k7f6k7mhpobju27ftt",
- "consultationResponseId": "cres_zpoa4vbf00lzdyx3mn4m1rrb",
- "prescriptionId": "rx_jgi0s0yp8yfjz48s8oro2wun",
- "replacedBy": [
- "ord_nvkgcxjp4aza6m4ajycn5jno"
], - "replacedAt": "2023-11-15T11:15:47.082Z",
- "replaces": "ord_nvkgcxjp4aza6m4ajycn5jno",
- "replacementReason": "The original Order was not delivered due to being lost in transit.",
- "items": [
- {
- "sku": "MED123",
- "quantity": 1,
- "prescriptionId": "rx_jgi0s0yp8yfjz48s8oro2wun"
}
], - "shippingInformation": {
- "address": {
- "lines": [
- "Gunzing 70"
], - "city": "Aich",
- "postalCode": "12345",
- "district": "Wolfsberg",
- "state": "Carinthia",
- "country": "at"
}, - "contactInformation": {
- "fullName": "Wolfgang Amadeus Mozart",
- "email": "mozart@gmail.com",
- "telephone": "+15853161972"
}, - "deliveryInstructions": "Please knock, do not post through the letterbox",
- "requestedService": "usps_priority"
}, - "upstreamId": "123456",
- "shipments": [
- {
- "id": "ship_o07m24bijbp05a9wzhee269x",
- "status": "created",
- "shippingService": "usps_priority",
- "estimatedDeliveryDate": "2023-11-15T11:15:47.082Z",
- "createdAt": "2023-11-15T11:15:47.082Z"
}
], - "reasonForRejection": "The patient is not eligible for this item",
- "rejectedAt": "2023-11-15T11:15:47.082Z",
- "reasonForCancellationFailure": "The order cannot be canceled as it has already been shipped.",
- "cancellationRequestReason": "Customer entered the wrong address.",
- "canceledAt": "2023-11-15T11:15:47.082Z",
- "cancellationRejectedAt": "2023-11-15T11:15:47.082Z",
- "cancellationRequestedAt": "2023-11-15T11:15:47.082Z"
}
Replace an existing Order that has not been satisfactorily received by the customer.
orderId required | string Example: ord_nvkgcxjp4aza6m4ajycn5jno The ID of the Order which is to be replaced. |
replacementReason required | string The reason why a replacement is being requested. |
object (ShippingInformationRequest) | |
Array of objects (Order Item) To replace part of an order specify the items to be replaced. The specified items must be part of, and the quantity not exceed that of, the original order. | |
upstreamId | string Your ID for the Order. |
{- "replacementReason": "The original Order was not delivered due to being lost in transit.",
- "shippingInformation": {
- "address": {
- "lines": [
- "Gunzing 70"
], - "city": "Aich",
- "postalCode": "12345",
- "district": "Wolfsberg",
- "state": "Carinthia",
- "country": "at"
}, - "contactInformation": {
- "fullName": "Wolfgang Amadeus Mozart",
- "email": "mozart@gmail.com",
- "telephone": "+15853161972"
}, - "deliveryInstructions": "Please knock, do not post through the letterbox",
- "requestedService": "usps_priority"
}, - "items": [
- {
- "sku": "MED123",
- "quantity": 1
}
], - "upstreamId": "123456789"
}
{- "id": "ord_nvkgcxjp4aza6m4ajycn5jno",
- "type": "order",
- "createdAt": "2023-11-15T11:15:47.082Z",
- "patientId": "pat_a7r071k7f6k7mhpobju27ftt",
- "consultationResponseId": "cres_zpoa4vbf00lzdyx3mn4m1rrb",
- "prescriptionId": "rx_jgi0s0yp8yfjz48s8oro2wun",
- "replacedBy": [
- "ord_nvkgcxjp4aza6m4ajycn5jno"
], - "replacedAt": "2023-11-15T11:15:47.082Z",
- "replaces": "ord_nvkgcxjp4aza6m4ajycn5jno",
- "replacementReason": "The original Order was not delivered due to being lost in transit.",
- "items": [
- {
- "sku": "MED123",
- "quantity": 1,
- "prescriptionId": "rx_jgi0s0yp8yfjz48s8oro2wun"
}
], - "shippingInformation": {
- "address": {
- "lines": [
- "Gunzing 70"
], - "city": "Aich",
- "postalCode": "12345",
- "district": "Wolfsberg",
- "state": "Carinthia",
- "country": "at"
}, - "contactInformation": {
- "fullName": "Wolfgang Amadeus Mozart",
- "email": "mozart@gmail.com",
- "telephone": "+15853161972"
}, - "deliveryInstructions": "Please knock, do not post through the letterbox",
- "requestedService": "usps_priority"
}, - "upstreamId": "123456",
- "shipments": [
- {
- "id": "ship_o07m24bijbp05a9wzhee269x",
- "status": "created",
- "shippingService": "usps_priority",
- "estimatedDeliveryDate": "2023-11-15T11:15:47.082Z",
- "createdAt": "2023-11-15T11:15:47.082Z"
}
], - "reasonForRejection": "The patient is not eligible for this item",
- "rejectedAt": "2023-11-15T11:15:47.082Z",
- "reasonForCancellationFailure": "The order cannot be canceled as it has already been shipped.",
- "cancellationRequestReason": "Customer entered the wrong address.",
- "canceledAt": "2023-11-15T11:15:47.082Z",
- "cancellationRejectedAt": "2023-11-15T11:15:47.082Z",
- "cancellationRequestedAt": "2023-11-15T11:15:47.082Z"
}
This endpoint is used to send a cancellation request for an existing order to our partners. Upon receiving the request, our partners will attempt to cancel the order and respond with the result of the cancellation attempt. A 202 response indicates that the cancellation request has been received and is pending approval. An Order should only be considered cancelled upon receiving an Order Cancellation Approved event. There may be circumstances where the cancellation request fails straight away, such as if the order has already been shipped or if a fulfillment partner does not accept cancellations. In such cases, the reason for the failure will be provided in the response.
orderId required | string Example: ord_nvkgcxjp4aza6m4ajycn5jno The ID of the Order which is to be canceled. |
cancellationReason required | string The reason why a cancellation is being requested. |
{- "cancellationReason": "The order is incorrect."
}
{- "id": "ord_nvkgcxjp4aza6m4ajycn5jno",
- "type": "order",
- "createdAt": "2023-11-15T11:15:47.082Z",
- "patientId": "pat_a7r071k7f6k7mhpobju27ftt",
- "consultationResponseId": "cres_zpoa4vbf00lzdyx3mn4m1rrb",
- "prescriptionId": "rx_jgi0s0yp8yfjz48s8oro2wun",
- "replacedBy": [
- "ord_nvkgcxjp4aza6m4ajycn5jno"
], - "replacedAt": "2023-11-15T11:15:47.082Z",
- "replaces": "ord_nvkgcxjp4aza6m4ajycn5jno",
- "replacementReason": "The original Order was not delivered due to being lost in transit.",
- "items": [
- {
- "sku": "MED123",
- "quantity": 1,
- "prescriptionId": "rx_jgi0s0yp8yfjz48s8oro2wun"
}
], - "shippingInformation": {
- "address": {
- "lines": [
- "Gunzing 70"
], - "city": "Aich",
- "postalCode": "12345",
- "district": "Wolfsberg",
- "state": "Carinthia",
- "country": "at"
}, - "contactInformation": {
- "fullName": "Wolfgang Amadeus Mozart",
- "email": "mozart@gmail.com",
- "telephone": "+15853161972"
}, - "deliveryInstructions": "Please knock, do not post through the letterbox",
- "requestedService": "usps_priority"
}, - "upstreamId": "123456",
- "shipments": [
- {
- "id": "ship_o07m24bijbp05a9wzhee269x",
- "status": "created",
- "shippingService": "usps_priority",
- "estimatedDeliveryDate": "2023-11-15T11:15:47.082Z",
- "createdAt": "2023-11-15T11:15:47.082Z"
}
], - "reasonForRejection": "The patient is not eligible for this item",
- "rejectedAt": "2023-11-15T11:15:47.082Z",
- "reasonForCancellationFailure": "The order cannot be canceled as it has already been shipped.",
- "cancellationRequestReason": "Customer entered the wrong address.",
- "canceledAt": "2023-11-15T11:15:47.082Z",
- "cancellationRejectedAt": "2023-11-15T11:15:47.082Z",
- "cancellationRequestedAt": "2023-11-15T11:15:47.082Z"
}
Foundation Health will notify you of important events via a registered webhook. Webhook URLs must be manually registered for your account as part of the onboarding process. The platform supports registering multiple webhook URLs per environment.
Note: An API is being developed for you to register and manage your own webhook URLs in future.
Events are sent as Signed JSON Web Tokens (JWS) via a HTTPS POST request.
They will be sent with the Content-Type: application/jose
header.
An example payload will look like this:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoicHJlc2NyaXB0aW9uX3JlcXVlc3RfYXNzaWduZWQiLCJkYXRhIjp7InByZXNjcmlwdGlvblJlcXVlc3RJZCI6InJ4cmVxX2xxZGllOTdibjZpcjJkZ3U0bmxtamVpNyJ9LCJpYXQiOjE3MDA1NjMxNDd9.jar6b0YkRYtacR-FYplonVzzk0GnAu79DDnnR2vNA4w
You must verify the JWT signature using the secret you will have been issued when the webhook is registered to your account. This guarantees the webhook was received from Foundation Health and has not been tampered with.
Once the signature is verified you can safely decode & parse the payload as a JSON object. Example decoded payloads are documented below.
After a webhook event has been received, it must be acknowledged by responding with a successful (2XX
) status code.
Events which are not acknowledged with a successful status code will be resent up to 10 times, in an attempt to ensure that the event is received successfully.
The following event types are currently provided:
Event | Description |
---|---|
Prescription Request Assigned | This event is sent when a Prescription Request is assigned to a Prescriber. |
Prescription Request Rejected | This event is sent when a Prescription Request is rejected by a Prescriber. |
Prescription Request Denied | This event is sent when a Prescription Request is denied. The reason for denial will be included in the event reason property |
Prescription Created | This event is sent when a Prescription Request is approved by a Prescriber and a Prescription is created. |
Order Assigned | This event is sent when your Order has been received and accepted by our fulfillment partner. |
Order Rejected | This event is sent on the rare occasion that an Order cannot be sent to a Pharmacy or is rejected after being received. |
Order Denied | This event is sent when certain Pharmacy-specific conditions are not met, preventing the Order to be sent to the Pharmacy. |
Order Cancellation Approved | This event is sent when a request for cancellation of an Order has been approved. |
Order Cancellation Failed | This event is sent when a request for cancellation of an Order is rejected after being received. |
Shipment Created | This event is sent when a Shipment is created for an Order. All Orders will result in at least one Shipment. |
Shipment Shipped | This event is sent when a Shipment is shipped by a Pharmacy. This may happen simultaneously with a Shipment being created, depending on the Pharmacy Partner. |
Shipment Delivered | This event is sent when a Shipment is delivered to the Patient. Not all shipping methods include tracking therefore this event is not guaranteed. |
Shipment Undeliverable | This event is sent when a Shipment delivery to the Patient was not successful. The reason is included in the payload. Not all shipping methods include tracking therefore this event is not guaranteed. |
Prescription Request Appointment Created | This event is sent when a prescription request appointment is created. |
Prescription Request Appointment Rescheduled | This event is sent when a prescription request appointment is rescheduled. |
Prescription Request Appointment Cancelled | This event is sent when a prescription request appointment is cancelled. |
Prescription Request Appointment No Show | This event is sent when the patient did not turn up for the appointment. |
Example webhook event payloads are provided below (Note that the examples assume you have verified & decoded the JWT payload):
Your request has been received by our prescribing partner and will be reviewed by a prescriber in due course.
Typically this will happen immediately after you submit a Prescription Request.
For sync prescription requests where the Prescriber provides a link for the Patient to schedule a visit, the event will include a scheduling link in the schedulingLink
property.
{
"type": "prescription_request_assigned",
"data": {
"prescriptionRequestId": "rxreq_1234567890",
"prescriptionRequestDownstreamId": "downstream_123",
"schedulingLink": "https://example.com/schedule" | undefined
}
}
A prescriber has reviewed your request and determined that the requested medication is not suitable for the
patient; or it is otherwise not possible to issue a prescription for the requested medication. The reason for
rejection given by the prescriber will be included in the event reason
property. You may wish to contact the
patient to notify them and check the details they provided were accurate.
{
"type": "prescription_request_rejected",
"data": {
"prescriptionRequestId": "rxreq_1234567890",
"reason": "The patient is not suitable for this medication." | undefined,
"prescriptionRequestDownstreamId": "downstream_123" | undefined
}
}
Note: A reason will always be included where we receive one from the Prescriber but certain Partners in our network may not provide this information.
The Prescription Request was denied without being sent to a Prescriber for review.
The reason for denial will be included in the event reason
property. Typically this occurs when the patient or consultation response fail some sort of pre-check performed by the telehealth partner.
{
"type": "prescription_request_denied",
"data": {
"prescriptionRequestId": "rxreq_1234567890",
"reason": "The Patient is not eligible for a new visit" | undefined,
}
}
Note: A reason will always be included where we receive one from the telehealth partner; but in some cases no reason is given.
A new prescription is created; either as a result of a prescriber reviewing a request
and issuing a Prescription, or a Prescription received from an external source. You can
now place an Order for the prescribed medication(s) using the prescriptionId
included in
the event.
Measured quantities are expressed in physical units, given by the quantityUnitOfMeasure
property, and
using a 3 decimal place precision.
{
"type": "prescription_created",
"data": {
"prescriptionId": "rx_1234567890",
"prescriptionRequestId": "rxreq_1234567890" | undefined,
"productIds": ["semaglutide_2.5mg_1ml"],
"prescribedMedication": {
"productSku": "semaglutide_2.5mg_1ml",
"medicationId": "med_zydk6vb0u2up4imsj6ed6mk0" | undefined,
"quantity": 2,
"daysSupply": 3 | undefined,
"measuredQuantity": "2.000",
"quantityUnitOfMeasure": "ml",
"refills": {
"quantityPerFill": 1,
"measuredQuantityPerFill": "1.000",
"numberOfFills": 2
}
}
}
}
Your order has been received and accepted by our fulfillment partner.
{
"type": "order_assigned",
"data": {
"upstreamId": "ord_upstream_123",
"orderId": "ord_1234567890",
"downstreamId": "downstream_123",
}
}
In the unlikely event an Order is sent to a partner for fulfillment, but cannot be fulfilled. This may be
because the order has failed pharmacist verification for example. Where a reason for the rejection is given by
the partner it will be included in the event reason
property.
{
"type": "order_rejected",
"data": {
"orderId": "ord_1234567890",
"upstreamId": "ord_upstream_123",
"reason": "Contraindication between dispensed medication and existing medication" | undefined,
"downstreamId": "downstream_123" | undefined,
"requisitionDownstreamId": "requisition_downstream_123" | undefined
}
}
Certain Pharmacies have specific conditions that must be met before an Order can be sent to them. In the unlikely
event these conditions are not met by your Order, you will receive an order_denied
event. The reason
property
will provide more information about the reason for the denial.
{
"type": "order_denied",
"data": {
"orderId": "ord_1234567890",
"upstreamId": "ord_upstream_123",
"reason": "Patient is not old enough"
}
}
Your order cancellation request was approved and the order is now cancelled.
{
"type": "order_cancellation_approved",
"data": {
"upstreamId": "ord_upstream_123",
"orderId": "ord_1234567890",
"downstreamId": "downstream_123" | undefined,
}
}
Your order cancellation request failed, so the order cannot be cancelled. The failure reason will be included in the event's reason
property.
{
"type": "order_cancellation_failed",
"data": {
"upstreamId": "ord_upstream_123",
"orderId": "ord_1234567890",
"reason": "The order has already been dispatched, and can no longer be canceled",
"downstreamId": "downstream_123" | undefined,
}
}
A Shipment has been created for an Order and is ready to be shipped. Most orders will result in one
shipment, multiple shipments usually occur if you plan to offer split-shipping or are combining multiple product
types in a single order. If using a tracked delivery method the tracking number and/or URL will be included in
the event and any subsequent shipment_shipped
& shipment_delivered
events.
{
"type": "shipment_created",
"data": {
"orderId": "ord_1234567890",
"shipmentId": "ship_1234567890",
"shippingService": "DHL Express" | undefined,
"trackingId": "1234567890" | undefined,
"trackingUrl": "https://www.dhl.com/en/express/tracking.html?AWB=1234567890" | undefined,
"orderDownstreamId": "downstream_123"
}
}
A Shipment from the Order is now with the courier and on its way to your patient. Note that this event may
be sent simultaneously with the shipment_created
event, the event order is not guaranteed. Tracking
information will be included if available.
{
"type": "shipment_shipped",
"data": {
"orderId": "ord_1234567890",
"shipmentId": "ship_1234567890",
"shippingService": "DHL Express" | undefined,
"trackingId": "1234567890" | undefined,
"trackingUrl": "https://www.dhl.com/en/express/tracking.html?AWB=1234567890" | undefined,
"estimatedDeliveryDate": "2024-10-10T12:00:00Z" | undefined,
"orderDownstreamId": "downstream_123" | undefined
}
}
A Shipment from the Order has been delivered to your patient. This event will only be sent for tracked delivery methods where the courier supports delivery notifications.
{
"type": "shipment_delivered",
"data": {
"orderId": "ord_1234567890",
"shipmentId": "ship_1234567890",
"shippingService": "DHL Express",
"trackingId": "1234567890",
"trackingUrl": "https://www.dhl.com/en/express/tracking.html?AWB=1234567890",
"orderDownstreamId": "downstream_123" | undefined
}
}
A Shipment delivery from the Order was not successful. The reason for the failure will
be included in the event's reason
property. Tracking information will only be provided for
tracked delivery methods where the courier supports delivery notifications.
{
"type": "shipment_undeliverable",
"data": {
"orderId": "ord_1234567890",
"shipmentId": "ship_1234567890",
"shippingService": "DHL Express",
"trackingId": "1234567890",
"trackingUrl": "https://www.dhl.com/en/express/tracking.html?AWB=1234567890",
"reason": "Delivery failed 3 times and was returned to the warehouse.",
"orderDownstreamId": "downstream_123" | undefined
}
}
Patient scheduled an appointment with a prescriber.
{
"type": "prescription_request_appointment_created",
"data": {
"prescriptionRequestId": "rxreq_1234567890",
"prescriberName": "John Doe",
"scheduledDate": "2024-10-10T12:00:00Z",
}
}
Patient rescheduled an existing appointment.
{
"type": "prescription_request_appointment_rescheduled",
"data": {
"prescriptionRequestId": "rxreq_1234567890",
"prescriberName": "John Doe",
"scheduledDate": "2024-10-10T12:00:00Z",
}
}
Patient cancelled the appointment and can rebook using original schedulinglink
from Prescription Request Assigned event.
{
"type": "prescription_request_appointment_cancelled",
"data": {
"prescriptionRequestId": "rxreq_1234567890",
}
}
Patient did not show up for the appointment and can rebook using original schedulinglink
from Prescription Request Assigned event.
{
"type": "prescription_request_appointment_no_show",
"data": {
"prescriptionRequestId": "rxreq_1234567890",
}
}
The media API allows you to securely upload supporting files that can then be referenced elsewhere in the Foundation Health API. For example a patient may need to provide images as part of an async consultation. These images can be uploaded to the media API and the returned IDs included when submitting a Consultation Response.
file required | any <binary> The media file to be uploaded. Upload only 1 file per request. Currently accepts JPEG, MP4, PNG and PDF formats only. The maximum accepted file size is 32MiB. |
resourceType required | string Enum: "consultation-image" "consultation-video" "prescription" The type of resource this media file is associated with. |
{- "id": "media_irt8abh7tour86llzlrqkqiy"
}
The Foundation Health API formats errors according to the JSON API specification.
The generic error response will look like this:
{
"errors": [
{
"code": "error_code",
"title": "Error Title",
"detail": "Error detail message.",
"meta": {}
}
]
}
Property | Description | Example |
---|---|---|
code |
An error code unique to a certain error type. | validation_error |
title |
Short human-readable title. | "Validation Failed" |
detail |
More detailed error message. | '1 validation issue(s) found. See "meta.issues" for details.' |
meta |
Additional information about the error. | {} |
Due to the dynamic nature of the meta
property, its contents are not part of the API contract and may differ/change based on the error type.
The following error codes might appear as part of an error message:
Code | Cause |
---|---|
validation_error |
The input data provided to the request is invalid. The meta.issues property contains details about the validation issues. |
entity_not_found |
The provided entity id did not match any record in our database. |
failed_to_parse_request |
The request body could not be parsed. Check detail for further explanation of this error. |
answers_incomplete |
Answers were not provided for all questions. meta property will include the questions that were not answered. |
unexpected_answers_found |
Answers other than the requested ones were provided. meta property will include the extra answers. |
consultation_response_already_used |
Trying to create an order using a consultation response that was already used in another order. |
consultation_response_not_valid |
Invalid items were provided by the consultation. The meta.disallowedSkus property contains the invalid items. |
consultation_item_mismatch |
There is a mismatch between consultation items and order items. |
consultation_response_required |
No Consultation Response is passed when trying to create an order. |
duplicate_skus |
Attempting to create an order that contains duplicate item SKUs. |
items_not_prescribable |
Certain items in the prescription request do not require a prescription. Check meta.unprescribableSkus property for a list of said items. |
order_denied |
The requested Order did not meet all the requirements for fulfilling. The meta property provides further explanation. |
order_unroutable |
The order could not be routed to one of our partners for fulfillment. The details property provides further explanation. |
order_replacement_failed |
The order could not be replaced. The details property provides further explanation. |
patient_mismatch |
The provided patient does not match the prescription patient. |
prescription_item_mismatch |
The prescription does not cover all the requested items. |
prescription_request_unroutable |
The prescription request could not be routed to one of our partners for review. The details property provides further explanation. |
prescription_required |
A prescription was not provided to an order that includes items that need a prescription. |
quantity_exceeds_prescription_limit |
Ordering a quantity larger than the quantity prescribed. |
shipping_service_unavailable |
The requested shipping service was not recognized or is not available in this region. |
invalid_file_type |
Trying to upload an invalid file type to the media service. |
multiple_files_found |
A specific mediaId points to multiple different files. |
invalid_answers |
The provided answers do not match the answer options for the question. |
internal_error |
An internal error server occurred. Please contact Foundation Health for more information. |