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

# Update orders

> Update one or more existing orders. Each request object must include the `order_id` of the order to update, plus any fields you want to change



## OpenAPI

````yaml put /v1/orders
openapi: 3.1.0
info:
  title: Quickbutik API
  version: 1.0.0
  description: >-
    Use the Quickbutik API to access and manage stores, products, orders, and
    more.
  contact:
    name: Quickbutik API Support
    url: https://quickbutik.com/support
  license:
    name: Proprietary
  x-fiddle-import-file: true
servers:
  - url: https://api.quickbutik.com
    description: Production server
security:
  - BasicAuth: []
tags:
  - name: Orders
    description: Order management operations
  - name: Products
    description: Product catalog management
  - name: Categories
    description: Product category management
  - name: Payment Methods
    description: Available payment methods
  - name: Shipping Methods
    description: Available shipping methods
  - name: Metadata
    description: Custom metadata management
  - name: Settings
    description: Store settings and configuration
  - name: Scripts
    description: Storefront script management
paths:
  /v1/orders:
    put:
      tags:
        - Orders
      summary: Update orders
      description: >-
        Update one or more existing orders. Each request object must include the
        `order_id` of the order to update, plus any fields you want to change
      operationId: update-orders
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/OrderUpdate'
      responses:
        '200':
          $ref: '#/components/responses/OrderUpdateSuccess'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    OrderUpdate:
      type: object
      required:
        - order_id
      properties:
        order_id:
          type: string
          example: '948102'
          description: ID of the order to update. Required.
        status:
          type: string
          enum:
            - paid
            - done
            - cancelled
            - unpaid
          example: paid
          description: Change the order state.
        shipping_info:
          type: object
          properties:
            trackingnumber:
              type: string
              example: '230491712300'
              description: Tracking number
            company:
              type: string
              example: DHL
              description: Shipping company
          description: >-
            Optional. Used together with status **done** to attach tracking
            information to the shipment.
        email_confirmation:
          type: string
          example: 'true'
          description: >-
            Optional. Used together with status **done** — send shipping
            confirmation email to customer.
        skip_email_confirmation:
          type: string
          example: 'true'
          description: >-
            Optional. Used together with status **paid** — skip the order
            confirmation email.
        paymethod_activate:
          type: string
          example: 'false'
          description: Optional. Used together with status **done**. Default is **true**.
        skip_webhook:
          type: string
          example: 'true'
          description: >-
            Optional. Used together with status **paid** — skip webhook
            notifications for this status change.
        language:
          type: string
          example: en
          description: >-
            Optional. Used together with status **paid**. Two-letter language
            code (ISO 639-1) used for customer-facing emails.
        products:
          $ref: '#/components/schemas/OrderProducts'
        products_add:
          $ref: '#/components/schemas/OrderProductsAdd'
        products_remove:
          $ref: '#/components/schemas/OrderProductsRemove'
        discount_add:
          $ref: '#/components/schemas/OrderDiscountAdd'
        discount_remove:
          $ref: '#/components/schemas/OrderDiscountRemove'
        customer:
          type: object
          description: Optional. Update customer details on the order.
          properties:
            type:
              type: string
              enum:
                - consumer
                - business
              example: consumer
            email:
              type: string
              format: email
              example: customer@example.com
            phone:
              type: string
              example: '+46123456789'
            billing_details:
              $ref: '#/components/schemas/AddressDetails'
            shipping_details:
              allOf:
                - $ref: '#/components/schemas/AddressDetails'
                - type: object
                  properties:
                    company_name:
                      type: string
                      description: Required if customer.type is business
            note:
              type: string
              description: Customer note on the order
        payment:
          allOf:
            - $ref: '#/components/schemas/OrderPayment'
          description: Optional. Update payment details on the order.
        shipping:
          allOf:
            - $ref: '#/components/schemas/OrderShipping'
          description: Optional. Update the shipping method on the order.
        metadata:
          type: object
          additionalProperties:
            type: string
          description: >-
            Optional. Custom metadata to set on the order. Existing keys are
            overwritten, others are left in place.
      example:
        - order_id: '948102'
          status: done
          shipping_info:
            trackingnumber: '230491712300'
            company: DHL
          email_confirmation: 'true'
          paymethod_activate: 'true'
          skip_email_confirmation: 'false'
          skip_webhook: 'false'
          language: en
          products_add:
            - sku: SHIRT-123
              product_id: '12345'
              variant_id: '67890'
              qty: 1
          products_remove:
            - sku: OLD-SHIRT-001
              qty: 1
          products:
            - sku: SHIRT-123
              product_id: '12345'
              variant_id: '67890'
              qty: 2
          discount_add:
            amount: 50
          discount_remove: false
          customer:
            type: consumer
            email: customer@example.com
            phone: '+46701234567'
            billing_details:
              firstname: Kalle
              lastname: Ankasson
              address: Gladagatan 10
              address2: ''
              city: Ankeborg
              zipcode: '12345'
              country: SE
            shipping_details:
              firstname: Kalle
              lastname: Ankasson
              address: Gladagatan 10
              address2: ''
              city: Ankeborg
              zipcode: '12345'
              country: SE
              company_name: ''
            note: Leave at the front door
          payment:
            method: MySaleChannel
            transaction_id: TX-2024-0001
            currency: SEK
          shipping:
            id: 1
            name: Postnord Parcel
            price: '49.00'
          metadata:
            external_ref: ERP-55213
    OrderProducts:
      type: array
      description: >-
        Specify products in this order. When used, all other existing products
        in the order will be removed and be replaced with the ones specified
        here
      items:
        allOf:
          - $ref: '#/components/schemas/ProductIdentifier'
          - type: object
            properties:
              qty:
                type: integer
                example: 1
                description: The quantity of this product in the order. Defaults to 1
    OrderProductsAdd:
      type: array
      description: >-
        Optional. If you would like to add products from the order. You can pass
        multiple objects/products into this parameter, to add multiple at once
      items:
        allOf:
          - $ref: '#/components/schemas/ProductIdentifier'
          - type: object
            required:
              - product_id
              - qty
            properties:
              qty:
                type: integer
                example: 1
                description: The quantity of this product to add to the order
    OrderProductsRemove:
      type: array
      description: >-
        Optional. If you would like to remove products from the order. You can
        pass multiple objects/products into this parameter, to remove multiple
        at once
      items:
        allOf:
          - $ref: '#/components/schemas/ProductIdentifier'
          - type: object
            required:
              - product_id
              - qty
            properties:
              qty:
                type: integer
                example: 1
                description: The quantity of this product to remove from the order
    OrderDiscountAdd:
      type: object
      description: Optional. Set only if you would like to add a discount for this order
      properties:
        amount:
          type: number
          description: Optional. Enter discount value
    OrderDiscountRemove:
      type: boolean
      description: Optional. Set only if you would like to add a discount for this order
    AddressDetails:
      type: object
      properties:
        company_name:
          type: string
          example: Bolaget AB
        firstname:
          type: string
          example: Kalle
        lastname:
          type: string
          example: Ankasson
        address:
          type: string
          example: Gladagatan 10
        address2:
          type: string
        city:
          type: string
          example: Ankeborg
        zipcode:
          type: string
          example: '12345'
        country:
          type: string
          example: SE
          description: Two-letter country code (ISO 3166-1 alpha-2 format)
    OrderPayment:
      type: object
      properties:
        method:
          type: string
          example: MySaleChannel
          description: Optional. Enter if purchase is not made in store checkout
        transaction_id:
          type: string
          description: Optional. Order reference from the payment method
        currency:
          type: string
          example: SEK
          description: Must be one of the example values
    OrderShipping:
      type: object
      properties:
        id:
          type: integer
          example: 1
          description: >-
            shippingmethod_id (from the **/shippingmethods** available in the
            store)
        name:
          type: string
          example: Postnord Parcel
          description: >-
            Shipping method name (optional, uses title from shippingmethod
            otherwise if id specified)
        price:
          type: string
          description: >-
            Shipping amount (optional, uses price from shippingmethod otherwise
            if id specified)
    OrderUpdateResult:
      type: object
      properties:
        order_id:
          type: integer
        errors:
          type: array
          items:
            type: string
        success:
          type: string
    Error:
      type: object
      properties:
        code:
          type: integer
          example: 404
        error:
          type: string
          example: Resource not found
    ProductIdentifier:
      type: object
      properties:
        sku:
          type: string
          example: SHIRT-123
          description: >-
            Optional. You can use this parameter, or product_id/variant_id
            parameters, to identify product
        product_id:
          type: string
        variant_id:
          type: string
          example: NULL (no variant)
  responses:
    OrderUpdateSuccess:
      description: Orders updated successfully
      content:
        application/json:
          schema:
            type: object
            properties:
              results:
                type: object
                additionalProperties:
                  $ref: '#/components/schemas/OrderUpdateResult'
    BadRequest:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Unauthorized - Invalid or missing authentication
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
      description: >
        **Basic Authentication with API Keys**


        The Quickbutik API uses Basic Authentication where you use your API key
        as both the username and password.


        **How it works:**

        1. Format your credentials as `api_key:api_key` (using the SAME API key
        for both username and password)

        2. Base64 encode the formatted string

        3. Include in the Authorization header as: `Authorization: Basic
        ENCODED_STRING`


        **Example:**

        - API Key: `sk_live_abc123`

        - Formatted: `sk_live_abc123:sk_live_abc123`

        - Base64 Encoded: `c2tfbGl2ZV9hYmMxMjM6c2tfbGl2ZV9hYmMxMjM=`

        - Header: `Authorization: Basic
        c2tfbGl2ZV9hYmMxMjM6c2tfbGl2ZV9hYmMxMjM=`


        **cURL Example:**

        ```bash

        curl https://api.quickbutik.com/v1/orders -u your_api_key:your_api_key

        ```


        All API requests must be made over HTTPS. Requests made over HTTP will
        be rejected.


        API keys can be generated in the Quickbutik Control Panel under Settings
        → API.

````