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

# Update Shipment

> Update Shipment

<Info>
  The `PATCH` request is used to partially update an existing entity by the
  given id. This means:

  * Only the fields provided in the request body will be updated.
  * Fields not provided in the request body will remain unchanged.
  * The request is idempotent, meaning multiple identical PATCH requests will
    always result in the same final state.
</Info>


## OpenAPI

````yaml patch /v1/shipments/{id}
openapi: 3.0.0
info:
  description: Open API's for WizCommerce API's
  title: WizCommerce Open API's
  termsOfService: https://wizcommerce.com/terms/
  contact:
    name: Tech Support
    url: https://help.wizcommerce.com/
    email: tech@wizcommerce.com
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
  version: '1.0'
servers:
  - url: https://api.wizcommerce.com
    description: Production BaseURL
  - url: https://api-staging.sourcerer.tech
    description: Staging BaseURL
security: []
paths:
  /v1/shipments/{id}:
    patch:
      tags:
        - Shipment
      summary: Update Shipment
      description: Update Shipment
      parameters:
        - description: Shipment ID
          name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/dtos.ShipmentUpdateRequest'
        description: Shipment
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/dtos.SuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/dtos.ShipmentResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    dtos.ShipmentUpdateRequest:
      type: object
      properties:
        name:
          type: string
          maxLength: 255
          x-order: '1'
          example: Standard Delivery
        shipment_items:
          description: If the key is passed as [], the items will be removed.
          type: array
          items:
            $ref: '#/components/schemas/dtos.ShipmentItemCreateRequest'
          x-order: '2'
        id:
          type: string
          maxLength: 255
          x-order: '3'
          example: 01f5d171-d3e3-4b2b-bd57-0727194b5bed
        order_id:
          type: string
          maxLength: 255
          x-order: '4'
          example: ORD-2024-001
        status:
          type: string
          default: active
          enum:
            - active
            - inactive
          x-order: '5'
          example: active
        shipment_status:
          type: string
          enum:
            - shipped
            - created
          x-order: '6'
          example: shipped
        tracking_info:
          allOf:
            - $ref: '#/components/schemas/dtos.TrackingInfo'
          x-order: '7'
        updated_at:
          type: string
          x-order: '8'
          example: '2024-03-10T14:30:00Z'
        remark:
          type: string
          maxLength: 255
          x-order: '9'
          example: Door to Door
        note:
          type: string
          x-order: '10'
          example: Handle with care
    dtos.SuccessResponse:
      type: object
      properties:
        data:
          x-order: '1'
    dtos.ShipmentResponse:
      type: object
      properties:
        id:
          type: string
          x-order: '1'
          example: 01f5d171-d3e3-4b2b-bd57-0727194b5bed
        shipment_items:
          type: array
          items:
            $ref: '#/components/schemas/dtos.ShipmentItemsResponse'
          x-order: '2'
        reference_id:
          type: string
          x-order: '3'
          example: '123'
        order_id:
          type: string
          x-order: '4'
          example: '123'
        status:
          type: string
          x-order: '5'
          example: shipped
        tracking_info:
          allOf:
            - $ref: '#/components/schemas/dtos.TrackingInfoResponse'
          x-order: '6'
        created_at:
          type: string
          x-order: '7'
          example: '2021-01-01T00:00:00Z'
        updated_at:
          type: string
          x-order: '8'
          example: '2021-01-01T00:00:00Z'
        note:
          type: string
          x-order: '9'
          example: Handle with care
    errors.HttpError:
      type: object
      properties:
        code:
          type: string
          x-order: '1'
        message:
          type: string
          x-order: '2'
        details:
          type: array
          items:
            $ref: '#/components/schemas/errors.HttpErrorDetails'
          x-order: '3'
    dtos.ShipmentItemCreateRequest:
      type: object
      required:
        - product_id
        - quantity
      properties:
        product_id:
          description: Pass SKU in product_id field
          type: string
          maxLength: 255
          x-order: '1'
          example: SKU-001
        quantity:
          type: integer
          minimum: 1
          x-order: '2'
          example: 2
    dtos.TrackingInfo:
      type: object
      properties:
        tracking_number:
          type: string
          x-order: '1'
          example: 1Z999AA10123456784
        tracking_url:
          type: string
          x-order: '2'
          example: https://tracking.carrier.com/1Z999AA10123456784
        delivery_partner:
          type: string
          maxLength: 255
          x-order: '3'
          example: FedEx
    dtos.ShipmentItemsResponse:
      type: object
      properties:
        id:
          type: string
          x-order: '1'
          example: '123'
        sku_id:
          type: string
          x-order: '2'
          example: '123'
        quantity:
          type: integer
          x-order: '5'
          example: 10
    dtos.TrackingInfoResponse:
      type: object
      properties:
        tracking_number:
          type: string
          x-order: '1'
          example: '123'
        tracking_url:
          type: string
          x-order: '2'
          example: https://www.google.com
        delivery_partner:
          type: string
          x-order: '3'
          example: Fedex
    errors.HttpErrorDetails:
      type: object
      properties:
        field:
          type: string
          x-order: '1'
        reason:
          type: string
          x-order: '2'
  securitySchemes:
    ApiKeyAuth:
      description: API Key for authentication
      type: apiKey
      name: X-API-Key
      in: header

````