Skip to main content
An order that has stopped moving looks exactly like an order that is simply early. This page is the difference between the two: which prescription event means a human should look, what it tells you, how to sweep for orders that have gone quiet, and what to hand support when the answer is “escalate”. It builds on Order status and tracking; the events are signed webhooks.

What you’ll do

1

Act on the one trouble event: cancellation

prescription.cancelled (data.status cancelled) is the only prescription event that means trouble.
2

Treat a cancellation as the whole signal

There is no structured reason field: type prescription.cancelled + data.status cancelled + data.timestamps.cancelled_at is all you get.
3

Read payment trouble from the billing events

On-hold and unpaid states are not on prescription events, and a refund request appears only as prescription.refund_requested at 2.0. Read payment state from the billing events or the payment pages.
4

Run your own stale sweep

There is no order list to poll. “No event for N days” on your own clock is the only stuck signal you have.
5

Escalate with the resource_id and the last envelope id

These are what make an escalation actionable when there is no API response to quote.

Recipe · Spot the values that mean trouble

Only one prescription event means trouble: a cancellation. Every event carries the order’s current data.status (created, ordered, shipped, delivered, cancelled, unknown); check it on every event you apply. Payment trouble is not on prescription events. There is no on-hold or payment-failure field on a prescription payload. prescription.invoiced, .paid and .refund_requested arrive only on a 2.0 subscription and say that billing moved, not why a payment failed. Detect payment trouble from the com.openloop.payments events or the payment reads — see Payment failure. data.context is a free-form string → string map whose keys are not part of the versioned contract; do not route on a specific context key.

Recipe · Handle a cancellation

prescription.cancelled sets data.status to cancelled and data.timestamps.cancelled_at. There is no structured cancellation-reason field in the deployed contract — the event does not tell you why the order was cancelled. So a cancellation is a single fact: the order is cancelled, as of cancelled_at. Stop showing shipment progress as the headline and show it as cancelled. If the patient did not ask for the cancellation, escalate it with the ids below; the “why” has to come from your implementation contact, not the event. Billing is a separate lifecycle. A cancelled order does not by itself cancel a subscription or refund an invoice; that is Cancel, pause and refund. Refund and payment state live on the billing events, not on the prescription event — see Payment failure.

Recipe · Sweep for orders that have gone quiet

There is no order list on the partner surface, so you cannot ask OpenLoop which orders are stuck. Your own record of the events you received is the sweep’s input, and your own clock is its trigger. Keep, per order (data.resource_id): the last type, the last occurredAt, and the time you received it. On a schedule, flag every order whose last event is older than your threshold for that stage and that has not reached a terminal state (data.status of shipped or cancelled): The thresholds are yours; the contract gives none. Two cases the per-order sweep cannot see, because no event exists to start the clock:
  • The order never appeared. You took payment or submitted an intake and no prescription.created has arrived. Start that clock from your own submit time. No prescription event signals that a clinician declined to prescribe, so silence is all you will see.
  • Events stopped arriving for everyone. If no event at all has reached your endpoint for longer than your usual traffic gap, suspect the delivery path before suspecting every order. The signature, retry and delivery policy are the standard webhook contract — see Events; a delivery that exhausts its retries is recorded as failed and is not re-sent automatically (an OpenLoop operator can re-drive it).
Before you escalate a quiet order, rule out your own side: confirm your endpoint returned 2xx for the events you did receive, and that an event was not dropped by your dedupe on the envelope id or filed under the wrong patient (see the correlation rule on Order status and tracking).

Recipe · Escalate

When an order is genuinely stuck, or cancelled without the patient asking, send your implementation contact:
  1. The data.resource_id from the event — your order key.
  2. The envelope id and type of the last event you received for it, with its occurredAt.
  3. The data.pharmacy identifier if it is set, labelled as the dispensing pharmacy.
  4. What you expected to happen and by when, on your clock.
There is no API response here, so there is no request_id to quote; the envelope id plays that role. Capture it from the event you actually stored, not from a later one.

What comes back

The full attribute set is on Prescription events.

Gotchas

Silence is not a status. No event means nothing has been sent to you, not that nothing has happened. The stale sweep runs on your clock because there is no order read to confirm against.
Payment state is not on a prescription event. On-hold, unpaid and refunded are billing states, carried by the com.openloop.payments events (invoice.paid, subscription.*) and readable via GET /v0.1/subscriptions / GET /v0.1/invoices — never by a field on a prescription payload. The one exception is that a refund request arrives as prescription.refund_requested, at 2.0 only; it says a refund was asked for, not that it was paid out. See Payment failure.
A cancellation carries no reason. prescription.cancelled gives you data.status cancelled and data.timestamps.cancelled_at and nothing more — there is no structured reason field. If you need to know why, ask your implementation contact.
Webhook events cannot be exercised by the conformance runner, and this cookbook has not observed a cancellation on staging. The envelope, fields and status values are the deployed contract (see Events and Prescription events); the routing guidance here is this cookbook’s, not documented behaviour.

Order status and tracking

The happy path this page interrupts: set-up, rendering status, dedupe and correlation

Prescription events

Every attribute and value, the status enum and the timestamps

Cancel, pause and refund

When the answer to a problem order is to stop billing for it or refund it

Payment failure

When an order is on hold because the payment did not go through