Skip to main content

Pharmacy Integration

This guide is for partner pharmacies connecting their own systems to VitaRelay. It documents the inbound webhook you call — pharmacy → VitaRelay — to push order fulfillment status, tracking, and inventory updates as they happen. VitaRelay dispatches orders to your system through a separate, pharmacy-specific onboarding channel arranged directly with your VitaRelay contact. That channel is not documented here.

Status updates

Move an assigned order through accepteddelivered and attach tracking.

Inventory updates

Keep stock availability and wholesale cost current for your products.

Endpoint & authentication

POST your updates to:
{orgId} is your pharmacy’s VitaRelay organization UUID, provided by a VitaRelay admin. POST is the only supported method, and the request must be sent with Content-Type: application/json. Every request must be signed with the inbound webhook secret:
  • Header: x-vitarelay-signature
  • Value: HMAC-SHA256 of the exact raw request body bytes, keyed with your inbound webhook secret.
  • Encoding: hex or base64 are both accepted, and a leading sha256= prefix is tolerated (optional).
The inbound webhook secret is issued — and rotated — by a VitaRelay admin and shared with you directly. It is per-pharmacy, shown once, and cannot be retrieved self-serve. Store it in a secret manager.
Sign the exact bytes you transmit. If you re-serialize the body after signing — pretty-printing, reordering keys, or letting an HTTP client rebuild the JSON — the signature will not match and the request is rejected with 401.

Sending a status update

Use event: "status_update" to update the fulfillment status of a single order assigned to your pharmacy.
Only those four fields — status plus the three tracking fields — are applied, and only to the fulfillment record for your pharmacy’s assignment on that order. You can only update orders assigned to you. Any status value outside the enum above is rejected with 400. The typical progression is acceptedprocessingready_to_shipshippeddelivered. VitaRelay does not enforce a transition state machine; it applies whatever valid status you send.

Sending an inventory update

Use event: "inventory_update" to refresh stock availability and wholesale cost for your products.
Each item is matched by ndc_code when present, otherwise by name. Items with neither key are skipped. Only the fields you provide are updated, and only for products belonging to your pharmacy.

Responses & error codes

Example note values on a 200:
A 200 response is not proof that your order matched. An unknown order_number still returns 200, with the note order ... not found. Always inspect the note field and alert on the not found case.

Send your first signed update

1

Get your credentials

Ask your VitaRelay contact for your organization UUID and your inbound webhook secret. Store the secret in a secret manager — it is shown only once.
2

Confirm your integration is enabled

A VitaRelay admin must enable your integration record. Until then, the endpoint returns 404 Integration not enabled.
3

Build and sign the body

Serialize your JSON payload once, compute HMAC-SHA256(rawBody, secret), and send the hex digest in x-vitarelay-signature.
4

POST and verify

Send the request to https://vitarelay.com/api/public/pharmacy-webhook/{orgId}. Confirm you receive 200 and that the note reports the order or product count you expected.
5

Go live

Wire the call into your fulfillment workflow so each status change and inventory refresh is pushed to VitaRelay as it happens. VitaRelay notifies the practice and patient automatically on each status update.