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

> Update order

<Info>
  The `PUT` request is used to fully replace an existing entity with a new one based on the provided ID. This means:

  * All fields in the request body will overwrite the existing entity.
  * Any missing fields will be removed from the entity.
  * The request is idempotent, meaning multiple identical PUT requests will always result in the same final state.
</Info>


## OpenAPI

````yaml put /v1/orders/{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/orders/{id}:
    put:
      tags:
        - Orders
      summary: Update order
      description: Update order
      parameters:
        - x-order: '1'
          name: id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/dtos.OrderUpdateRequest'
        description: request
        required: true
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/dtos.SuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/dtos.OrderListResponse'
        '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'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/errors.HttpError'
        '404':
          description: Not Found
          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.OrderUpdateRequest:
      type: object
      required:
        - created_at
        - customer_id
        - fulfillment_status
        - line_items
        - payment_status
        - reference_id
        - updated_at
      properties:
        reference_id:
          type: string
          maxLength: 255
          x-order: '1'
          example: '1234567890'
        display_id:
          description: >-
            This is the display ID of the order, it is generated by the system
            if not provided.
          type: string
          maxLength: 255
          x-order: '2'
          example: '1234567890'
        customer_id:
          type: string
          x-order: '3'
          example: 12345678-90ab-cdef-1234-567890abcdef
        payment_term:
          type: string
          maxLength: 255
          x-order: '5'
          example: Payment Term
        shipping_method:
          type: string
          maxLength: 255
          x-order: '6'
          example: Shipping Method
        freight_term:
          type: string
          maxLength: 255
          x-order: '7'
          example: Freight Term
        amount:
          description: >-
            This is total amount of the order before all discounts, taxes,
            shipping charges, etc. are applied.
          type: number
          x-order: '10'
          example: 100
        amount_paid:
          type: number
          x-order: '11'
          example: 100
        discount_value:
          description: >-
            Discount offered on the order, always amount of actual discount
            offered. e.g. if discount is 10% off, then discount value is 10.00
            for 100.00 amount
          type: number
          x-order: '12'
          example: 10
        tax_value:
          description: >-
            Tax value on the order, always amount of actual tax offered. e.g. if
            tax is 10% of amount, then tax value is 10.00 for 100.00 amount
          type: number
          x-order: '13'
          example: 10
        shipping_charge:
          description: >-
            Shipping charge on the order, always amount of actual shipping
            charge offered. e.g. if shipping charge is $10.00, then shipping
            charge is $10.00
          type: number
          x-order: '14'
          example: 10
        shipment_date:
          description: Shipment date must be later than the order creation date
          type: string
          x-order: '15'
          example: '2025-01-01T00:00:00Z'
        due_date:
          description: >-
            Due date must be later than the order creation date, send null if
            due date is not applicable
          type: string
          x-order: '16'
          example: '2025-01-01T00:00:00Z'
        payment_status:
          type: string
          enum:
            - PAID
            - PENDING
            - PARTIALLY_PAID
            - REFUNDED
            - OVERPAID
            - VOIDED
          x-order: '17'
          example: PAID
        payment_method_id:
          type: string
          maxLength: 255
          x-order: '18'
          example: '1234567890'
        fulfillment_status:
          type: string
          enum:
            - PARTIALLY_DELIVERED
            - UNFULFILLED
            - PARTIALLY_FULFILLED
            - FULFILLED
            - IN_PROGRESS
            - DELIVERED
          x-order: '19'
          example: PARTIALLY_DELIVERED
        customer_note:
          type: string
          maxLength: 255
          x-order: '20'
          example: Customer Notes
        created_at:
          type: string
          x-order: '20'
          example: '2025-01-01T00:00:00Z'
        updated_at:
          description: Updated at must be later than the order creation date
          type: string
          x-order: '21'
          example: '2025-01-01T00:00:00Z'
        internal_note:
          type: string
          maxLength: 255
          x-order: '21'
          example: Internal Notes
        source:
          description: Source of the order, if not provided then it will be openapi
          type: string
          x-order: '23'
          example: high-point
        po_number:
          type: string
          maxLength: 255
          x-order: '24'
        customer_consent:
          allOf:
            - $ref: '#/components/schemas/dtos.CustomerConsentRequest'
          x-order: '25'
        container_info:
          allOf:
            - $ref: '#/components/schemas/dtos.ContainerInfoRequest'
          x-order: '26'
        billing_address:
          description: >-
            Billing address is stored and persisted in the order. It can be sent
            as custom address without ID which can be stored as temporary
            address to be used for billing only for this order.  If ID provided,
            the address will be retrieved from the Address Service. This
            overrides any address fields in the request body
          allOf:
            - $ref: '#/components/schemas/dtos.OrderAddressRequest'
          x-order: '27'
        shipping_address:
          description: >-
            Shipping address is stored and persisted in the order. It can be
            sent as custom address without ID which can be stored as temporary
            address to be used for shipping only for this order.  If ID
            provided, the address will be retrieved from the Address Service.
            This overrides any address fields in the request body
          allOf:
            - $ref: '#/components/schemas/dtos.OrderAddressRequest'
          x-order: '28'
        primary_contact:
          description: >-
            Primary contact is stored and persisted in the order. It can be sent
            as custom contact without ID which can be stored as temporary
            contact to be used for primary contact only for this order.  If ID
            provided, the contact will be retrieved from the Contact Service.
            This overrides any contact fields in the request body
          allOf:
            - $ref: '#/components/schemas/dtos.OrderContactRequest'
          x-order: '29'
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/dtos.OrderLineItemRequest'
          x-order: '30'
        attributes:
          type: array
          items:
            $ref: '#/components/schemas/dtos.AttributeRequest'
          x-order: '31'
        additional_charges:
          description: >-
            These are additional charges on the order apart from shipping, tax,
            discount, etc. It will be add-on to the total amount of the order.
          type: array
          items:
            $ref: '#/components/schemas/dtos.OrderChargesRequest'
          x-order: '32'
    dtos.SuccessResponse:
      type: object
      properties:
        data:
          x-order: '1'
    dtos.OrderListResponse:
      type: object
      properties:
        id:
          type: string
          x-order: '1'
          example: 01f5d171-d3e3-4b2b-bd57-0727194b5bed
        reference_id:
          type: string
          x-order: '2'
          example: '1234567890'
        display_id:
          type: string
          x-order: '3'
          example: WC_1234567890
        customer_id:
          type: string
          x-order: '4'
          example: '1234567890'
        status:
          type: string
          x-order: '5'
          example: active
        amount:
          type: number
          x-order: '6'
          example: 100
        amount_paid:
          type: number
          x-order: '7'
          example: 100
        payment_status:
          type: string
          x-order: '10'
          example: PAID
        fulfillment_status:
          type: string
          x-order: '11'
          example: >-
            PARTIALLY_DELIVERED UNFULFILLED PARTIALLY_FULFILLED FULFILLED
            IN_PROGRESS DELIVERED
        payment_method_id:
          type: string
          x-order: '12'
          example: '1234567890'
        payment_method:
          type: string
          x-order: '13'
          example: payment_method
        payment_term:
          type: string
          x-order: '14'
          example: payment_term
        shipping_method:
          type: string
          x-order: '15'
          example: shipping_method
        freight_term:
          type: string
          x-order: '16'
          example: freight_term
        internal_note:
          type: string
          x-order: '17'
          example: internal_note
        customer_note:
          type: string
          x-order: '18'
          example: customer_note
        shipment_date:
          type: string
          x-order: '19'
          example: '2021-01-01T00:00:00Z'
        due_date:
          type: string
          x-order: '20'
          example: '2021-01-01T00:00:00Z'
        source:
          type: string
          x-order: '21'
          example: cart
        price_list_id:
          type: string
          x-order: '22'
          example: '1234567890'
        primary_contact:
          allOf:
            - $ref: '#/components/schemas/dtos.OrderContactResponse'
          x-order: '23'
        shipping_address:
          allOf:
            - $ref: '#/components/schemas/dtos.OrderAddressResponse'
          x-order: '24'
        billing_address:
          allOf:
            - $ref: '#/components/schemas/dtos.OrderAddressResponse'
          x-order: '25'
        po_number:
          type: string
          x-order: '26'
        created_at:
          type: string
          x-order: '27'
          example: '2021-01-01T00:00:00Z'
        updated_at:
          type: string
          x-order: '28'
          example: '2021-01-01T00:00:00Z'
    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.CustomerConsentRequest:
      type: object
      required:
        - consent_file_id
        - has_consent
      properties:
        has_consent:
          type: boolean
          x-order: '1'
        consent_file_id:
          type: string
          x-order: '2'
    dtos.ContainerInfoRequest:
      type: object
      required:
        - key
        - unit
        - volume
      properties:
        name:
          type: string
          maxLength: 255
          x-order: '1'
          example: Container Name
        key:
          type: string
          maxLength: 255
          x-order: '2'
          example: 40ft_hig
        unit:
          type: string
          enum:
            - CFT
            - CBM
          x-order: '3'
          example: CFT
        volume:
          type: number
          x-order: '4'
          example: 100
    dtos.OrderAddressRequest:
      type: object
      properties:
        id:
          type: string
          x-order: '1'
          example: 12345678-90ab-cdef-1234-567890abcdef
        first_name:
          type: string
          maxLength: 50
          x-order: '2'
          example: John
        last_name:
          type: string
          maxLength: 50
          x-order: '3'
          example: Doe
        phone:
          description: Phone number in E.164 format
          type: string
          x-order: '4'
          example: '+14155552671'
        email:
          type: string
          x-order: '5'
          example: john.doe@example.com
        address_line_1:
          type: string
          maxLength: 255
          x-order: '6'
          example: 123 Main St
        address_line_2:
          type: string
          maxLength: 255
          x-order: '7'
          example: Apt 101
        city:
          type: string
          maxLength: 50
          x-order: '8'
          example: Anytown
        state:
          type: string
          maxLength: 50
          x-order: '9'
          example: CA
        country:
          description: Country code in ISO 3166-1 alpha-2 format, e.g. US, IN, etc.
          type: string
          x-order: '10'
          example: US
        zip_code:
          type: string
          maxLength: 50
          x-order: '11'
          example: '12345'
    dtos.OrderContactRequest:
      type: object
      properties:
        id:
          type: string
          x-order: '1'
          example: 12345678-90ab-cdef-1234-567890abcdef
        first_name:
          type: string
          maxLength: 50
          x-order: '2'
          example: John
        last_name:
          type: string
          maxLength: 50
          x-order: '3'
          example: Doe
        email:
          type: string
          x-order: '4'
          example: john.doe@example.com
        phone:
          description: Phone number in E.164 format
          type: string
          x-order: '5'
          example: '+14155552671'
        designation:
          type: string
          maxLength: 50
          x-order: '6'
          example: Sales Manager
    dtos.OrderLineItemRequest:
      type: object
      required:
        - sku
      properties:
        sku:
          type: string
          maxLength: 255
          x-order: '1'
          example: RUG14754
        quantity:
          type: integer
          x-order: '2'
          example: 10
        shipped_quantity:
          type: integer
          x-order: '3'
          example: 0
        invoiced_quantity:
          type: integer
          x-order: '4'
          example: 0
        cancelled_quantity:
          type: integer
          x-order: '5'
          example: 0
        picked_quantity:
          type: integer
          x-order: '6'
          example: 0
        unit_price:
          description: >-
            Unit price of the product, this is the price of the product before
            any discounts are applied.
          type: number
          x-order: '7'
          example: 100
        discount:
          description: >-
            Discount on the product, this is the discount amount that is applied
            to the product at unit price level.
          type: number
          x-order: '8'
          example: 0
        discount_type:
          description: Discount type can be percentage or value.
          type: string
          enum:
            - percentage
            - value
          x-order: '9'
          example: percentage
        is_adhoc:
          type: boolean
          x-order: '10'
          example: false
        note:
          type: string
          maxLength: 255
          x-order: '11'
          example: Extra packing material
    dtos.AttributeRequest:
      type: object
      required:
        - name
        - value
      properties:
        name:
          type: string
          maxLength: 255
          x-order: '1'
          example: '1234567890'
        value:
          type: string
          x-order: '2'
          example: red
    dtos.OrderChargesRequest:
      type: object
      required:
        - name
        - type
      properties:
        name:
          type: string
          maxLength: 255
          x-order: '1'
        type:
          description: >-
            If charge is tax then charge amount will be added to the amount. If
            charge is discount then it will be subtracted from the amount.
          type: string
          enum:
            - tax
            - discount
          x-order: '2'
        value_type:
          description: Omitted defaults to "value" (fixed currency amount).
          type: string
          enum:
            - value
            - percentage
          x-order: '3'
        amount:
          type: number
          x-order: '4'
    dtos.OrderContactResponse:
      type: object
      properties:
        id:
          type: string
          x-order: '1'
          example: 12345678-90ab-cdef-1234-567890abcdef
        first_name:
          type: string
          x-order: '2'
          example: John
        last_name:
          type: string
          x-order: '3'
          example: Doe
        email:
          type: string
          x-order: '4'
          example: john.doe@example.com
        phone:
          type: string
          x-order: '5'
          example: '+14155552671'
        designation:
          type: string
          x-order: '6'
          example: Sales Manager
    dtos.OrderAddressResponse:
      type: object
      properties:
        id:
          type: string
          x-order: '1'
          example: 12345678-90ab-cdef-1234-567890abcdef
        first_name:
          type: string
          x-order: '2'
          example: John
        last_name:
          type: string
          x-order: '3'
          example: Doe
        phone:
          type: string
          x-order: '4'
          example: '+14155552671'
        email:
          type: string
          x-order: '5'
          example: john.doe@example.com
        address_line_1:
          type: string
          x-order: '6'
          example: 123 Main St
        address_line_2:
          type: string
          x-order: '7'
          example: Apt 101
        city:
          type: string
          x-order: '8'
          example: Anytown
        state:
          type: string
          x-order: '9'
          example: CA
        country:
          type: string
          x-order: '10'
          example: US
        zip_code:
          type: string
          x-order: '11'
          example: '12345'
    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

````