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

# Update Order

> Update order fields (orderNumber, orderDate, supplierId) and/or replace order lines. When `lines` is provided, all existing lines are replaced.



## OpenAPI

````yaml PATCH /api/orders/{id}
openapi: 3.1.0
info:
  title: Polygon One EUDR Compliance API
  description: >-
    API for integrating ERP systems with the Polygon One EUDR Compliance
    Platform. Allows management of Articles, Suppliers, Orders, and Due
    Diligence Statements (DDS).
  version: 1.0.0
servers:
  - url: https://app.polygon-one.com
    description: Production Server
security:
  - bearerAuth: []
paths:
  /api/orders/{id}:
    patch:
      summary: Update Order
      description: >-
        Update order fields (orderNumber, orderDate, supplierId) and/or replace
        order lines. When `lines` is provided, all existing lines are replaced.
      operationId: updateOrder
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrderInput'
      responses:
        '200':
          description: Updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
        '404':
          $ref: '#/components/responses/NotFound'
components:
  schemas:
    UpdateOrderInput:
      type: object
      description: >-
        Update order fields and/or replace order lines. When `lines` is
        provided, all existing lines are deleted and replaced.
      properties:
        orderNumber:
          type: string
        orderDate:
          type: string
          format: date-time
        deliveryDate:
          type: string
          format: date-time
          description: Optional ISO 8601 delivery date.
        supplierId:
          type: string
          format: uuid
        lines:
          type: array
          description: Replaces all existing order lines
          items:
            $ref: '#/components/schemas/CreateOrderLineInput'
    CreateOrderLineInput:
      type: object
      required:
        - articleId
      description: >-
        Each line must provide `articleId` and at least one of `quantity` or
        `pieceCount`. When only `pieceCount` is given, net mass (kg) is derived
        as `pieceCount × weightPerPieceKg` from the article master data.
      properties:
        articleId:
          type: string
          format: uuid
        quantity:
          type: number
          minimum: 0
          description: Net mass in kilograms. Required unless `pieceCount` is provided.
        pieceCount:
          type: integer
          minimum: 1
          description: >-
            Number of pieces. Used to derive net mass when `quantity` is
            omitted.
        volumeM3:
          type: number
          minimum: 0
          description: >-
            Volume in m³. Feeds the EUDR DDS supplementary unit (MTQ). Optional
            and independent of net mass.
        dryWeight90Kg:
          type: number
          minimum: 0
          description: >-
            Kilograms of 90 %-dry substance. Feeds the EUDR DDS supplementary
            unit (KSD) for wood-pulp HS codes.
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        details:
          description: Additional error details (e.g. validation issues)
      required:
        - error
  responses:
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        API key generated in Settings > API Keys. Include as `Authorization:
        Bearer <key>`.

````