openapi: 3.2.0 info: version: v1 title: Pharmacy Unified API v1.0 Refill Order API servers: - url: https://pharmacy-unified.api.medadvisor.com.au tags: - name: RefillOrder paths: /api/v1/RefillOrder/PendingOrder/{orderId}: get: tags: - RefillOrder summary: 'Get full pending order with line items and resolved statuses (Epic 2 — Story 2.1). Returns HTTP 404 when the order does not exist or does not belong to this pharmacy.' operationId: RefillOrder_GetPendingOrder parameters: - name: orderId in: path required: true schema: type: integer format: int32 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.PendingOrderModel' text/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.PendingOrderModel' application/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.PendingOrderModel' text/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.PendingOrderModel' security: - Bearer: [] delete: tags: - RefillOrder summary: 'Delete a pending order (Epic 2 — Story 2.5a, FR29). Returns 404 when the order does not exist or does not belong to this pharmacy.' operationId: RefillOrder_Delete parameters: - name: orderId in: path required: true schema: type: integer format: int32 responses: '204': description: No Content security: - Bearer: [] /api/v1/RefillOrder/CompletedOrder/{orderId}: get: tags: - RefillOrder summary: 'Get a completed order with read-only details and PIA payment status (Epic 6 — Story 6.1). Returns HTTP 404 when the order does not exist or does not belong to this pharmacy.' operationId: RefillOrder_GetCompletedOrder parameters: - name: orderId in: path required: true schema: type: integer format: int32 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.PendingOrderModel' text/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.PendingOrderModel' application/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.PendingOrderModel' text/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.PendingOrderModel' security: - Bearer: [] /api/v1/RefillOrder/EScriptToken/{orderId}/{tokenId}: get: tags: - RefillOrder summary: 'Get full eScript token detail for a line item (Epic 3 — Story 3.2, FR15). Returns 404 when the order does not belong to this pharmacy or the token is not found.' operationId: RefillOrder_GetEScriptToken parameters: - name: orderId in: path required: true schema: type: integer format: int32 - name: tokenId in: path required: true schema: type: string responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.EScriptTokenDetailModel' text/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.EScriptTokenDetailModel' application/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.EScriptTokenDetailModel' text/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.EScriptTokenDetailModel' security: - Bearer: [] /api/v1/RefillOrder/Delivery/{orderId}: put: tags: - RefillOrder summary: 'Update delivery address fields, shipping method, or delivery status (Story 4.1 — FR18–FR20). Returns 404 when the order does not exist, does not belong to this pharmacy, or is not a delivery order.' operationId: RefillOrder_UpdateDelivery parameters: - name: orderId in: path required: true schema: type: integer format: int32 responses: '204': description: No Content security: - Bearer: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.UpdateDeliveryRequest' text/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.UpdateDeliveryRequest' application/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.UpdateDeliveryRequest' text/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.UpdateDeliveryRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.UpdateDeliveryRequest' required: true /api/v1/RefillOrder/AddNote: post: tags: - RefillOrder summary: 'Add or update a pharmacy note on an order (Epic 5 — Story 5.1, FR24). Returns 404 when the order does not belong to this pharmacy.' operationId: RefillOrder_AddNote responses: '204': description: No Content security: - Bearer: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.AddNoteRequest' text/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.AddNoteRequest' application/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.AddNoteRequest' text/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.AddNoteRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.AddNoteRequest' required: true /api/v1/RefillOrder/Complete: post: tags: - RefillOrder summary: 'Finalise (complete) a pending order (Story 2.5b — FR27). Returns 404 when the order does not exist or does not belong to this pharmacy. Returns 400 when the order has no line items to tally.' operationId: RefillOrder_Complete responses: '204': description: No Content security: - Bearer: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.CompleteOrderRequest' text/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.CompleteOrderRequest' application/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.CompleteOrderRequest' text/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.CompleteOrderRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.CompleteOrderRequest' required: true /api/v1/RefillOrder/ProcessPIA: post: tags: - RefillOrder summary: Process a Pay-in-Advance charge (Epic 4 — Story 4.3). operationId: RefillOrder_ProcessPIA responses: '204': description: No Content security: - Bearer: [] requestBody: content: application/json: schema: type: object text/json: schema: type: object application/xml: schema: type: object text/xml: schema: type: object application/x-www-form-urlencoded: schema: type: object required: true /api/v1/RefillOrder/SendEScript: post: tags: - RefillOrder summary: 'Send an eScript token to the dispensing system (Epic 3 — Story 3.3, FR16). Always returns HTTP 200; the response body Code field indicates SUCCESS, FALLBACK_TO_PLUSONE (Angular must call PlusOne JS bridge), or ERROR. Returns 404 when the order does not belong to this pharmacy.' operationId: RefillOrder_SendEScript responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendEScriptResponse' text/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendEScriptResponse' application/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendEScriptResponse' text/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendEScriptResponse' security: - Bearer: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendEScriptRequest' text/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendEScriptRequest' application/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendEScriptRequest' text/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendEScriptRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendEScriptRequest' required: true /api/v1/RefillOrder/LineItem/{orderId}: post: tags: - RefillOrder summary: 'Add a custom line item to a pending order (Story 3.5 — FR13). Returns the full updated order so the caller can refresh its list in one round-trip. Returns 400 when the name is missing; 404 when the order does not belong to this pharmacy.' operationId: RefillOrder_AddLineItem parameters: - name: orderId in: path required: true schema: type: integer format: int32 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.PendingOrderModel' text/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.PendingOrderModel' application/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.PendingOrderModel' text/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.PendingOrderModel' security: - Bearer: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.AddLineItemRequest' text/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.AddLineItemRequest' application/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.AddLineItemRequest' text/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.AddLineItemRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.AddLineItemRequest' required: true /api/v1/RefillOrder/UpdateLineItemStatus: post: tags: - RefillOrder summary: 'Update the status of a line item (Epic 3 — Story 3.1, FR6–FR9). Returns 404 when the order or component does not belong to this pharmacy. Returns 400 when action = OnOrder but followUpDate is absent.' operationId: RefillOrder_UpdateLineItemStatus responses: '204': description: No Content security: - Bearer: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.UpdateLineItemStatusRequest' text/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.UpdateLineItemStatusRequest' application/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.UpdateLineItemStatusRequest' text/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.UpdateLineItemStatusRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.UpdateLineItemStatusRequest' required: true /api/v1/RefillOrder/CompletedOrder/{orderId}/Refund: post: tags: - RefillOrder summary: 'Refund the PIA charge for a completed order (Epic 6 — Story 6.4, CRO-5). Returns 404 when the order does not exist or does not belong to this pharmacy. Returns 400 with an error message when the refund is rejected (gateway failure, disbursed, already refunded, delay window, etc.).' operationId: RefillOrder_RefundOrder parameters: - name: orderId in: path required: true schema: type: integer format: int32 responses: '204': description: No Content security: - Bearer: [] /api/v1/RefillOrder/CompletedOrder/{orderId}/Reminder: post: tags: - RefillOrder summary: 'Send a reminder message to a patient for a completed order (Epic 6 — Story 6.2, CRO-2). Returns 404 when the order does not exist or does not belong to this pharmacy. Returns 400 when the message body is missing or empty.' operationId: RefillOrder_SendReminder parameters: - name: orderId in: path required: true schema: type: integer format: int32 responses: '204': description: No Content security: - Bearer: [] requestBody: content: application/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendReminderRequest' text/json: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendReminderRequest' application/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendReminderRequest' text/xml: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendReminderRequest' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendReminderRequest' required: true /api/v1/RefillOrder/CompletedOrder/{orderId}/ReturnToStock: post: tags: - RefillOrder summary: 'Return all items for a completed order to stock (Epic 6 — Story 6.3, CRO-3). Returns 404 when the order does not exist or does not belong to this pharmacy.' operationId: RefillOrder_ReturnToStock parameters: - name: orderId in: path required: true schema: type: integer format: int32 responses: '204': description: No Content security: - Bearer: [] /api/v1/RefillOrder/LineItem/{orderId}/{lineItemId}: delete: tags: - RefillOrder summary: 'Delete a custom line item from a pending order (Story 3.5 — FR14). Returns 404 when the order, item, or pharmacy context is not found, or the item is not a custom item (only custom items may be deleted via this endpoint).' operationId: RefillOrder_DeleteLineItem parameters: - name: orderId in: path required: true schema: type: integer format: int32 - name: lineItemId in: path required: true schema: type: integer format: int32 responses: '204': description: No Content security: - Bearer: [] components: schemas: MedAdvisor.PharmacyUnifiedAPI.v1.Models.UpdateLineItemStatusRequest: description: 'Request body for POST /RefillOrder/UpdateLineItemStatus (RAP-6 — Story 3.1). Carries the orderId + componentId so the service can verify component ownership before delegating to the BLL.' type: object properties: orderId: format: int32 type: integer componentId: format: int32 type: integer action: format: int32 enum: - 0 - 1 - 2 - 3 type: integer followUpDate: format: date-time description: 'Required when {MedAdvisor.PharmacyUnifiedAPI.v1.Models.UpdateLineItemStatusRequest.Action} is {MedAdvisor.PharmacyUnifiedAPI.v1.Enums.UpdateLineItemAction.OnOrder}. Stored as the estimated stock availability date ("cdatefollowup" BLL parameter).' type: string MedAdvisor.PharmacyUnifiedAPI.v1.Models.PendingOrderLineItemModel: description: 'A single line item within a pending order, with its status pre-resolved server-side. Used by the Angular Pending Order dialog (RAP-6 — Epic 2, Story 2.1).' type: object properties: id: format: int32 type: integer drugLabelName: description: 'Full display name: brand name + form + strength (DrugLabelNameWithStrengthForm from RefillOrderComponentPending). Shown as the primary label for OTC items; secondary label for non-OTC (Story 3.4).' type: string drugActiveName: description: 'Active ingredient name (e.g. "Amoxicillin"). Shown as the primary (bold) label for non-OTC prescription items (Story 3.4, NFR-F1). Null / empty for OTC items.' type: string repeatsRemaining: format: int32 description: 'Remaining repeats on the script. -1 means unknown (no previous dispense found or deferred script).' type: integer lastDispenseDate: format: date-time description: 'Date of the most recent dispense. Null when RepeatsRemaining is -1 (deferred / no prior dispense).' type: string status: format: int32 description: 'Pre-resolved line item status. Mapped from ComponentStatus + ComponentOnOrderStatus + ComponentDeliveryStatus. DUAL MAINTENANCE: mirrors ModelsMapper.Partial.cs:ToPatientRequestStatusModel().' enum: - 0 - 1 - 2 - 3 - 4 - 5 type: integer careePatientId: format: int32 description: 'Patient ID of the caree when this line item was added by a carer on behalf of someone else. Null when the line item belongs to the order owner. Required by Story 5.3 for the "For:" navigation link.' type: integer careeName: description: Display name of the caree patient. Null when CareePatientId is null. type: string price: format: double type: number gst: format: double type: number isOtc: description: Over-the-counter item (no script required — FR11). type: boolean isStructuredOtc: description: Structured OTC item (FR12). type: boolean isNdss: description: National Diabetes Services Scheme item (FR10). type: boolean isCustomItem: description: Custom line item added by a pharmacist (FR13/FR14). type: boolean isDeferred: description: Deferred script awaiting dispensing. type: boolean quantityOrdered: format: int32 description: 'Number of units ordered. Shown as "Quantity ordered: N" for OTC items (FR11/FR12).' type: integer schedule: description: Drug schedule (e.g. "S3", "S8"). An "S3" value shows the S3 badge on OTC items. type: string ndssCode: description: NDSS code shown in blue beneath the drug name when IsNdss is true (FR10). type: string userNdss: description: Patient's NDSS number shown in red when IsNdss is true (FR10). type: string packetSize: format: int32 description: 'Packet size in units for Structured OTC items (FR12). Used when PacketSizeSupplemental is null/empty.' type: integer packetSizeSupplemental: description: Supplemental packet size descriptor (overrides PacketSize when non-empty). type: string drugSystemCode: description: 'Internal drug system code. Callers can test for RefillOrderComponentPending.RefillOrderDeliveryCostSystemCode to identify the delivery cost line.' type: string hasEScript: description: True when this line item has at least one associated eScript token. type: boolean eScriptTokens: description: 'eScript tokens associated with this line item, sorted by prescription date descending (matches MVC PendingOrder.cshtml ordering). Empty list when HasEScript is false.' type: array items: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.EScriptTokenSummaryModel' scriptPhotoUrl: type: string scriptPhotoThumbnailUrl: type: string MedAdvisor.PharmacyUnifiedAPI.v1.Models.PendingOrderModel: description: 'Order payload returned by GET /api/v1/RefillOrder/PendingOrder/{orderId} and GET /api/v1/RefillOrder/CompletedOrder/{orderId}. Used by the Angular Pending Order and Completed Order dialogs (RAP-6).' type: object properties: id: format: int32 type: integer patientId: format: int32 description: 'MedAdvisor user ID of the order owner. Null for guest orders (no registered patient profile). Required by FR37 (patient header navigation) and FR38 (caree navigation).' type: integer patientName: description: 'Full formatted name: title + first name + last name.' type: string orderStatus: description: Order-level status (Pending, Ready, PartiallyReady, etc.). type: string createDate: format: date-time type: string phone: description: 'Patient''s mobile number. Populated for both guest and registered-patient orders. Only used by the Completed Order dialog (Story 6.1); null when not available.' type: string isGuestOrder: type: boolean guestEmail: description: Email on file for the guest. Null for registered-patient orders. type: string guestMobile: description: Mobile number for the guest. Null for registered-patient orders. type: string isSmsGuestCommunicationPreference: description: Guest prefers to be contacted by SMS. type: boolean isEmailGuestCommunicationPreference: description: Guest prefers to be contacted by email. type: boolean isDelivery: description: Order includes a delivery request. type: boolean hasEScript: description: At least one line item has an associated eScript token. type: boolean isPayInAdvance: description: Order is flagged for Pay-in-Advance. type: boolean isAsl: description: Order was placed via ASL (ePrescribing). type: boolean supportGst: type: boolean pharmacyNotes: type: string piaChargeAmount: format: double description: 'Amount of the PIA charge. Null when no charge was attempted. Source: RefillOrderPaymentStatus.TotalCost.' type: number piaChargeStatus: description: '"Success" when the charge was captured (Status==1) or refunded (Status==3). "Failed" when the charge was attempted but did not succeed. Null when IsPayInAdvance is false or no charge record exists.' type: string isRefunded: description: 'True when the PIA charge has been refunded or is no longer refundable (disbursed, awaiting disbursement, or a previous refund attempt failed). When true the Refund button is hidden even if PiaChargeStatus is "Success".' type: boolean piaCardAccount: description: Masked card number e.g. "403587XXXXXX4977". Null when not captured. type: string piaCaptureDate: format: date-time description: UTC date/time the charge was captured. Null when not captured. type: string piaCardType: description: '"Visa", "Mastercard", "American Express", or empty. Null when no charge.' type: string deliveryRecipientName: description: Delivery recipient name. type: string deliveryAddress: description: Formatted delivery address (read-only — FullAddressWithCommas). type: string deliveryPhone: type: string deliveryNotes: type: string deliveryAgentId: format: int32 description: 'Currently assigned delivery agent enum value. PharmacyDriver=1, Kings=2, AusPost=4. Null when not yet assigned.' type: integer deliveryCompleted: description: True when the delivery has been marked as completed (FR20). type: boolean availableDeliveryAgents: description: Delivery agents available for this pharmacy (FR19). type: array items: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.DeliveryAgentOptionModel' totalPrice: format: double description: 'Sum of every component price including the Delivery-Cost line — this matches the MVC PendingOrder.cshtml displayed total (NFR-F1 fidelity). Required by Story 4.2 — pricing must not require a separate API call.' type: number totalGst: format: double description: Sum of every component's GST including the Delivery-Cost line (see TotalPrice). type: number lineItems: type: array items: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.PendingOrderLineItemModel' isDeleted: description: 'True when the order was soft-deleted (dismissed by the pharmacist). Only meaningful in the completed order context — pending orders are never deleted. When true the completed order dialog shows a "Dismissed" banner and hides action buttons.' type: boolean MedAdvisor.PharmacyUnifiedAPI.v1.Models.AddLineItemRequest: description: Request body for POST /RefillOrder/LineItem/{orderId} (RAP-6 — Story 3.5, FR13). type: object properties: name: description: Custom item display name (max 50 chars, matching MVC input maxlength). type: string quantity: format: int32 description: Quantity to dispense. Defaults to 1 when absent or zero. type: integer MedAdvisor.PharmacyUnifiedAPI.v1.Models.LineItemPriceEntry: description: Per-component price entered by the pharmacist at PIA order completion. type: object properties: componentId: format: int32 type: integer price: format: double description: 'Total price entered by the pharmacist. When GstApplies=true this is the GST-inclusive amount; GST = Round(Price/11, 2), Net = Price - GST. Matches MVC behaviour.' type: number gstApplies: description: True when the item is subject to GST. type: boolean MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendReminderRequest: description: Request body for POST /api/v1/RefillOrder/CompletedOrder/{orderId}/Reminder (Epic 6 — Story 6.2). type: object properties: message: type: string MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendEScriptRequest: description: Request body for POST /RefillOrder/SendEScript (RAP-6 — Story 3.3, FR16). type: object properties: orderId: format: int32 type: integer token: type: string MedAdvisor.PharmacyUnifiedAPI.v1.Models.AddNoteRequest: description: Request body for POST /RefillOrder/AddNote (Epic 5 — Story 5.1, FR24). type: object properties: orderId: format: int32 type: integer note: description: Note text. Pass null or empty string to clear the existing note. Max 250 chars. type: string MedAdvisor.PharmacyUnifiedAPI.v1.Models.UpdateDeliveryRequest: description: 'Request body for PUT /RefillOrder/Delivery/{orderId} (Story 4.1 — FR18, FR19, FR20). All fields are optional — only non-null values are applied.' type: object properties: recipientName: description: Recipient name (FR18). type: string phone: description: Recipient phone number (FR18). type: string notes: description: Delivery notes for the courier (FR18). type: string deliveryAgent: format: int32 description: 'Delivery agent integer value (FR19). PharmacyDriver=1, Kings=2, AusPost=4.' type: integer markAsCompleted: description: 'When true, marks the delivery as completed (FR20). When false, clears the completed date. Null leaves the current status unchanged.' type: boolean MedAdvisor.PharmacyUnifiedAPI.v1.Models.SendEScriptResponse: description: "Response from POST /RefillOrder/SendEScript (RAP-6 — Story 3.3, FR16).\n \nAlways returned as HTTP 200 so Angular can distinguish the three outcomes without\nintercepting HTTP errors:\n SUCCESS — token sent to MedView Flow successfully.\n FALLBACK_TO_PLUSONE — pharmacy has no MedView Flow ID; Angular must call the\n PlusOne JS bridge (uicontroller.SendEScriptTokenToDispense).\n ERROR — MedView Flow returned an error; Message contains detail." type: object properties: success: type: boolean code: description: 'One of: "SUCCESS", "FALLBACK_TO_PLUSONE", "ERROR".' type: string message: type: string MedAdvisor.PharmacyUnifiedAPI.v1.Models.CompleteOrderRequest: description: Request body for POST /RefillOrder/Complete (RAP-6 — Story 2.5b FR27, Story 4.3 FR22). type: object properties: orderId: format: int32 type: integer message: description: 'Patient-facing notification message (maps to the "omessage:" BLL parameter). Pre-filled with a context-aware default on the Angular side; editable before submission.' type: string chargeCard: description: 'True to charge the patient''s saved card (PIA orders only). False = finalise without charging (maps to DeclinePayment intent on the order). Ignored for non-PIA orders.' type: boolean lineItemPrices: description: Per-line-item prices entered by the pharmacist. PIA orders only; null/empty for others. type: array items: $ref: '#/components/schemas/MedAdvisor.PharmacyUnifiedAPI.v1.Models.LineItemPriceEntry' MedAdvisor.PharmacyUnifiedAPI.v1.Models.DeliveryAgentOptionModel: description: A shipping agent option shown in the delivery section dropdown (Story 4.1 — FR19). type: object properties: value: format: int32 description: Integer value of the DeliveryAgent enum (PharmacyDriver=1, Kings=2, AusPost=4). type: integer label: type: string MedAdvisor.PharmacyUnifiedAPI.v1.Models.EScriptTokenSummaryModel: description: 'Summary of a single eScript token embedded in the pending order line item response (FR4). Provides enough information to display the token list without a separate detail round-trip. Full detail is returned by GET /RefillOrder/EScriptToken/{orderId}/{tokenId} (FR15).' type: object properties: token: description: The token identifier string — used as the key for GET /EScriptToken. type: string prescriptionDate: format: date-time type: string repeatsRemainingDisplay: format: int32 description: 'EScriptDto.RepeatsRemaining + 1, matching the MVC PendingOrder.cshtml display (the raw BLL value is one less than the pharmacist-visible count).' type: integer isExpired: description: 'True when PrescriptionDate + 12 months < today. Note: S8 drugs expire after 6 months in the MVC — deferred to Story 5.4 walkthrough because RefillOrderComponentPending.Schedule is not currently surfaced here.' type: boolean isSelected: description: True when this token is the currently selected EScriptInComponent for the line item. type: boolean MedAdvisor.PharmacyUnifiedAPI.v1.Models.EScriptTokenDetailModel: description: 'Full eScript token detail returned by GET /RefillOrder/EScriptToken/{orderId}/{tokenId} (FR15). Maps from EScriptDto in MedAdvisor.Framework.Interface.' type: object properties: token: type: string drugLabelName: type: string drugActiveName: type: string drugForm: type: string drugStrength: type: string prescriptionDate: format: date-time type: string repeatsRemainingDisplay: format: int32 description: EScriptDto.RepeatsRemaining + 1 (see EScriptTokenSummaryModel.RepeatsRemainingDisplay). type: integer totalRepeats: format: int32 type: integer quantity: format: int32 type: integer instructions: type: string isExpired: type: boolean source: description: String form of EScriptSource enum (e.g. "Pds", "Asl"). type: string isUnknownDrugEScript: type: boolean patientFullName: type: string patientFirstName: type: string patientLastName: type: string qrCodeForToken: description: 'Base64-encoded PNG of the token QR code, or null if unavailable. Render as: <img src="data:image/png;base64,{QrCodeForToken}">' type: string securitySchemes: Bearer: type: apiKey description: 'JWT Authorization header using the Bearer scheme. Example: "Authorization: Bearer {token}"' name: Authorization in: header