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

# Create Load

> This endpoint allows users to create a new load in the Datatruck Transportation Management System (TMS).



## OpenAPI

````yaml POST /orders/create/
openapi: 3.0.1
info:
  title: OpenAPI Datatruck
  description: >-
    To be able to use Datatruck OpenAPI you should create tokens from your
    dashboard. Go to your dashboard and create token with appropriate scopes and
    expiration. Expiration and scopes are optional as well as description for
    your token, but remember name is required.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://{company}.datatruck.io/api/v1/openapi/
security: []
paths:
  /orders/create/:
    post:
      description: >-
        This endpoint allows users to create a new load in the Datatruck
        Transportation Management System (TMS).
      requestBody:
        description: Request Body
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewLoad'
            example:
              load_id: LD-987654
              load_pay: '5000.00'
              customer: ABC Logistics
              mc_number: Armitage
              weight: 2000kg
              goods: Furniture
              rate_confirmation: base64_encoded_string
              stops:
                - company_name: Pickup Company
                  address: 123 Pickup Street
                  zip_code: '10001'
                  enter_time: '2025-02-06T08:30:00Z'
                  exit_time: '2025-02-06T09:30:00Z'
                  reference_id: REF-001
                  stop_type: pickup
                - company_name: Delivery Company
                  address: 456 Delivery Avenue
                  zip_code: '20002'
                  enter_time: '2025-02-07T14:00:00Z'
                  exit_time: '2025-02-07T15:00:00Z'
                  reference_id: REF-002
                  stop_type: delivery
        required: true
      responses:
        '201':
          description: Successful order creation response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateOrderResponse'
        '400':
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    NewLoad:
      type: object
      required:
        - customer
        - mc_number
      properties:
        load_id:
          type: string
          nullable: true
          example: LD-987654
          description: Unique identifier for the load
        load_pay:
          type: string
          format: decimal
          nullable: true
          example: '5000.00'
          description: Payment amount for the load
        customer:
          type: string
          nullable: true
          example: ABC Logistics
          description: Customer associated with the load
        mc_number:
          type: string
          example: Armitage
          description: Motor Carrier number for the shipment
        weight:
          type: string
          nullable: true
          example: 2000kg
          description: Weight of the goods being transported
        goods:
          type: string
          nullable: true
          example: Furniture
          description: Type of goods being transported
        rate_confirmation:
          type: string
          nullable: true
          example: base64_encoded_string
          description: >-
            Rate confirmation document in base64 format or use global url of the
            file)
        stops:
          type: array
          nullable: true
          description: List of stops along the route
          items:
            $ref: '#/components/schemas/Stop'
    CreateOrderResponse:
      type: object
      required:
        - id
        - shipment_id
        - customer
        - status
        - mc_number
        - load_id
        - references_id
        - load_pay
        - total_miles
        - tags
      properties:
        id:
          type: integer
          example: 12345
          description: Unique order ID
        shipment_id:
          type: string
          example: SHIP-987654
          description: Shipment identifier
        customer:
          type: string
          example: ABC Logistics
          description: Customer associated with the shipment
        status:
          type: string
          example: In Progress
          description: Current status of the load
        mc_number:
          type: string
          example: Armitage
          description: Motor Carrier number for the shipment
        load_id:
          type: string
          example: LD-987654
          description: Unique identifier for the load
        references_id:
          type: string
          example: REF-123456
          description: Reference ID for the load
        load_pay:
          type: string
          format: decimal
          example: '5000.00'
          description: Total payment amount for the load
        total_miles:
          type: string
          format: decimal
          example: '1500.75'
          description: Total miles covered for the load
        per_mile_revenue:
          type: string
          format: decimal
          nullable: true
          example: '3.25'
          description: Revenue per mile (optional)
        special_instruction:
          type: string
          nullable: true
          example: Handle with care
          description: Any special instructions for the load
        tags:
          type: array
          description: List of tags associated with the order
          items:
            $ref: '#/components/schemas/Tag'
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          format: int32
        message:
          type: string
    Stop:
      type: object
      required:
        - enter_time
        - exit_time
      properties:
        company_name:
          type: string
          nullable: true
          example: Test Company
          description: Name of the company at the stop location
        address:
          type: string
          nullable: true
          example: 123 Street
          description: Address of the stop location
        zip_code:
          type: string
          nullable: true
          example: '10001'
          description: ZIP code of the stop location
        enter_time:
          type: string
          format: date-time
          example: '2025-02-06T08:30:00Z'
          description: Time when the truck enters the stop location
        exit_time:
          type: string
          format: date-time
          example: '2025-02-06T09:30:00Z'
          description: Time when the truck exits the stop location
        reference_id:
          type: string
          nullable: true
          example: REF-001
          description: Reference ID for the stop
        stop_type:
          type: string
          nullable: true
          example: pickup
          description: Type of stop (pickup or delivery)
    Tag:
      type: object
      properties:
        name:
          type: string
          example: Urgent
          description: Tag name associated with the order

````