Skip to main content
POST
Record a dispensed fill

Authorizations

X-API-Key
string
header
required

Public API key: cxp_<hex> (firm-scoped) or cxpp_<hex> (provider-scoped). Required on every request.

Path Parameters

caseId
string<uuid>
required

Med case UUID: medCaseId in the referral.* webhook payload, or the id from GET /med-cases.

referralId
string<uuid>
required

Med referral UUID: the referral of this case to your pharmacy practice. Find it with GET /med-cases/{id}/referrals, or take it from the referral.* webhook payload.

Body

application/json
rxNumber
string
required
Required string length: 1 - 50
fillDate
string<date>
required

YYYY-MM-DD, a real calendar date.

drugName
string
required
Required string length: 1 - 500
billedAmount
string
required

Non-negative decimal string, e.g. "40.00".

Pattern: ^\d{1,10}(\.\d{1,2})?$
externalId
string

Your system's id for this record (e.g. a PioneerRx event id). Unique per practice within each resource type (fills, transactions and snapshots each have their own namespace), across all of the practice's referrals and cases: it is not scoped to a referral, so do not reuse one id for two referrals. Re-sending the same externalId with the same payload returns the existing record (200, meta.replayed=true), even after the referral has moved to a status that no longer accepts new records; with a different payload, 409 external_id_conflict. A replay is compared with the record as it is now, so re-sending the original POST after any PATCH to that record returns 409 external_id_conflict; to recover, PATCH the record at error.details.existingId instead of re-posting. Referenced ids (prescriptionId, claimDocumentId, fillId, reversesTransactionId) are part of the compared payload, so a replay after the referenced record was deleted (its link cleared) also returns 409 external_id_conflict. Leading and trailing whitespace is trimmed. A POST without an externalId is accepted but never deduplicated, so always send one.

Required string length: 1 - 200
ndc
string | null

11 digits; hyphens and spaces are accepted and removed.

quantity
string | null

Decimal string greater than 0, up to 3 fractional digits, e.g. "30" or "7.5".

Pattern: ^\d{1,9}(\.\d{1,3})?$
daysSupply
integer | null
Required range: 0 <= x <= 3650
prescriberName
string | null
Maximum string length: 300
prescriptionId
string<uuid> | null

A prescription routed to your pharmacy on this case (GET /med-cases/{caseId}/prescriptions); otherwise 400 invalid_reference.

claimDocumentId
string<uuid> | null

A document on this case that your practice can see — one your practice uploaded, or a firm upload the firm has not hidden; otherwise 400 invalid_reference.

notes
string | null
Maximum string length: 2000

Response

Replay: the externalId was already used with the same payload. The existing fill is returned, nothing is written, logged or emitted, and meta.replayed is true.

data
object
required

One dispensed prescription fill on a pharmacy referral. billedAmount is what the pharmacy billed for it.

meta
object
required