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

# Create a shipment for an order

> Create a shipment for an order. Requires the WRITE_SHIPPING scope.

Creates a shipment for an order. Provide `rateId` to create an automatic shipment from a previously fetched courier rate, or omit it and supply carrier/tracking details to create a manual shipment. The order must belong to the store bound to the app token, which is updated with a reference to the new shipment. Requires the `WRITE_SHIPPING` scope.


## OpenAPI

````yaml POST /shipping/shipments
openapi: 3.1.0
info:
  title: Salesive Apps API — Shipping & Fulfillment
  version: 1.0.0
  description: >-
    Manage shipping options, live courier rates, shipments and labels, and the
    ShipDay delivery integration from an installed third-party app. Every
    endpoint authenticates with an installed-app access token (prefix `app_`)
    and requires a specific OAuth scope. The target store is bound to the token
    server-side from the installation — never send a shop id.
servers:
  - url: https://api.salesive.com/api/v1
    description: Production
security:
  - AppToken: []
paths:
  /shipping/shipments:
    post:
      tags:
        - Shipping
      summary: Create a shipment for an order
      description: >-
        Creates a shipment for an order. Provide `rateId` to create an automatic
        shipment from a previously fetched courier rate, or omit it and supply
        carrier/tracking details to create a manual shipment. The order must
        belong to the store bound to the app token, which is updated with a
        reference to the new shipment. Requires the `WRITE_SHIPPING` scope.
      operationId: createShipment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                orderId:
                  type: string
                  description: ObjectId of the order to ship.
                shippingAddressId:
                  type: string
                  description: ObjectId of the destination shipping address.
                carrier:
                  type: string
                  description: Carrier name (manual shipments).
                rateId:
                  type: string
                  description: >-
                    Service code or id of a rate from a prior /shipping/rates
                    call (automatic shipments).
                trackingNumber:
                  type: string
                  description: Tracking number (manual shipments).
                trackingUrl:
                  type: string
                  description: Tracking URL (manual shipments).
                shippingMethod:
                  type: string
                  description: Shipping method label.
                shippingCost:
                  type: number
                  description: Shipping cost (minimum 0).
                estimatedDelivery:
                  type: string
                  description: Estimated delivery date (ISO date).
                notes:
                  type: string
                  description: Free-text notes for the shipment.
              required:
                - orderId
                - shippingAddressId
            example:
              orderId: 6640c1b2d4e5f60102030406
              shippingAddressId: 6635d1e2d4e5f60102030407
              carrier: GIG Logistics
              trackingNumber: GIG-998877
              trackingUrl: https://track.giglogistics.com/GIG-998877
              shippingMethod: standard
              shippingCost: 1500
              notes: Leave at front desk
      responses:
        '201':
          description: Create a shipment for an order.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/EnvelopeBase'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Shipment'
              example:
                status: 201
                success: true
                message: Create a shipment for an order
                data:
                  _id: 6651b2c3d4e5f60102030405
                  orders:
                    - 6640c1b2d4e5f60102030406
                  carrier: GIG Logistics
                  courier:
                    id: null
                    name: GIG Logistics
                    image: null
                  shippingAddress: 6635d1e2d4e5f60102030407
                  shippingOption: null
                  metadata: {}
                  trackingNumber: GIG-998877
                  trackingCode: GIG-998877
                  trackingUrl: https://track.giglogistics.com/GIG-998877
                  shippingMethod: standard
                  shippingCost: 1500
                  notes: Leave at front desk
                  status: pending
                  createdAt: '2026-06-28T09:00:00.000Z'
                  updatedAt: '2026-06-28T09:00:00.000Z'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  schemas:
    EnvelopeBase:
      type: object
      description: >-
        Standard Salesive response envelope. The operation-specific payload is
        carried in `data`.
      required:
        - status
        - success
        - message
      properties:
        status:
          type: integer
          description: HTTP status code, echoed in the body.
        success:
          type: boolean
          description: Whether the request succeeded.
        message:
          type: string
          description: Human-readable result message.
    Shipment:
      type: object
      description: >-
        A shipment record. Shapes vary slightly by how the shipment was created
        (manual, automatic label, or ShipDay dispatch); only the most common
        fields are listed and extra properties may be present.
      additionalProperties: true
      properties:
        _id:
          type: string
          description: ObjectId of the shipment.
        orders:
          type: array
          items:
            type: string
          description: Order ObjectIds attached to the shipment.
        carrier:
          type:
            - string
            - 'null'
          description: Carrier name.
        courier:
          type:
            - object
            - 'null'
          additionalProperties: true
          description: Courier contact details.
        shippingAddress:
          type:
            - string
            - 'null'
          description: Destination shipping address ObjectId.
        shippingOption:
          type:
            - string
            - 'null'
          description: Shipping option ObjectId, if any.
        metadata:
          type: object
          additionalProperties: true
          description: Carrier/aggregator metadata.
        trackingNumber:
          type:
            - string
            - 'null'
          description: Tracking number.
        trackingCode:
          type:
            - string
            - 'null'
          description: Tracking code.
        trackingUrl:
          type:
            - string
            - 'null'
          description: Tracking URL.
        shippingMethod:
          type:
            - string
            - 'null'
          description: Shipping method label.
        shippingCost:
          type:
            - number
            - 'null'
          description: Shipping cost.
        notes:
          type:
            - string
            - 'null'
          description: Free-text notes.
        status:
          type: string
          description: Shipment status.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Envelope:
      allOf:
        - $ref: '#/components/schemas/EnvelopeBase'
        - type: object
          properties:
            data:
              description: Operation-specific payload (object, array, or null).
  responses:
    Unauthorized:
      description: Missing or invalid app access token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 401
            success: false
            message: Authentication required
            data: null
    Forbidden:
      description: The app token is missing the OAuth scope required for this operation.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Envelope'
          example:
            status: 403
            success: false
            message: Insufficient scope
            data: null
  securitySchemes:
    AppToken:
      type: http
      scheme: bearer
      description: >-
        Installed-app access token (prefix app_), issued by the OAuth install
        flow. The store is bound to the token server-side — never send a shop
        id.

````