A pickup is created by the clinic when it dispenses a prescription — there is no route to create one from the
API. Your key reads and completes pickups the clinic already created; it never invents one. The patient must be one
your key is allowed to see. A patient the clinic has restricted, or a pickup that does not exist, returns
404 with
code: "not_found". The two are never told apart. See Errors.
What a pickup looks like
Full-edition pickups vs. Pharmacy-edition till pickups
A full-edition clinic’s in-house pharmacy hands out one or more prescriptions: each line inlines carries a
prescription_id. A Pharmacy-edition clinic’s till sale can also create a pickup — then pos_sale_id is set on
the pickup, and each line carries pos_sale_item_id (the sale’s own line) instead of a prescription_id. Never both
on the same line. Treat lines as a list of “things handed over” and read whichever id is present; do not assume
every pickup is prescription-shaped.
List pickups
Submit a collection
Idempotency-Key is required. Sending the same key again returns the first answer and does not create a second
submission. See Retries and duplicates.
The answer is 202, not 200
"review_status": "pending". The pickup is not collected yet. Read the
body, not the status code — if the clinic has chosen to accept pickup collections from your key automatically, the
same 202 already shows "review_status": "confirmed" and "accepted_automatically": true. See
Automatic acceptance.
After you send one
pending: waiting for a person at the clinic. The pickup still readsstatus: "awaiting".confirmed: a clinician (or the clinic’s automatic acceptance) recorded it, through the same single path the pharmacy counter’s own screen uses.result_record_idis the pickup, which now readsstatus: "collected".rejected: declined, with the reason — for example, the pickup was already collected by the time it was reviewed.withdrawn: you took it back while it was pending.
payload never carries the signature image, even for your own submission — has_signature
is a sibling field on the submission, just as it is on the pickup. Only the key or organization that sent a
submission can read it. A submission that has been decided cannot be changed (409 submission_not_pending).
What is never returned
- The signature image. No route under this API, at any permission, returns the bytes of a signature.
has_signatureis the only signal you ever get. agent_name, to an organization. A clinic-owned key sees who collected on an agent’s behalf; a connected organization sees onlyagent_relationship, never the name.
A worked example
- A patient’s pharmacy order is dispensed at the clinic. The clinic’s system creates a pickup,
status: "awaiting". - Your kiosk captures a signature when the patient collects. You send
POST …/prescription-pickups/PICKUP_ID/collectionwithcollected_by: "patient", the signature and anIdempotency-Key. The answer is202. - A clinician reviews it in Outside submissions and selects Accept — the same acceptance ClinikEHR’s own staff review screen uses for any outside submission.
- You read the submission again:
confirmed, withresult_record_idpointing at the pickup. GET …/prescription-pickups/PICKUP_IDnow showsstatus: "collected",has_signature: true, and the answers you sent with their exact wording.