Skip to main content

Recommendations and the Buy button

Health Nexus writes recommendations for each health category from a person's results. Each recommendation has action items: concrete next steps. An action item can have a product attached. When it does, the API gives you what you need to render a Buy button.

Read the recommendations​

You wantCall
Every category with its recommendation and action itemsGET /api/patient/category-recommendations
One categoryGET /api/patient/category-recommendations/{category} (URL-encode the name, for example Gut%20Health)
The person's "do these first" list across categoriesGET /api/patient/category-recommendations/priorities

A person with no recommendations yet gets empty lists, not an error.

The product object​

An action item may carry a product:

{
"id": "8d1c2e…",
"title": "Start NAD+ therapy to support cellular energy",
"body": "…",
"productId": "66b2f0c1a2b3c4d5e6f7a8b9",
"product": {
"id": "66b2f0c1a2b3c4d5e6f7a8b9",
"name": "NAD+ IV [300 mg]",
"url": "https://…"
}
}
FieldMeaning
product.idThe catalog product. Equals productId.
product.nameThe display name. Label the button Buy {name}.
product.urlA link to the product, already resolved for this person's own location. Open it in a new tab.

Two rules​

  1. product is present: show the Buy button. Label it with product.name and open product.url.
  2. product is absent: show no button. Do not fall back to productId. An item keeps its productId when the product is no longer offered or is not sold at this person's location, and the API leaves product out on purpose. A missing button is the correct result, not an error.

The link is worked out for each person every time you read, against what their location sells. The catalog is refreshed every night: products come and go, and prices and availability change.

  • Read, render, discard. Caching a reply for a few minutes is fine. Storing links is not.
  • Never reuse one person's link for another person.
  • Do not build links from product names. Availability and location are applied on our side.

Example​

GET /api/patient/category-recommendations/priorities for a person whose location sells the first product and not the second:

{
"items": [
{
"id": "a1…", "category": "Nutrition + Metabolic Health",
"title": "Book a Detox IV series", "body": "…",
"productId": "66…01",
"product": { "id": "66…01", "name": "Detox IV", "url": "https://…" }
},
{
"id": "b2…", "category": "Immune Health",
"title": "Consider a Glutathione Shot", "body": "…",
"productId": "66…02"
},
{ "id": "c3…", "category": "Gut Health", "title": "Eat 30 different plants a week", "body": "…" }
]
}

The first item gets a Buy Detox IV button. The second has a productId and no product, so it gets no button. The third has neither.

Changing the lists​

With the write scope a person's priorities can be changed on their behalf: add one with POST /api/patient/category-recommendations/priorities, remove one with DELETE …/priorities/{itemId}, and reorder with PUT …/priorities/order. See the API reference.