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 want | Call |
|---|---|
| Every category with its recommendation and action items | GET /api/patient/category-recommendations |
| One category | GET /api/patient/category-recommendations/{category} (URL-encode the name, for example Gut%20Health) |
| The person's "do these first" list across categories | GET /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://…"
}
}
| Field | Meaning |
|---|---|
product.id | The catalog product. Equals productId. |
product.name | The display name. Label the button Buy {name}. |
product.url | A link to the product, already resolved for this person's own location. Open it in a new tab. |
Two rules
productis present: show the Buy button. Label it withproduct.nameand openproduct.url.productis absent: show no button. Do not fall back toproductId. An item keeps itsproductIdwhen the product is no longer offered or is not sold at this person's location, and the API leavesproductout on purpose. A missing button is the correct result, not an error.
Do not store the link
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.