> ## Documentation Index
> Fetch the complete documentation index at: https://developer.eka.care/llms.txt
> Use this file to discover all available pages before exploring further.

# Dispatch Dawakhana Order

> 
### Overview

This API **dispatches** a pending Dawakhana order of your workspace: for each order line, send the quantity actually given (`fulfilledQty`) and the price per unit (`rate`). Only an order in status `CREATED` can be dispatched.

For each line sent, `amount` is `fulfilledQty × rate` and the line status becomes `FULFILLED` (full quantity), `PARTIAL` (less than ordered) or `UNAVAILABLE` (`fulfilledQty` of `0`). Lines are matched by their `id` from [Get Dawakhana Order](/api-reference/doc-tool/ipd-api/dawakhana/get-dawakhana-order); lines that are not sent stay `PENDING`.

The order moves to `DISPATCHED`, with `billedTotal` set to the sum of line amounts and `fulfilmentType` set to `FULL` only when every line is `FULFILLED` (otherwise `PARTIAL`). The fulfilled medicines are **added to the admission's bill**. The user making the request is recorded in `dispatchedBy`, `dispatchedByName` and `dispatchedAt`.



## OpenAPI

````yaml post /ipd/v1/service/dawakhana/orders/{order_id}/dispatch
openapi: 3.0.0
info:
  title: Ekacare API & Webhook Documentation
  contact: {}
  version: '1.0'
servers:
  - description: Production
    url: https://api.eka.care
  - description: Stage/Sandbox
    url: https://api.dev.eka.care
security: []
paths:
  /ipd/v1/service/dawakhana/orders/{order_id}/dispatch:
    post:
      tags:
        - IPD API
      summary: Dispatch Dawakhana Order
      description: >-

        ### Overview


        This API **dispatches** a pending Dawakhana order of your workspace: for
        each order line, send the quantity actually given (`fulfilledQty`) and
        the price per unit (`rate`). Only an order in status `CREATED` can be
        dispatched.


        For each line sent, `amount` is `fulfilledQty × rate` and the line
        status becomes `FULFILLED` (full quantity), `PARTIAL` (less than
        ordered) or `UNAVAILABLE` (`fulfilledQty` of `0`). Lines are matched by
        their `id` from [Get Dawakhana
        Order](/api-reference/doc-tool/ipd-api/dawakhana/get-dawakhana-order);
        lines that are not sent stay `PENDING`.


        The order moves to `DISPATCHED`, with `billedTotal` set to the sum of
        line amounts and `fulfilmentType` set to `FULL` only when every line is
        `FULFILLED` (otherwise `PARTIAL`). The fulfilled medicines are **added
        to the admission's bill**. The user making the request is recorded in
        `dispatchedBy`, `dispatchedByName` and `dispatchedAt`.
      operationId: DispatchIpdDawakhanaOrder
      parameters:
        - name: auth
          in: header
          required: true
          schema:
            type: string
          example: >-
            eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJiX2lkIjoiMTIzNDU2IiwiY2xpZW50X2lkIjoiNzg5MCIsImV4dHJhX2ZpZWxkIjoiZXh0cmFfZmllbGRfZGF0YSJ9.q9KzBI6f4l3OyM_EkB5Quq0l9EEMFh5JS-fx3F_PHUM
        - name: order_id
          in: path
          description: Id of the Dawakhana order to dispatch.
          required: true
          style: simple
          schema:
            type: string
          example: 66f1cd07e4b0a1b2c3d4ef0a
      requestBody:
        description: The fulfilled quantity and rate per line.
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              required:
                - lines
              properties:
                lines:
                  type: array
                  description: One entry per order line being dispatched.
                  items:
                    type: object
                    additionalProperties: false
                    required:
                      - itemId
                      - fulfilledQty
                      - rate
                    properties:
                      itemId:
                        type: string
                        description: Id of the order line.
                      fulfilledQty:
                        type: number
                        description: Quantity given. `0` marks the line unavailable.
                      rate:
                        type: number
                        description: Price per unit.
                note:
                  type: string
                  description: Optional dispatch note.
            example:
              lines:
                - itemId: 66f1cd07e4b0a1b2c3d4ef0b
                  fulfilledQty: 10
                  rate: 4.5
              note: Handed over at nursing station
      responses:
        '200':
          description: OK — the dispatched order with its lines.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IpdDawakhanaOrderResponse'
              example:
                success: true
                data:
                  id: 66f1cd07e4b0a1b2c3d4ef0a
                  admissionId: a1b2c3d4-5678-90ab-cdef-1234567890ab
                  kind: order
                  orderNumber: DW-7Q2K9F3M
                  status: DISPATCHED
                  createdBy: '161467756044203'
                  isCollected: false
                  provider: dawakhana
                  billedTotal: 45
                  fulfilmentType: FULL
                  dispatchNote: Handed over at nursing station
                  dispatchedBy: '161467756044204'
                  dispatchedByName: Meena Iyer
                  dispatchedAt: '2026-10-07T12:40:00.000Z'
                  createdAt: '2026-10-07T12:10:00.000Z'
                  updatedAt: '2026-10-07T12:40:00.000Z'
                  lines:
                    - id: 66f1cd07e4b0a1b2c3d4ef0b
                      medicineId: med-paracetamol-500
                      name: Paracetamol 500mg Tablet
                      orderedQty: 10
                      fulfilledQty: 10
                      rate: 4.5
                      amount: 45
                      lineStatus: FULFILLED
        '400':
          description: >-
            Bad Request. Returns `{ success: false, error }` when the order is
            not in status `CREATED` or the `order_id` is not a valid id, or `{
            message }` when the request body failed schema validation (the
            `message` is currently empty).
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/IpdServiceFailure'
                  - $ref: '#/components/schemas/IpdServiceError'
              example:
                success: false
                error: Only a pending order can be dispatched
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IpdServiceError'
        '404':
          description: Not Found — the order was not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IpdServiceFailure'
              example:
                success: false
                error: Order not found
      deprecated: false
components:
  schemas:
    IpdDawakhanaOrderResponse:
      title: IpdDawakhanaOrderResponse
      type: object
      properties:
        success:
          type: boolean
        data:
          $ref: '#/components/schemas/IpdDawakhanaOrder'
    IpdServiceFailure:
      title: IpdServiceFailure
      type: object
      properties:
        success:
          type: boolean
          description: Always `false`.
        error:
          type: string
          description: Human-readable error message.
    IpdServiceError:
      title: IpdServiceError
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message.
    IpdDawakhanaOrder:
      title: IpdDawakhanaOrder
      allOf:
        - $ref: '#/components/schemas/IpdOrder'
        - type: object
          properties:
            lines:
              type: array
              description: The order lines.
              items:
                $ref: '#/components/schemas/IpdDawakhanaLine'
    IpdOrder:
      title: IpdOrder
      type: object
      properties:
        id:
          type: string
          description: Order id.
        admissionId:
          type: string
          description: Id of the IPD admission the order is for.
        kind:
          type: string
          enum:
            - order
            - return
          description: '`order`, or `return` for a return order placed against an order.'
        parentOrderId:
          type: string
          description: For a return order, the id of the order it was placed against.
        externalReturnId:
          type: string
          description: For an eVital return order, eVital's return id.
        orderNumber:
          type: string
          description: >-
            Display order number (Dawakhana's own number, or eVital's order
            number).
        ipdId:
          type: string
          description: Patient IPD case number.
        status:
          type: string
          enum:
            - CREATED
            - DISPATCHED
            - CANCELLED
            - RETURNED
            - PARTIALLY_RETURNED
          description: Order status.
        createdBy:
          type: string
          description: Id of the user who placed the order.
        createdByName:
          type: string
          description: Name of the user who placed the order.
        rxId:
          type: string
          description: Id of the prescription the order is based on.
        isCollected:
          type: boolean
          description: '`true` when the patient has collected the medicines.'
        collectedBy:
          type: string
          description: Id of the user who marked the order collected.
        collectedByName:
          type: string
          description: Name of the user who marked the order collected.
        collectedAt:
          type: string
          description: Date-time the order was marked collected, as an ISO-8601 string.
        provider:
          type: string
          enum:
            - evital
            - dawakhana
          description: Pharmacy provider fulfilling the order.
        pharmacyId:
          type: string
          description: Id of the fulfilling pharmacy.
        patientName:
          type: string
          description: Name of the patient.
        mobile:
          type: string
          description: Mobile number of the patient.
        patientId:
          type: string
          description: Id of the patient.
        doctorName:
          type: string
          description: Name of the prescribing doctor.
        deliveryType:
          type: string
          enum:
            - pickup
            - delivery
          description: How the medicines reach the patient.
        rxPdfUrl:
          type: string
          description: URL of the prescription PDF.
        notes:
          type: string
          description: Order-level remarks.
        billedTotal:
          type: number
          description: Amount billed for the order, set when it is dispatched.
        fulfilmentType:
          type: string
          enum:
            - FULL
            - PARTIAL
          description: Whether the dispatched order was fulfilled fully or partially.
        dispatchNote:
          type: string
          description: Note added when the order was dispatched.
        dispatchedBy:
          type: string
          description: Id of the user who dispatched the order.
        dispatchedByName:
          type: string
          description: Name of the user who dispatched the order.
        dispatchedAt:
          type: string
          description: Date-time the order was dispatched, as an ISO-8601 string.
        cancelledBy:
          type: string
          description: Id of the user who cancelled the order.
        cancelledByName:
          type: string
          description: Name of the user who cancelled the order.
        cancelledAt:
          type: string
          description: Date-time the order was cancelled, as an ISO-8601 string.
        cancelReason:
          type: string
          description: Reason the order was cancelled.
        returnedBy:
          type: string
          description: Id of the user who returned the order.
        returnedByName:
          type: string
          description: Name of the user who returned the order.
        returnedAt:
          type: string
          description: Date-time the order was returned, as an ISO-8601 string.
        returnReason:
          type: string
          description: Reason the order was returned.
        returnedTotal:
          type: number
          description: Total amount returned against the order.
        createdAt:
          type: string
          description: Created date-time as an ISO-8601 string.
        updatedAt:
          type: string
          description: Last-updated date-time as an ISO-8601 string.
    IpdDawakhanaLine:
      title: IpdDawakhanaLine
      type: object
      properties:
        id:
          type: string
          description: Order line id. Use it as `itemId` when dispatching or returning.
        medicineId:
          type: string
          description: Id of the medicine.
        name:
          type: string
          description: Name of the medicine.
        genericName:
          type: string
          description: Generic (molecule) name of the medicine.
        orderedQty:
          type: number
          description: Quantity ordered.
        directions:
          type: string
          description: Dosage directions.
        fulfilledQty:
          type: number
          description: Quantity given, set at dispatch.
        rate:
          type: number
          description: Price per unit, set at dispatch.
        amount:
          type: number
          description: Line total (`fulfilledQty × rate`), set at dispatch.
        returnedQty:
          type: number
          description: Total quantity returned against this line.
        lineStatus:
          type: string
          enum:
            - PENDING
            - FULFILLED
            - PARTIAL
            - UNAVAILABLE
            - SUBSTITUTED
            - RETURNED
          description: Status of the line.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.