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

# Update purchase order item

> Updates the given fields. On an issued PO this writes a new revision. `package_section_id` moves a manual item to another section (and its package and project; another project is refused once it has receipts or invoice items); a baseline-linked item follows its row's section. `category_id` picks the category, named after the item's package (also re-applied when the item moves to another package); re-sending the same category keeps the stored text.



## OpenAPI

````yaml /openapi.yaml patch /purchase_orders/{purchase_order_id}/items/{id}
openapi: 3.0.1
info:
  title: GetSpecs REST API
  description: REST API documentation for GetSpecs.
  version: 1.0.0
servers:
  - url: /v1
  - url: https://demo-api.getspecs.io/v1
security: []
paths:
  /purchase_orders/{purchase_order_id}/items/{id}:
    patch:
      tags:
        - PurchaseOrderItem
      summary: Update purchase order item
      description: >-
        Updates the given fields. On an issued PO this writes a new revision.
        `package_section_id` moves a manual item to another section (and its
        package and project; another project is refused once it has receipts or
        invoice items); a baseline-linked item follows its row's section.
        `category_id` picks the category, named after the item's package (also
        re-applied when the item moves to another package); re-sending the same
        category keeps the stored text.
      operationId: purchase_order_items#update
      parameters:
        - name: purchase_order_id
          in: path
          required: true
          schema:
            type: integer
        - name: id
          in: path
          required: true
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/requestBodyPurchaseOrderItemUpdate'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/purchase_order_item'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
      security:
        - apiKey: []
          workspaceId: []
components:
  schemas:
    requestBodyPurchaseOrderItemUpdate:
      type: object
      description: >-
        Only the given keys change. Match type and tolerances are frozen once
        the item has goods receipts or invoice items; quantity can't drop below
        what was received (net of rejections) or matched.
      properties:
        description:
          type: string
          nullable: true
        unit_type:
          type: string
          nullable: true
        category_id:
          type: integer
          nullable: true
          description: >-
            A category of the workspace (null clears it). The stored text is the
            name the item's package committed for it, else the current path;
            re-sending the item's own category keeps the stored text.
        quantity:
          type: string
        unit_price:
          type: string
        match_type:
          type: string
          enum:
            - two_way
            - three_way
            - four_way
        price_variance_percent:
          type: string
          nullable: true
          description: Null / blank = this price limit is not checked.
        quantity_variance_percent:
          type: string
        amount_variance_absolute:
          type: string
          nullable: true
          description: Null / blank = this price limit is not checked.
        package_section_id:
          type: integer
          description: >-
            Moves a manual item to another section of an in-progress / finished
            package of the workspace (and to its package and project; the
            category text is re-picked for the new package). Refused for
            baseline-linked items (they follow their row's section) and, for
            another project, once the item has goods receipts or invoice items.
        package_baseline_item_id:
          type: integer
          nullable: true
          description: >-
            Re-link to another baseline row of the workspace (the item moves to
            that row's package, section and project), or null to unlink (the
            item keeps its package, section and project).
    purchase_order_item:
      type: object
      properties:
        id:
          type: integer
        project_id:
          type: integer
          description: >-
            The project this line procures for — the baseline row's project for
            linked items, the picked section's project for manual ones.
            Receipts, inspections, matches and invoice lines of the item carry
            it.
        purchase_order:
          type: object
          properties:
            id:
              type: integer
            label:
              type: string
            status:
              type: string
        baseline_item:
          type: object
          nullable: true
          description: >-
            The baseline row this item was created from (or re-linked to); null
            for manual items.
          properties:
            id:
              type: integer
            identifier:
              type: string
            name:
              type: string
              nullable: true
            package_id:
              type: integer
        package_id:
          type: integer
          description: >-
            The package the item counts for in Budget Analysis — the baseline
            row's, or the picked section's for a manual item.
        package_section_id:
          type: integer
          description: >-
            The section the item counts for in Budget Analysis — the baseline
            row's, or the picked one for a manual item.
        match_type:
          type: string
          enum:
            - two_way
            - three_way
            - four_way
        description:
          type: string
          nullable: true
        category_id:
          type: integer
          nullable: true
          description: >-
            The category the item was picked with (the row's for linked items).
            May no longer exist.
        category:
          type: string
          nullable: true
          description: >-
            Frozen category text — the row's for linked items; for a manual item
            the name its package committed for `category_id`, else the path at
            that time.
        unit_type:
          type: string
          nullable: true
        quantity:
          type: string
          example: '1000.00'
        unit_price:
          type: string
          example: '10.00'
        price_variance_percent:
          type: string
          nullable: true
          example: '2.0000'
          description: >-
            Max over-price in % of the PO unit price; null = not checked. With
            both price tolerances null, no over-price is allowed.
        quantity_variance_percent:
          type: string
          example: '0.0000'
        amount_variance_absolute:
          type: string
          nullable: true
          example: '50.00'
          description: Max over-price × quantity per invoice item; null = not checked.
        received_quantity:
          type: string
          description: Σ goods receipt quantity.
        accepted_quantity:
          type: string
          description: Σ accepted quantity of inspections.
        matched_quantity:
          type: string
          description: Σ matched invoice quantity.
        invoiced_quantity:
          type: string
          description: >-
            Σ quantity of the item's lines on non-cancelled invoices, matched or
            not. Above 0, match type and tolerances are frozen.
        position:
          type: integer
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - project_id
        - purchase_order
        - package_id
        - package_section_id
        - category_id
        - match_type
        - quantity
        - unit_price
        - received_quantity
        - accepted_quantity
        - matched_quantity
        - invoiced_quantity
    error:
      type: object
      properties:
        error:
          type: string
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
                nullable: true
              code:
                type: string
                nullable: true
              message:
                type: string
            required:
              - message
  securitySchemes:
    apiKey:
      type: apiKey
      name: authorization
      in: header
    workspaceId:
      type: apiKey
      name: X-Workspace-ID
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.