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

# Größen anlegen & aktualisieren

> Upsert the sizes (formats) a packaging unit comes in, keyed on (`specInternalRef`, `reference`). Idempotent and blank-is-keep: a replayed row comes back as `skipped`, and an omitted field keeps the stored value — this door can add and change size data, never clear it. A unit carries at most 50 sizes (`formatCapReached`). Sizes can also be sent on the unit intake itself (`sizes[]` or grouped rows), which is the primary way. At most 1000 rows per request (`400` otherwise). Requires `packaging:write`; customer workspace with the PPWR module enabled — see the guide.



## OpenAPI

````yaml POST /api/ppwr/formats
openapi: 3.1.0
info:
  title: Polygon One 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). PPWR packaging master data, the SKU quantity
    feed and Mengenmeldung reports are covered by the PPWR groups.
  version: 1.0.0
servers:
  - url: https://app.polygon-one.com
    description: Production Server
security:
  - bearerAuth: []
paths:
  /api/ppwr/formats:
    post:
      summary: Upsert Packaging Sizes
      description: >-
        Upsert the sizes (formats) a packaging unit comes in, keyed on
        (`specInternalRef`, `reference`). Idempotent and blank-is-keep: a
        replayed row comes back as `skipped`, and an omitted field keeps the
        stored value — this door can add and change size data, never clear it. A
        unit carries at most 50 sizes (`formatCapReached`). Sizes can also be
        sent on the unit intake itself (`sizes[]` or grouped rows), which is the
        primary way. At most 1000 rows per request (`400` otherwise). Requires
        `packaging:write`; customer workspace with the PPWR module enabled — see
        the guide.
      operationId: upsertPpwrFormats
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - type: array
                  items:
                    $ref: '#/components/schemas/PpwrFormatRow'
                  maxItems: 1000
                  description: Bare array form.
                - $ref: '#/components/schemas/PpwrFormatIntakeInput'
      responses:
        '200':
          $ref: '#/components/responses/PpwrIntakeResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    PpwrFormatRow:
      type: object
      description: >-
        One size of an existing packaging unit, for `POST /api/ppwr/formats`.
        Upsert key: (`specInternalRef`, `reference`). Blank-is-keep: an omitted
        or blank field keeps the stored value, so this door can add and change
        size data but never clear it. Naming the unit's own `internalRef`
        addresses its PRIMARY size (its reference always follows the unit and is
        never renamed here).
      required:
        - specInternalRef
        - reference
      properties:
        specInternalRef:
          type: string
          description: >-
            `internalRef` of an existing packaging unit in YOUR company. An
            unknown reference is the row error `unknownUnitRef` — the unit is
            never auto-created.
        reference:
          type: string
          minLength: 1
          maxLength: 120
          description: The size's identifier, unique within your company.
        gtin:
          type:
            - string
            - 'null'
          pattern: ^(\d{8}|\d{12}|\d{13}|\d{14})$
        label:
          type:
            - string
            - 'null'
          maxLength: 120
        widthMm:
          type:
            - number
            - string
          description: Width in mm.
        heightMm:
          type:
            - number
            - string
          description: Height in mm.
        depthMm:
          type:
            - number
            - string
          description: Depth in mm.
    PpwrFormatIntakeInput:
      type: object
      description: >-
        Envelope form for the size intake. The upsert is blank-is-keep, so there
        is nothing to confirm.
      required:
        - rows
      properties:
        rows:
          type: array
          items:
            $ref: '#/components/schemas/PpwrFormatRow'
          maxItems: 1000
    PpwrIntakeResult:
      type: object
      description: >-
        Result of a synchronous PPWR intake. **Partial accept:** valid rows
        commit even when other rows are `invalid` or `failed` — the one
        exception is the `409` overwrite gate, which is all-or-nothing.
        **Idempotent:** replaying an identical request changes nothing (matched
        rows return as `skipped`), except unit rows without `internalRef`, which
        are always creates.
      required:
        - imported
        - updated
        - skipped
        - failed
        - invalid
      properties:
        imported:
          type: integer
          description: ENTITIES created (units, components, links) — never sizes.
        updated:
          type: array
          items:
            type: string
          description: >-
            Identifiers of rows whose existing match changed. A size created on
            an existing unit appears as `<unit ref> / <size ref>`.
        skipped:
          type: array
          items:
            type: string
          description: Identifiers of rows that matched with nothing to change.
        failed:
          type: array
          items:
            $ref: '#/components/schemas/PpwrRowError'
          description: >-
            Rows the upsert engine rejected (unknown reference, ambiguous match,
            …). Its `error` values are stable machine keys.
        invalid:
          type: array
          items:
            $ref: '#/components/schemas/PpwrIndexedRowError'
          description: >-
            Rows rejected by schema validation before the engine ran. Most
            `error` values are stable machine keys, but a field with no custom
            message falls back to the validator's own English text — match on
            the key, fall back to displaying the string.
        sizesCreated:
          type: integer
          description: 'Unit intake only: sizes created for the rows'' units.'
        articleNumbersUnmatched:
          type: integer
          description: >-
            Unit intake only: distinct `articleNumbers` no live article matched.
            Skipped, never a row error.
        articleLinksCreated:
          type: integer
          description: 'Unit intake only: unit⇄article links created from `articleNumbers`.'
        componentLinksCreated:
          type: integer
          description: >-
            Unit intake only: unit⇄component links created from
            `componentCodes`.
        componentStubsCreated:
          type: integer
          description: >-
            Unit intake only: minimal placeholder components created for unknown
            `componentCodes`.
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        details:
          description: Additional error details (e.g. validation issues)
      required:
        - error
    PpwrRowError:
      type: object
      description: >-
        A row the upsert engine rejected. Carries no `index` — the engine
        reports by identifier.
      properties:
        identifier:
          type: string
        error:
          type: string
          description: 'Stable machine key (clamped: anything unexpected becomes `dbError`).'
    PpwrIndexedRowError:
      type: object
      description: >-
        A row rejected before the upsert engine ran, reported by its position in
        the request.
      properties:
        index:
          type: integer
          description: 0-based position of the row in the request.
        identifier:
          type: string
        error:
          type: string
          description: >-
            Usually a stable machine key; a field with no custom message falls
            back to the validator's own English text.
  responses:
    PpwrIntakeResult:
      description: Intake result (partial accept — see the schema).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PpwrIntakeResult'
    BadRequest:
      description: Invalid request data
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: Insufficient permissions for this resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalError:
      description: Internal server error
      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>`.

````