REST API
Recommendations
Create Patient Recommendation
there are two ways to create a recommendation the parameters for the json object are entirely optional you can pass an array of item objects to add items right upon creation to reduce the amount of api calls required to create a complete recommendation the only requirement is a path variable \ patient id , so it is necessary to create the patient prior to creating a recommendation if the patient does not yet exist deprecation notice the \ patient id is identical to the magento customer id and applications may create customers using the core magento api calls when creating comprehensive recommendations, each item passed in the items array require at minimum a sku and qty attribute the rest of the attributes are optional see the recommendation item object documention for details return this call returns the entire recommendation object { "tab" "examples", "url" "/v1/dispensary/patient/\ patient id/recommendation", "name" "api", "method" "post", "request" { "pathparameters" \[ { "kind" "required", "name" "patient id", "type" "integer", "children" \[], "description" "the patient id for which to create this recommendation" } ], "queryparameters" \[], "headerparameters" \[ { "kind" "required", "name" "authorization", "type" "string", "children" \[], "description" "the access token" } ], "bodydataparameters" \[ { "kind" "optional", "name" "recommendation", "type" "object", "children" \[ { "kind" "optional", "name" "notify email", "type" "boolean", "description" "whether to notify the patient via their email address default 1" }, { "kind" "optional", "name" "notify sms", "type" "boolean", "description" "wether to notify the patient via sms text message default 0" }, { "kind" "optional", "name" "note", "type" "string", "description" "a note for this recommendation" }, { "kind" "optional", "name" "items array\[]", "type" "object", "children" \[ { "kind" "required", "name" "sku", "type" "string", "description" "the item's sku" }, { "kind" "required", "name" "qty", "type" "integer", "description" "the item's quantity" }, { "kind" "optional", "name" "fulfillment type", "type" "string", "description" "lc for in practice fulfillment\n1l for first time in practice fulfillment on subscriptions" }, { "kind" "optional", "name" "note", "type" "string", "description" "item specific note, usually dosing instructions " }, { "kind" "optional", "name" "autoship interval", "type" "string", "description" "for subscription recommendations see the recommendation item object spec for details " }, { "kind" "optional", "name" "doctor id", "type" "integer", "description" "to associate this item with a specific doctor see the doctor object spec for details " }, { "kind" "optional", "name" "location id", "type" "integer", "description" "to associate this item with a specific doctor see the location object spec for details " } ], "description" "optional array of items" } ], "description" "id of the cake to get" } ], "formdataparameters" \[] }, "results" { "languages" \[ { "id" "st7x5ecla7vjy6twnarmd", "code" "{\n \\"recommendation id\\" \\"6e6e08cf e2a0 4e0e 9359 e2e42896b56e\\",\n \\"note\\" \\"overall recommendation notes\\",\n \\"status\\" \\"pending\\",\n \\"patient\\" {\n \\"patient id\\" 71,\n \\"firstname\\" \\"juergen\\",\n \\"lastname\\" \\"schreck\\",\n \\"email\\" \\"juergen+uat\@gethealthy store\\"\n },\n \\"practice id\\" 1,\n \\"notify email\\" 1,\n \\"notify sms\\" 0,\n \\"practice conversion url\\" \\"https //uat gethealthy store/admin/dispensary/recommendation/convert/rid/6e6e08cf e2a0 4e0e 9359 e2e42896b56e/\\",\n \\"patient conversion url\\" \\"https //uat gethealthy store/dispensary/recommendation/convert/rid/6e6e08cf e2a0 4e0e 9359 e2e42896b56e/\\" \n \\"items\\" \[\n {\n \\"item id\\" \\"54dddeea 19d6 4914 8b52 4064f050737c\\",\n \\"sku\\" \\"sf811\\",\n \\"qty\\" 1,\n \\"autoship interval\\" \\"once\\",\n \\"fulfillment type\\" \\"lc\\",\n \\"note\\" \\"item specific note\\",\n \\"additional options\\" \[],\n \\"availability\\" \\"in stock\\"\n },\n {\n \\"item id\\" \\"179a7ef1 e1c7 42a2 a468 bd50dbee71f8\\",\n \\"sku\\" \\"sp607\\",\n \\"qty\\" 2,\n \\"autoship interval\\" \\"30d\\",\n \\"fulfillment type\\" \\"1l\\",\n \\"note\\" \\"this is really good stuff\\",\n \\"availability\\" \\"in stock\\",\n \\"additional options\\" \[]\n }\n ]\n}", "language" "200", "customlabel" "" } ], "selectedlanguageid" "st7x5ecla7vjy6twnarmd" }, "examples" { "languages" \[ { "id" "yeg4szbh1savsk3upfykt", "code" "curl location g request post 'https //{{api host}}/rest/{{scope}}/v1/dispensary/patient/71/recommendation' \\\\\n header 'content type application/json' \\\\\n header 'authorization bearer {{access token}}' \\\\\n data raw '{\n \\"recommendation\\" {\n \\"notify email\\" \\"1\\",\n \\"notify sms\\" \\"0\\",\n \\"note\\" \\"recommendation to help with your lipids \\"\n \\"items\\" \[{\n \\"sku\\" \\"sf811\\",\n \\"qty\\" \\"1\\",\n \\"autoship interval\\" \\"once\\",\n \\"note\\" \\"take two before bedtime \\",\n \\"doctor id\\" 25,\n \\"loction id\\" 123,\n },{\n \\"sku\\" \\"sp607\\",\n \\"qty\\" 3,\n \\"fulfillment type\\" \\"1l\\",\n \\"autoship interval\\" \\"30d\\",\n \\"note\\" \\"this is really good stuff take 1 in the morning with food\\"\n }]\n }\n}'", "language" "json", "customlabel" "comprehensive" }, { "id" "9l ajvhios kzzp5hwyev", "code" "curl location g request post 'https //{{api host}}/rest/{{scope}}/v1/dispensary/patient/50/recommendation' \\\\\n header 'content type application/json' \\\\\n header 'authorization bearer {{access token}}' \\\\\n data raw '{\n \\"recommendation\\" {\n \\"notify email\\" \\"1\\",\n \\"note\\" \\"recommendation to help with your lipids \\"\n }\n}'", "language" "none", "customlabel" "simple" } ], "selectedlanguageid" "yeg4szbh1savsk3upfykt" }, "description" "recommendations require an existing patient record and a initiated from the patient api \n", "currentnewparameter" { "label" "header parameter", "value" "headerparameters" } }