> ## 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.

# Create Trip

> Create a new trip (stored as a delivery row).



## OpenAPI

````yaml /api/openapi-cutmake.json post /logistics/trips
openapi: 3.1.0
info:
  title: VM App API
  version: 0.1.0
servers:
  - url: https://vinmake-erp.onrender.com
security: []
paths:
  /logistics/trips:
    post:
      tags:
        - Logistics
      summary: Create Trip
      description: Create a new trip (stored as a delivery row).
      operationId: create_trip_logistics_trips_post
      parameters:
        - name: X-Org-Id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Org-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TripCreate'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TripResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    TripCreate:
      properties:
        direction:
          type: string
          title: Direction
        mode:
          anyOf:
            - type: string
            - type: 'null'
          title: Mode
          default: road
        driver:
          anyOf:
            - type: string
            - type: 'null'
          title: Driver
        vehicle:
          anyOf:
            - type: string
            - type: 'null'
          title: Vehicle
        ref:
          anyOf:
            - type: string
            - type: 'null'
          title: Ref
        eta:
          anyOf:
            - type: string
            - type: 'null'
          title: Eta
        incoterm:
          anyOf:
            - type: string
            - type: 'null'
          title: Incoterm
        shipmentIds:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Shipmentids
          default: []
        stops:
          anyOf:
            - items:
                $ref: '#/components/schemas/TripStopCreate'
              type: array
            - type: 'null'
          title: Stops
          default: []
      type: object
      required:
        - direction
      title: TripCreate
    TripResponse:
      properties:
        id:
          type: string
          title: Id
        documentId:
          type: string
          title: Documentid
        direction:
          type: string
          title: Direction
        mode:
          type: string
          title: Mode
        status:
          type: string
          title: Status
        driver:
          type: string
          title: Driver
        vehicle:
          type: string
          title: Vehicle
        refLabel:
          type: string
          title: Reflabel
        ref:
          type: string
          title: Ref
        eta:
          anyOf:
            - type: string
            - type: 'null'
          title: Eta
        progress:
          type: string
          title: Progress
        stops:
          items:
            $ref: '#/components/schemas/TripStopResponse'
          type: array
          title: Stops
          default: []
        shipmentDocumentIds:
          items:
            type: string
          type: array
          title: Shipmentdocumentids
          default: []
        incoterm:
          anyOf:
            - type: string
            - type: 'null'
          title: Incoterm
        createdAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Createdat
      type: object
      required:
        - id
        - documentId
        - direction
        - mode
        - status
        - driver
        - vehicle
        - refLabel
        - ref
        - progress
      title: TripResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TripStopCreate:
      properties:
        name:
          type: string
          title: Name
        subLabel:
          anyOf:
            - type: string
            - type: 'null'
          title: Sublabel
        stopType:
          anyOf:
            - type: string
            - type: 'null'
          title: Stoptype
          default: waypoint
      type: object
      required:
        - name
      title: TripStopCreate
    TripStopResponse:
      properties:
        id:
          type: string
          title: Id
        stopOrder:
          type: integer
          title: Stoporder
        name:
          type: string
          title: Name
        subLabel:
          anyOf:
            - type: string
            - type: 'null'
          title: Sublabel
        state:
          type: string
          title: State
        plannedAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Plannedat
        actualAt:
          anyOf:
            - type: string
            - type: 'null'
          title: Actualat
      type: object
      required:
        - id
        - stopOrder
        - name
        - state
      title: TripStopResponse
    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
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /auth/login

````