---
title: Recommendation Object
slug: recommendation-object
createdAt: 2022-12-20T18:27:43.000Z
---

Recommendations are the mechnism by which practitioners create *prescriptions&#x20;*&#x74;o suggest supplements to their patients. Once a recommendation is sent via email, it remains accessible to the patient in their store dashboard. They may reorder these recommendations at any given time. Addtiionally the practitioner may specify a recurrening schedule to automatically ship refills at automatic intervals.

Creating recommendations requires a `patient_id`, so a patient record must be created prior to creating a recommendation.

::::CodeDrawer{title="The Recommendation Object" isResponseExpanded="false" autoGeneratedAnchorSlug="the-recommendation-object" legacyHash="Xp4vVgZNE1eg5ZSwZApDE"}
:::CodeblockTabsExamples
```json
{
    "recommendation_id": "38e71539-fbd3-499e-94dd-04c6dde01b40",
    "patient": {
        "patient_id": 71,
        "firstname":"Jon",
        "lastname":"Doe",
        "email":"jon.doe@example.com"
    },
    "patient_id":"71",
    "practice_id":"56209",
    "note":"Recommendation for John Doe",
    "status":"pending",
    "notify_email": 1,
    "notify_sms":0,
    "notify_at":"",
    "notify_status":"queued",
    "practice_conversion_url":"https://my.practice.com/admin/dispensary/recommendation/convert/rid/38e71539-fbd3-499e-94dd-04c6dde01b40",
    "patient_conversion_url":"https://my.practice.com/dispensary/recommendation/convert/rid/38e71539-fbd3-499e-94dd-04c6dde01b40",
    "items":[
        {
            "item_id": "ae483c8c-11b5-4aa7-871f-17080ab7cdb4",
            "sku":"SP907",
            "qty":1,
            "note":"Take 1 in the morning and 1 at bedtime.",
            "autoship":1,
            "autoship_interval":"30d",
            "fullfillment_type":"1L",
            "availability":"In Stock",
            "doctor_id": 25,
            "location_id": 123.
            "additional_options":[]
        }
    ]
}
```
:::

:::CodeblockTabsResponses
```javascript
```
:::
::::

::::ExpandableHeading{isOpen="true"}
## Core Attributes

**recommendation\_id&#x20;**`string`&#x20;
The main identifier `uuid` for this object.

***

:::ExpandableHeading{isOpen="true"}
**patient&#x20;**`object`

***

**patient\_id&#x20;**`integer`
The identifier for the patient this recommendation is associated with. The integer value is unique per instance and interchangeable with the `customer_id` in core Magento API calls. Once a recommendation is created for a patient, it cannot be re-assigned to another patient.

***

**firstname&#x20;**`string`
Patient's first name. *Same as Magento customer firstname.*

***

**lastname&#x20;**`string`
Patient's last name. *Same as Magento customer lastname.*


**email&#x20;**`string`
Patients email address. *Same as Magento customer email.*
:::

***

**practice\_id&#x20;**`integer`&#x20;
The identifier for the practice which this recommendation has been created by. The integer value is unique per instance and interchangeable with the `store_id` in core Magento API calls. The `practice_id` does not need to be submitted when creating recommendations and is automatically determined by `scope` path variable of the request.

***

**note&#x20;**`string`&#x20;
A personalized note to the patient, which is sent in emailed recommendations and remains visible in the patients recommendations dashboard.

***

**status&#x20;**`string` <font color="#eb144c">`read-only`</font>
The transitional status of the recommendation. This is a read-only attribute. Possible values are pending and purchased.

***

**notify\_email&#x20;**`boolean`&#x20;
This parameter controls whether an email notification is sent to the patient when the `notify` endpoint is triggered. The system will not send notifications automatically when recommendations are created via the api.

***

**notify\_sms&#x20;**`boolean`&#x20;
This parameter controls whether an sms notification is sent to the patient when the `notify` endpoint is triggered. The system will not send notifications automatically when recommendations are created via the api. In order for this call to succeed the patient record must have a valid `primary_telephone` attribute.


:::hint{type="warning"}
Patients are not required to opt in for SMS notifications. However they are offered to opt out anytime by sending the STOP keyword. Once the STOP is requested no further notifications will be sent. It is therefore recommended that email notification is always used in combination with sms notification.
:::

***

**notify\_status&#x20;**`string` <font color="#eb144c">`read-only`</font>
This parameter controls the status of nofication. Possible values include queued and sent. If notifications are triggered multipe times, the status always represents the most recent iteration.

***

**notify\_at&#x20;**`datetime` <font color="#eb144c">`read-only`</font>
This attribute parameter controls sending delayed notifications to the patient. The format is `yyyy-mm-dd hh:mm:ss` and specified as UTC time.

***

**items&#x20;**`array`&#x20;
The items array contains the item details of the recommendation. It is possible for this array to by empty as recommendations can be created without an initial item and items may be added or updated on the recommendation after it was created. See the **Recommendation Item Object&#x20;**&#x61;ttributes for detals.
::::

***

:::ExpandableHeading{isOpen="true"}
### Additional Attributes

**practice\_conversion\_url&#x20;**`string` <font color="#eb144c">`read-only`</font>

The url which would permit a practitioner to convert the recommendation to a cart and complete the checkout in their web-dashboard.

***

**patient\_conversion\_url** <font color="#eb144c">`read-only`</font>[](https://uat.gethealthy.store/dispensary/recommendation/convert/rid/38e71539-fbd3-499e-94dd-04c6dde01b40/)

The url wich can be used to convert the recommendation to a cart and comple the checkout on the store frontend by the patient. This is the primary use case for purchasing recommendations on our platform when appication would like to utilize their own notification system.
:::

