v2

latestOpenAPI 3.1.12026-08-078549932.4 MB
Inventory

post/Inventory/{id}/dispense

Path parameters

idstring required

Request body

lotIdstring nullable
containerIdstring nullable

Explicit physical container to draw from within the resolved lot (ITE-157). When null, the engine auto-selects: an already-opened container first, then the oldest sealed one. Ignored for lots that have no container rows (legacy).

patientIdstring nullable
appointmentIdstring nullable
witnessUserIdstring nullable
notesstring nullable
locationIdstring required

Storage location the inventory is being dispensed from. Required for accurate location tracking.

dispenseTypestring

Type of dispense: InHouse (administered now) or Prescription (take-home). Defaults to InHouse.

dispositioninteger
dosagestring nullable
frequencystring nullable
durationstring nullable
instructionsstring nullable
prescriptionItemIdstring nullable

When set, links this dispense to an existing prescription item instead of creating a new prescription. Used by Rx Governance dispense flow.

deferRxDetailsboolean

When true, this is a take-home dispense whose prescription record is created (or deliberately deferred) <em>after</em> the dispense, rather than inline. Used by the appointment "Take Home" flow, where the inventory is dispensed first and the Rx label is filled out afterward via CreatePostDispensePrescriptionAsync. When set, the dispense validator skips the dosage/frequency requirement and the prescription linker does not create an inline Rx for a Prescription dispense.

invoiceIdstring nullable

When set, the dispense and the matching InvoiceLineItem are created in the same unit of work. Callers with an active estimate should provide this to avoid the "dispensed but floating" state. Leave null to create the transaction only.

targetInvoiceLineItemIdstring nullable

When set, links this dispense to a PRE-EXISTING <see cref="!:InvoiceLineItem" /> (e.g. a BillableItem "Charge" line being fulfilled): the transaction's InvoiceLineItemId is stamped to this value WITHOUT creating a new line or auto-creating a draft estimate. Used by the fan-out orchestrator so all N component transactions attach to the one charge line. Takes precedence over string? DispenseItemDto.InvoiceId when both are set.

targetEstimateLineItemIdstring nullable

When set, the dispense fulfills this PRE-EXISTING Pending estimate line (stamping the transaction and marking it Performed) instead of pooling onto whatever draft estimate is open. Used by the MedicationRequest lifecycle, where the request's quote line is created at approval and the pickup dispense must land on that exact line. Falls through to the normal attach path when the line is missing or no longer Pending.

markedForBillingboolean

When true, the resulting <see cref="!:InventoryTransaction" /> is flagged MarkedForBilling = true so the unbilled-items flow surfaces it for invoicing. Used by the appointment-close dispense path; default false for the direct dispense path which writes its own line items.

skipInvoiceAttachboolean

When true, the dispense side effects skip the auto-attach-to-Invoice step entirely (no explicit-invoice attach, no draft-Invoice find/create). Used by the in-visit appointment perform path, where the billing link lives on the estimate line (EstimateLineItem.InventoryTransactionId) and no Invoice exists until the staff explicitly converts. Ignored when an explicit string? DispenseItemDto.InvoiceId or string? DispenseItemDto.TargetInvoiceLineItemId is supplied.

overrideValidationboolean

When true, bypasses VCPR and quantity validation checks.

overrideReasonstring nullable

Required when overrideValidation is true. Reason for the override.

collectorNamestring nullable

UK CDR (Misuse of Drugs Regs) — name of the person collecting the dispensed Schedule 2–5 controlled drug. Required by <see cref="!:IRegionalPrescribingRules.RequireCollectorRecord" />; ignored in US dispenses.

collectorIdCheckedboolean nullable

UK CDR best practice — confirmation that the collector's photo ID was verified before handing over the drug. Required alongside string? DispenseItemDto.CollectorName on UK CD dispenses.

Response

OK

transactionIdstring
invoiceLineItemIdstring nullable

Set when the dispense was made against an open estimate and the caller supplied string? DispenseItemDto.InvoiceId. The caller can append the line item to its local state directly from this response instead of refetching.

invoiceIdstring nullable

The estimate the dispense was attached to — the caller-supplied one, or one auto-created/resolved server-side when none was provided. Lets a caller with no estimate of its own adopt the server's estimate rather than failing to reconcile.

estimateLineItemIdstring nullable

Set when a patient-scoped POS / non-appointment dispense landed on a draft Estimate line (the single billing path). The line awaits an explicit convert-to-invoice. Mutually exclusive with string? DispenseResultDto.InvoiceLineItemId.

estimateIdstring nullable

The draft Estimate the dispense was stamped onto (found or created for the patient). Lets the caller adopt the server's estimate without refetching.

deaEntryIdstring nullable
lotIdstring
containerIdstring nullable
dispenseTypestring
prescriptionIdstring nullable
prescriptionItemIdstring nullable