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

# Create shipment with tracking

> Create a new shipment for received package with auto-generated tracking number and barcode



## OpenAPI

````yaml docs/api-reference/marketplace-monitoring.yaml post /shipments/new
openapi: 3.0.3
info:
  title: Zochil Marketplace Monitoring API
  description: >
    Zochil platform marketplace monitoring API for marketplace administration.


    ## Authentication


    All endpoints require authentication via the `access-token` header obtained
    through login.

    Some endpoints may also require `merchant-id` header for merchant-specific
    operations.
  version: 1.0.0
  contact:
    name: Zochil Support
    email: info@zochil.mn
  license:
    name: Proprietary
servers:
  - url: https://api.zochil.io/v3/monitoring
    description: API server
security:
  - AccessToken: []
tags:
  - name: Authentication
    description: Marketplace admin authentication
  - name: Marketplace Admins
    description: Marketplace administrator management
  - name: Marketplaces
    description: Marketplace management and configuration
  - name: Categories
    description: Product category management
  - name: Products
    description: Product catalog management
  - name: Orders
    description: Order processing and management
  - name: Merchants
    description: Merchant account management
  - name: Users
    description: User account management
  - name: Banners
    description: Marketing banner management
  - name: Campaigns
    description: Marketing campaign management
  - name: Subscriptions
    description: Marketplace subscription management
  - name: Menu Categories
    description: Main menu category management
  - name: Notifications
    description: Notification management
  - name: Shipments
    description: Shipment and logistics management
  - name: Shipment Invoices
    description: Shipment invoice management
  - name: Preorder Admin Users
    description: Preorder admin user management with PIN authentication
  - name: Reporting
    description: Reporting and analytics
  - name: Profile
    description: Admin profile management
paths:
  /shipments/new:
    post:
      tags:
        - Shipments
      summary: Create shipment with tracking
      description: >-
        Create a new shipment for received package with auto-generated tracking
        number and barcode
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - product_id
                - order_id
                - merchant_id
                - package_weight
              properties:
                product_id:
                  type: integer
                  description: The product ID from the order
                order_id:
                  type: integer
                  description: The order ID to create shipment for
                merchant_id:
                  type: integer
                  description: The merchant ID
                package_weight:
                  type: number
                  minimum: 0
                  description: Package weight in kg
            example:
              product_id: 1
              order_id: 123
              merchant_id: 456
              package_weight: 1.5
      responses:
        '201':
          description: Shipment created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      shipment_id:
                        type: integer
                        description: Created shipment ID
                      tracking_number:
                        type: string
                        description: Auto-generated tracking number
                      barcode:
                        type: string
                        description: Auto-generated barcode
                      order_code:
                        type: string
                        description: Associated order code
        '400':
          description: Invalid request or business rule violation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Order or product not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    AccessToken:
      type: apiKey
      in: header
      name: access-token

````