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

# Dispatch Delivery Note

> Dispatch a delivery note: deduct the linked outbound shipment's lines
from stock (FEFO across available lots) via the shared movement writer.

The delivery note itself carries no stock references, so the linked
shipment's line items (org-scoped, with item ids + qty + uom) are the
source of truth for what leaves the warehouse. All-or-nothing: any
shortfall aborts the dispatch with a per-line breakdown.



## OpenAPI

````yaml /api/openapi-cutmake.json post /delivery-notes/{note_id}/dispatch
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /delivery-notes/{note_id}/dispatch:
    post:
      tags:
        - Delivery Notes
      summary: Dispatch Delivery Note
      description: |-
        Dispatch a delivery note: deduct the linked outbound shipment's lines
        from stock (FEFO across available lots) via the shared movement writer.

        The delivery note itself carries no stock references, so the linked
        shipment's line items (org-scoped, with item ids + qty + uom) are the
        source of truth for what leaves the warehouse. All-or-nothing: any
        shortfall aborts the dispatch with a per-line breakdown.
      operationId: dispatch_delivery_note_delivery_notes__note_id__dispatch_post
      parameters:
        - name: note_id
          in: path
          required: true
          schema:
            type: string
            title: Note Id
        - name: X-Org-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Org-Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/DeliveryNoteDispatchPayload'
                - type: 'null'
              title: Payload
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeliveryNoteDispatchResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    DeliveryNoteDispatchPayload:
      properties:
        stockLocationId:
          anyOf:
            - type: string
            - type: 'null'
          title: Stocklocationid
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
      type: object
      title: DeliveryNoteDispatchPayload
    DeliveryNoteDispatchResponse:
      properties:
        note:
          $ref: '#/components/schemas/DeliveryNoteResponse'
        movementGroupId:
          type: string
          title: Movementgroupid
        lines:
          items:
            $ref: '#/components/schemas/DeliveryNoteDispatchLineResult'
          type: array
          title: Lines
      type: object
      required:
        - note
        - movementGroupId
        - lines
      title: DeliveryNoteDispatchResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    DeliveryNoteResponse:
      properties:
        id:
          type: string
          title: Id
        documentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Documentid
        salesOrderId:
          anyOf:
            - type: string
            - type: 'null'
          title: Salesorderid
        clientId:
          anyOf:
            - type: string
            - type: 'null'
          title: Clientid
        clientName:
          anyOf:
            - type: string
            - type: 'null'
          title: Clientname
        dropNumber:
          anyOf:
            - type: integer
            - type: 'null'
          title: Dropnumber
        shippingDate:
          anyOf:
            - type: string
            - type: 'null'
          title: Shippingdate
        actualShipDate:
          anyOf:
            - type: string
            - type: 'null'
          title: Actualshipdate
        carrier:
          anyOf:
            - type: string
            - type: 'null'
          title: Carrier
        trackingNumber:
          anyOf:
            - type: string
            - type: 'null'
          title: Trackingnumber
        destinationAddress:
          anyOf:
            - type: string
            - type: 'null'
          title: Destinationaddress
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
        shipmentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Shipmentid
        deliveryId:
          anyOf:
            - type: string
            - type: 'null'
          title: Deliveryid
        paymentTerms:
          anyOf:
            - type: string
            - type: 'null'
          title: Paymentterms
        paymentDueDate:
          anyOf:
            - type: string
            - type: 'null'
          title: Paymentduedate
        createdAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Createdat
        lineItems:
          anyOf:
            - items:
                $ref: '#/components/schemas/DeliveryNoteLineItem'
              type: array
            - type: 'null'
          title: Lineitems
          default: []
      type: object
      required:
        - id
      title: DeliveryNoteResponse
    DeliveryNoteDispatchLineResult:
      properties:
        shipmentLineItemId:
          type: string
          title: Shipmentlineitemid
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        qtyRequested:
          type: number
          title: Qtyrequested
        qtyDispatched:
          type: number
          title: Qtydispatched
        lots:
          items:
            $ref: '#/components/schemas/DispatchedLotAllocation'
          type: array
          title: Lots
      type: object
      required:
        - shipmentLineItemId
        - qtyRequested
        - qtyDispatched
        - lots
      title: DeliveryNoteDispatchLineResult
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    DeliveryNoteLineItem:
      properties:
        id:
          type: string
          title: Id
        deliveryNoteId:
          anyOf:
            - type: string
            - type: 'null'
          title: Deliverynoteid
        salesOrderLineItemId:
          anyOf:
            - type: string
            - type: 'null'
          title: Salesorderlineitemid
        styleCode:
          anyOf:
            - type: string
            - type: 'null'
          title: Stylecode
        styleName:
          anyOf:
            - type: string
            - type: 'null'
          title: Stylename
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
        size:
          anyOf:
            - type: string
            - type: 'null'
          title: Size
        quantity:
          anyOf:
            - type: integer
            - type: 'null'
          title: Quantity
        unit:
          anyOf:
            - type: string
            - type: 'null'
          title: Unit
        notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Notes
      type: object
      required:
        - id
      title: DeliveryNoteLineItem
    DispatchedLotAllocation:
      properties:
        stockLotId:
          type: string
          title: Stocklotid
        stockLotDocumentId:
          anyOf:
            - type: string
            - type: 'null'
          title: Stocklotdocumentid
        stockLocationId:
          type: string
          title: Stocklocationid
        qty:
          type: number
          title: Qty
        uom:
          anyOf:
            - type: string
            - type: 'null'
          title: Uom
      type: object
      required:
        - stockLotId
        - stockLocationId
        - qty
      title: DispatchedLotAllocation
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /auth/login

````