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

# Bulk (re)create purchase order line items

> Replaces the line items of a purchase order: all existing NON-received line items on the target purchase order are deleted, then the submitted line items are created. All items in one call must reference the same supplierPurchaseOrderId. Line item status cannot be set by the caller (new lines start as "new"; a line resubmitted with its id keeps its status). The purchase order's part/equipment/purchase-request id lists are recomputed from the submitted lines and the purchase order notification is re-sent. supplierFacilityId and supplierCompanyId on each item are derived from the API key. Returns the created line items; items the caller has no write permission for are silently skipped.



## OpenAPI

````yaml /openapi/partners.json post /v1/partners/inventory/purchase_order_line_items/bulk
openapi: 3.1.0
info:
  title: OpenWrench Internal Teams API
  version: 1.0.0
  description: >-
    External partners API for OpenWrench supplier inventory: purchase requests,
    purchase orders, receipts, parts, equipment types, vendors, stock locations,
    per-stock-location inventory, and work order part/equipment usage.


    ## Authentication

    Every request must include an API key in the `X-API-KEY` header. Requests
    with a missing or invalid key receive `401 Unauthorized`. All data is scoped
    to the supplier company/facility of the contact the API key belongs to.


    ## Rate limiting

    Each API key is limited to 10 requests per 20-second window. Requests beyond
    that receive `429 Too Many Requests`.


    ## Response envelope

    Single-entity responses are wrapped as `{ "type": "<EntityName>", "data": {
    ... }, "status": "ok" }`. List responses are wrapped as `{ "type":
    "<EntityName>", "data": [ ... ], "count": <total>, "status": "ok" }` where
    `count` is the total number of matching records. Count endpoints return `{
    "type": "Count", "data": <integer>, "status": "ok" }`. Errors are returned
    as `{ "message": "...", "type": "<ExceptionType>", "status": "error",
    "traceId": "..." }` with HTTP status 400 (bad input), 401 (missing/invalid
    key), 404 (not found), or 429 (rate limited).


    ## Pagination and filtering

    List endpoints accept `offset`, `limit` (default 10, max 25), `sort_by`, and
    `order` (`asc`|`desc`) query parameters. Any other query parameter is passed
    through as an equality filter on the corresponding entity column.


    ## Date formats

    Date-time fields serialize as strings in one of two shapes depending on the
    underlying type: ISO 8601 with offset (e.g. `2026-08-14T13:05:22.000-07:00`)
    for most timestamps, or `yyyy-MM-dd HH:mm:ss.S` (space-separated, no offset)
    for database timestamp fields. Plain dates are `yyyy-MM-dd`. When sending
    date-times, ISO 8601 is accepted.


    ## API keys

    These endpoints require a **partner API key**, which is separate from buyer
    and supplier API keys. A buyer API key will not authenticate against
    `/v1/partners/` endpoints. Contact support@useopenwrench.com to have a
    partner key issued.


    ## Required headers

    Every request must carry BOTH `X-API-KEY` (your API key) and `OW-KEY` (the
    OpenWrench shared secret issued with it). Requests missing either return
    401.
servers:
  - url: https://api.useopenwrench.com/api/external
security:
  - ApiKeyAuth: []
    OwKeyAuth: []
tags:
  - name: Ping
    description: Health/authentication check
  - name: Purchase Requests
    description: Supplier inventory purchase requests
  - name: Purchase Request Line Items
    description: Line items on purchase requests
  - name: Purchase Orders
    description: Supplier inventory purchase orders
  - name: Purchase Order Line Items
    description: Line items on purchase orders
  - name: Purchase Order Receipts
    description: Receipts recorded against purchase order line items
  - name: Parts
    description: Supplier part catalog
  - name: Equipment Types
    description: Supplier equipment type catalog
  - name: Vendors
    description: Part/equipment vendors
  - name: Stock Locations
    description: Warehouses and mobile stock locations
  - name: Parts Per Stock Location
    description: Part stocking records per stock location
  - name: Equipment Per Stock Location
    description: Individual equipment held per stock location
  - name: Work Order Parts and Equipment
    description: Parts and equipment used on work orders
paths:
  /v1/partners/inventory/purchase_order_line_items/bulk:
    post:
      tags:
        - Purchase Order Line Items
      summary: Bulk (re)create purchase order line items
      description: >-
        Replaces the line items of a purchase order: all existing NON-received
        line items on the target purchase order are deleted, then the submitted
        line items are created. All items in one call must reference the same
        supplierPurchaseOrderId. Line item status cannot be set by the caller
        (new lines start as "new"; a line resubmitted with its id keeps its
        status). The purchase order's part/equipment/purchase-request id lists
        are recomputed from the submitted lines and the purchase order
        notification is re-sent. supplierFacilityId and supplierCompanyId on
        each item are derived from the API key. Returns the created line items;
        items the caller has no write permission for are silently skipped.
      operationId: bulkCreatePurchaseOrderLineItems
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/SupplierPurchaseOrderLineItemBulkItem'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SupplierPurchaseOrderLineItemListResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    SupplierPurchaseOrderLineItemBulkItem:
      type: object
      description: >-
        One purchase order line item to (re)create (fields consumed by the
        server, verified from source). supplierFacilityId and supplierCompanyId
        are derived from the API key and override any values sent. The line
        item's status cannot be set here: it is carried over from the existing
        line item when id is supplied, and defaults to "new" otherwise.
        stockLocationId/locationId are inherited from the purchase order. A cost
        (partCost or equipmentCost, matching the line type) is required unless
        the supplier company's inventory settings mark PO cost as non-mandatory
        (mandatory by default); a missing mandatory cost is rejected with 400
        "PO Line Item cost cannot be empty". Unknown fields are ignored.
      properties:
        id:
          type:
            - integer
            - 'null'
          format: int64
          description: >-
            Optional id of an existing line item (its current status is
            preserved)
        supplierPurchaseOrderId:
          type: integer
          format: int64
          description: >-
            Purchase order the line items belong to (must be the same PO for all
            items in the call)
        viaStockLocationId:
          type:
            - integer
            - 'null'
          format: int64
        isEquipmentLine:
          type: boolean
          description: true for an equipment line, false for a part line
        partId:
          type:
            - integer
            - 'null'
          format: int64
        partCatalogId:
          type:
            - integer
            - 'null'
          format: int64
        partQuantity:
          type:
            - integer
            - 'null'
          format: int32
        partUomId:
          type: integer
          format: int32
          description: Unit-of-measure id for the part line
        partCost:
          type:
            - number
            - 'null'
        partCurrencyId:
          type: string
          description: Currency code for part costs
        equipmentTypeId:
          type:
            - integer
            - 'null'
          format: int64
        equipmentCatalogId:
          type:
            - integer
            - 'null'
          format: int64
        equipmentQuantity:
          type:
            - integer
            - 'null'
          format: int32
        equipmentUomId:
          type: integer
          format: int32
          description: Unit-of-measure id for the equipment line
        equipmentCost:
          type:
            - number
            - 'null'
        equipmentCurrencyId:
          type: string
          description: Currency code for equipment costs
        prLineItemIds:
          type:
            - array
            - 'null'
          items:
            type: integer
            format: int64
          description: Purchase request line item ids fulfilled by this PO line
        warrantyAssetId:
          type:
            - integer
            - 'null'
          format: int64
        glCode:
          type:
            - string
            - 'null'
      required:
        - supplierPurchaseOrderId
        - isEquipmentLine
        - partUomId
        - partCurrencyId
        - equipmentUomId
        - equipmentCurrencyId
    SupplierPurchaseOrderLineItemListResponse:
      type: object
      description: >-
        Standard list envelope wrapping an array of
        SupplierPurchaseOrderLineItem with the total matching count.
      properties:
        type:
          type: string
          description: Entity type name, e.g. "SupplierPurchaseOrderLineItem"
        data:
          type: array
          items:
            $ref: '#/components/schemas/SupplierPurchaseOrderLineItem'
        count:
          type: integer
          format: int64
          description: Total number of records matching the query (not just this page)
        status:
          type: string
          enum:
            - ok
      required:
        - type
        - data
        - count
        - status
    SupplierPurchaseOrderLineItem:
      type: object
      description: A single part or equipment line on a purchase order.
      properties:
        id:
          type:
            - integer
            - 'null'
          format: int64
        status:
          type:
            - string
            - 'null'
          enum:
            - new
            - ordered
            - received
            - partially_received
            - cancelled
            - closed
            - null
        supplierPurchaseOrderId:
          type: integer
          format: int64
        supplierPurchaseOrder:
          anyOf:
            - $ref: '#/components/schemas/SupplierPurchaseOrderLite'
            - type: 'null'
        stockLocationId:
          type:
            - integer
            - 'null'
          format: int64
        locationId:
          type:
            - integer
            - 'null'
          format: int64
        viaStockLocationId:
          type:
            - integer
            - 'null'
          format: int64
        viaStockLocation:
          anyOf:
            - $ref: '#/components/schemas/StockLocation'
            - type: 'null'
        isEquipmentLine:
          type: boolean
        partId:
          type:
            - integer
            - 'null'
          format: int64
        part:
          anyOf:
            - $ref: '#/components/schemas/Part'
            - type: 'null'
        partCatalogId:
          type:
            - integer
            - 'null'
          format: int64
        partCatalog:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated part catalog (abridged).
        partQuantity:
          type:
            - integer
            - 'null'
          format: int32
        partUomId:
          type: integer
          format: int32
        partUom:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated unit of measure (abridged).
        partCost:
          type:
            - number
            - 'null'
        partCurrencyId:
          type: string
        partCurrency:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated currency (abridged).
        partReceivedQuantity:
          type:
            - integer
            - 'null'
          format: int32
        partReceivedAverageCost:
          type:
            - number
            - 'null'
        equipmentTypeId:
          type:
            - integer
            - 'null'
          format: int64
        equipmentType:
          anyOf:
            - $ref: '#/components/schemas/EquipmentType'
            - type: 'null'
        equipmentCatalogId:
          type:
            - integer
            - 'null'
          format: int64
        equipmentCatalog:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated equipment catalog (abridged).
        equipmentQuantity:
          type:
            - integer
            - 'null'
          format: int32
        equipmentUomId:
          type: integer
          format: int32
        equipmentUom:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated unit of measure (abridged).
        equipmentCost:
          type:
            - number
            - 'null'
        equipmentCurrencyId:
          type: string
        equipmentCurrency:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated currency (abridged).
        equipmentReceivedQuantity:
          type:
            - integer
            - 'null'
          format: int32
        equipmentReceivedAverageCost:
          type:
            - number
            - 'null'
        prLineItemIds:
          type:
            - array
            - 'null'
          items:
            type: integer
            format: int64
        warrantyAssetId:
          type:
            - integer
            - 'null'
          format: int64
        warrantyAsset:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated asset (abridged).
        glCode:
          type:
            - string
            - 'null'
        supplierPurchaseRequestLineItems:
          type: array
          items:
            $ref: '#/components/schemas/SupplierPurchaseRequestLineItemLite'
        supplierFacilityId:
          type: integer
          format: int32
        supplierFacility:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated supplier facility (abridged).
        supplierCompanyId:
          type: integer
          format: int32
        supplierCompany:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated supplier company (abridged).
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        isDeleted:
          type: boolean
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
      required:
        - supplierPurchaseOrderId
        - isEquipmentLine
        - partUomId
        - partCurrencyId
        - equipmentUomId
        - equipmentCurrencyId
        - supplierPurchaseRequestLineItems
        - supplierFacilityId
        - supplierCompanyId
        - isDeleted
    Error:
      type: object
      description: Standard error envelope.
      properties:
        message:
          type: string
          description: Human-readable error message
        type:
          type: string
          description: >-
            Exception type, e.g. badRequestException, unauthorizedException,
            notFoundException
        status:
          type: string
          enum:
            - error
        traceId:
          type: string
          description: >-
            Server-generated trace identifier (11 alphanumeric characters) for
            support/debugging
      required:
        - message
        - type
        - status
        - traceId
    SupplierPurchaseOrderLite:
      type: object
      description: Compact representation of a purchase order, embedded in line items.
      properties:
        id:
          type:
            - integer
            - 'null'
          format: int64
        purchaseOrderUniqueId:
          type:
            - integer
            - 'null'
          format: int32
        purchaseOrderUniqueIdWithPrefix:
          type:
            - string
            - 'null'
        purchaseOrderCustomIdentifier:
          type:
            - string
            - 'null'
        name:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - new
            - ordered
            - received
            - cancelled
            - closed
            - partially_received
        paymentTerms:
          type:
            - string
            - 'null'
        shippingTerms:
          type:
            - string
            - 'null'
        partEquipmentVendorId:
          type: integer
          format: int32
        stockLocationId:
          type:
            - integer
            - 'null'
          format: int64
        stockLocation:
          anyOf:
            - $ref: '#/components/schemas/StockLocation'
            - type: 'null'
        locationId:
          type:
            - integer
            - 'null'
          format: int64
        location:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated location (abridged).
        brandId:
          type:
            - integer
            - 'null'
          format: int32
        freightTotalBeforeTax:
          type:
            - number
            - 'null'
        miscTotalBeforeTax:
          type:
            - number
            - 'null'
        totalBeforeTax:
          type:
            - number
            - 'null'
        tax:
          type:
            - number
            - 'null'
        totalCost:
          type:
            - number
            - 'null'
        actualCost:
          type:
            - number
            - 'null'
        currencyId:
          type: string
        partIds:
          type:
            - string
            - 'null'
        equipmentTypeIds:
          type:
            - string
            - 'null'
        purchaseRequestIds:
          type:
            - string
            - 'null'
        supplierFacilityId:
          type: integer
          format: int32
        supplierCompanyId:
          type: integer
          format: int32
        createdByEmail:
          type: string
        dueDate:
          type:
            - string
            - 'null'
          format: date
          description: ISO 8601 date (yyyy-MM-dd)
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        isDeleted:
          type: boolean
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
      required:
        - status
        - partEquipmentVendorId
        - currencyId
        - supplierFacilityId
        - supplierCompanyId
        - createdByEmail
        - isDeleted
    StockLocation:
      type: object
      description: A stock location (warehouse or mobile stock, e.g. a truck).
      properties:
        id:
          type:
            - integer
            - 'null'
          format: int64
        warehouseId:
          type:
            - string
            - 'null'
        name:
          type: string
        images:
          type: array
          items:
            type: string
        description:
          type:
            - string
            - 'null'
        isMobile:
          type: boolean
        address:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Postal address (abridged).
        latitude:
          type:
            - number
            - 'null'
        longitude:
          type:
            - number
            - 'null'
        timeZoneId:
          type:
            - string
            - 'null'
        locationId:
          type:
            - integer
            - 'null'
          format: int64
        location:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated location (abridged).
        supplierFacilityId:
          type: integer
          format: int32
        supplierFacility:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated supplier facility (abridged).
        supplierCompanyId:
          type: integer
          format: int32
        supplierCompany:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated supplier company (abridged).
        burdenRates:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/BurdenRateWithYear'
        taxRates:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/TaxRateWithYear'
        purchaseOrderPrefix:
          type:
            - string
            - 'null'
        hasAccessFieldTechEmailsString:
          type:
            - string
            - 'null'
        canManageFieldTechEmailsString:
          type:
            - string
            - 'null'
        hasAssociatedEntities:
          type:
            - boolean
            - 'null'
        isActive:
          type: boolean
        glCode:
          type:
            - string
            - 'null'
        allowEquipmentForwarding:
          type: boolean
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        isDeleted:
          type: boolean
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
      required:
        - name
        - images
        - isMobile
        - supplierFacilityId
        - supplierCompanyId
        - isActive
        - allowEquipmentForwarding
        - isDeleted
    Part:
      type: object
      description: A part in the supplier's inventory catalog.
      properties:
        id:
          type:
            - integer
            - 'null'
          format: int64
        partUUID:
          type:
            - string
            - 'null'
        manufacturerId:
          type:
            - string
            - 'null'
        manufacturerName:
          type:
            - string
            - 'null'
        partNumber:
          type:
            - string
            - 'null'
        aliasPartId:
          type:
            - string
            - 'null'
        name:
          type: string
        images:
          type: array
          items:
            type: string
          description: Image URLs
        description:
          type:
            - string
            - 'null'
        cost:
          type:
            - number
            - 'null'
        uomId:
          type: integer
          format: int32
          description: Unit-of-measure id
        unitOfMeasure:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated unit of measure (abridged).
        defaultVendorId:
          type:
            - integer
            - 'null'
          format: int32
        defaultVendor:
          anyOf:
            - $ref: '#/components/schemas/PartEquipmentVendor'
            - type: 'null'
        defaultPartCatalogId:
          type:
            - integer
            - 'null'
          format: int64
        defaultPartCatalog:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated part catalog (abridged).
        assetTypeId:
          type:
            - integer
            - 'null'
          format: int32
        assetType:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated asset type (abridged).
        assetModelId:
          type:
            - integer
            - 'null'
          format: int32
        assetModel:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated asset model (abridged).
        isActive:
          type: boolean
        glCode:
          type:
            - string
            - 'null'
        partEquipmentVendorCount:
          type: integer
          format: int64
        isStocked:
          type: boolean
        isAssociatedWithOtherEntities:
          type:
            - boolean
            - 'null'
        customFieldDetails:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/AbridgedEntity'
        labelIds:
          type:
            - array
            - 'null'
          items:
            type: integer
            format: int64
        labels:
          type:
            - array
            - 'null'
          items:
            type: string
        partLabels:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/PartLabel'
        supplierCompanyId:
          type: integer
          format: int32
        supplierCompany:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated supplier company (abridged).
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        isDeleted:
          type: boolean
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
      required:
        - name
        - images
        - uomId
        - isActive
        - partEquipmentVendorCount
        - isStocked
        - supplierCompanyId
        - isDeleted
    AbridgedEntity:
      type: object
      additionalProperties: true
      description: >-
        Nested hydrated entity whose full schema is not expanded in this spec
        (the shape is abridged). Present only when the record has the
        association hydrated.
    EquipmentType:
      type: object
      description: An equipment type (model) in the supplier's inventory catalog.
      properties:
        id:
          type:
            - integer
            - 'null'
          format: int64
        equipmentTypeNumber:
          type:
            - string
            - 'null'
        aliasEquipmentTypeNumber:
          type:
            - string
            - 'null'
        manufacturerId:
          type:
            - string
            - 'null'
        manufacturerName:
          type:
            - string
            - 'null'
        modelName:
          type: string
        images:
          type: array
          items:
            type: string
          description: Image URLs
        description:
          type:
            - string
            - 'null'
        cost:
          type:
            - number
            - 'null'
        defaultVendorId:
          type:
            - integer
            - 'null'
          format: int32
        defaultVendor:
          anyOf:
            - $ref: '#/components/schemas/PartEquipmentVendor'
            - type: 'null'
        defaultEquipmentCatalogId:
          type:
            - integer
            - 'null'
          format: int64
        defaultEquipmentCatalog:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated equipment catalog (abridged).
        assetTypeId:
          type:
            - integer
            - 'null'
          format: int64
        assetType:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated asset type (abridged).
        isActive:
          type: boolean
        glCode:
          type:
            - string
            - 'null'
        partEquipmentVendorCount:
          type: integer
          format: int64
        supplierFacilityId:
          type: integer
          format: int32
        supplierCompanyId:
          type: integer
          format: int32
        isAssociatedWithOtherEntities:
          type:
            - boolean
            - 'null'
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        isDeleted:
          type: boolean
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
      required:
        - modelName
        - images
        - isActive
        - partEquipmentVendorCount
        - supplierFacilityId
        - supplierCompanyId
        - isDeleted
    SupplierPurchaseRequestLineItemLite:
      type: object
      description: >-
        Compact purchase request line item, embedded in purchase order line
        items.
      properties:
        id:
          type:
            - integer
            - 'null'
          format: int64
        status:
          type: string
          enum:
            - requested
            - denied
            - cancelled
            - approved
            - orderInProgress
            - ordered
            - partially_ordered
            - fulfilled
            - partially_fulfilled
        supplierPurchaseRequestId:
          type: integer
          format: int64
        supplierPurchaseRequest:
          anyOf:
            - $ref: '#/components/schemas/SupplierPurchaseRequestLite'
            - type: 'null'
        stockLocationId:
          type:
            - integer
            - 'null'
          format: int64
        locationId:
          type:
            - integer
            - 'null'
          format: int64
        isEquipmentLine:
          type: boolean
        partId:
          type:
            - integer
            - 'null'
          format: int64
        part:
          anyOf:
            - $ref: '#/components/schemas/Part'
            - type: 'null'
        partCatalogId:
          type:
            - integer
            - 'null'
          format: int64
        partCatalog:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated part catalog (abridged).
        partQuantity:
          type:
            - integer
            - 'null'
          format: int32
        partUomId:
          type: integer
          format: int32
        partUom:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated unit of measure (abridged).
        partUnitCost:
          type:
            - number
            - 'null'
        partCost:
          type:
            - number
            - 'null'
        partCurrencyId:
          type: string
        partCurrency:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated currency (abridged).
        equipmentTypeId:
          type:
            - integer
            - 'null'
          format: int64
        equipmentType:
          anyOf:
            - $ref: '#/components/schemas/EquipmentType'
            - type: 'null'
        equipmentCatalogId:
          type:
            - integer
            - 'null'
          format: int64
        equipmentCatalog:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated equipment catalog (abridged).
        equipmentQuantity:
          type:
            - integer
            - 'null'
          format: int32
        equipmentUomId:
          type: integer
          format: int32
        equipmentUom:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated unit of measure (abridged).
        equipmentUnitCost:
          type:
            - number
            - 'null'
        equipmentCost:
          type:
            - number
            - 'null'
        equipmentCurrencyId:
          type: string
        equipmentCurrency:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated currency (abridged).
        stockLocation:
          anyOf:
            - $ref: '#/components/schemas/StockLocation'
            - type: 'null'
        location:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated location (abridged).
        supplierFacilityId:
          type: integer
          format: int32
        supplierFacility:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated supplier facility (abridged).
        supplierCompanyId:
          type: integer
          format: int32
        supplierCompany:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated supplier company (abridged).
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        isDeleted:
          type: boolean
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
      required:
        - status
        - supplierPurchaseRequestId
        - isEquipmentLine
        - partUomId
        - partCurrencyId
        - equipmentUomId
        - equipmentCurrencyId
        - supplierFacilityId
        - supplierCompanyId
        - isDeleted
    BurdenRateWithYear:
      type: object
      properties:
        year:
          type: integer
          format: int32
        rate:
          type: string
      required:
        - year
        - rate
    TaxRateWithYear:
      type: object
      properties:
        year:
          type: integer
          format: int32
        rate:
          type: string
      required:
        - year
        - rate
    PartEquipmentVendor:
      type: object
      description: A vendor that supplies parts and/or equipment.
      properties:
        id:
          type:
            - integer
            - 'null'
          format: int32
        name:
          type: string
        vendorId:
          type:
            - string
            - 'null'
          description: External/custom vendor identifier
        address:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Postal address (abridged).
        currencyId:
          type: string
        email:
          type:
            - string
            - 'null'
        logoUrl:
          type:
            - string
            - 'null'
        phoneNumber:
          type:
            - string
            - 'null'
        paymentTerms:
          type:
            - string
            - 'null'
        shippingTerms:
          type:
            - string
            - 'null'
        orderingEmails:
          type:
            - array
            - 'null'
          items:
            type: string
        accountManagerEmails:
          type:
            - array
            - 'null'
          items:
            type: string
        accountManagerContacts:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/VendorContact'
        salesRepEmails:
          type:
            - array
            - 'null'
          items:
            type: string
        salesRepContacts:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/VendorContact'
        accountsPayableEmails:
          type:
            - array
            - 'null'
          items:
            type: string
        accountsPayableContacts:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/VendorContact'
        defaultWarrantyMonths:
          type:
            - integer
            - 'null'
          format: int32
        notes:
          type:
            - string
            - 'null'
        isActive:
          type: boolean
        supplierFacilityId:
          type: integer
          format: int32
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        isDeleted:
          type: boolean
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
      required:
        - name
        - currencyId
        - isActive
        - supplierFacilityId
        - isDeleted
    PartLabel:
      type: object
      properties:
        id:
          type:
            - integer
            - 'null'
          format: int64
        label:
          type: string
        color:
          type:
            - string
            - 'null'
        associatedPartsCount:
          type: integer
          format: int64
        supplierCompanyId:
          type: integer
          format: int32
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        isDeleted:
          type: boolean
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
      required:
        - label
        - associatedPartsCount
        - supplierCompanyId
        - isDeleted
    SupplierPurchaseRequestLite:
      type: object
      description: Compact representation of a purchase request, embedded in line items.
      properties:
        id:
          type:
            - integer
            - 'null'
          format: int64
        purchaseRequestUniqueId:
          type:
            - integer
            - 'null'
          format: int32
        purchaseRequestCustomIdentifier:
          type:
            - string
            - 'null'
        name:
          type: string
        description:
          type:
            - string
            - 'null'
        status:
          type: string
          enum:
            - requested
            - denied
            - cancelled
            - approved
            - orderInProgress
            - ordered
            - partially_ordered
            - fulfilled
            - partially_fulfilled
        stockLocationId:
          type:
            - integer
            - 'null'
          format: int64
        stockLocation:
          anyOf:
            - $ref: '#/components/schemas/StockLocation'
            - type: 'null'
        locationId:
          type:
            - integer
            - 'null'
          format: int64
        location:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated location (abridged).
        totalCost:
          type:
            - number
            - 'null'
        currencyId:
          type: string
        currency:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated currency (abridged).
        workOrderId:
          type:
            - integer
            - 'null'
          format: int64
        asset:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated asset (abridged).
        warrantyAssetId:
          type:
            - integer
            - 'null'
          format: int64
        warrantyAsset:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated asset (abridged).
        partIds:
          type:
            - string
            - 'null'
          description: Comma-separated part ids on the request
        equipmentTypeIds:
          type:
            - string
            - 'null'
          description: Comma-separated equipment type ids on the request
        createdByEmail:
          type: string
        createdByContact:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated contact (abridged).
        approvedOrDeclinedOrCancelledAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        approvedOrDeclinedOrCancelledByEmail:
          type:
            - string
            - 'null'
        approvedOrDeclinedOrCancelledByContact:
          anyOf:
            - $ref: '#/components/schemas/AbridgedEntity'
            - type: 'null'
          description: Hydrated contact (abridged).
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        isDeleted:
          type: boolean
        deletedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
      required:
        - name
        - status
        - currencyId
        - createdByEmail
        - isDeleted
    VendorContact:
      type: object
      properties:
        email:
          type: string
        name:
          type: string
        phoneNumber:
          type:
            - string
            - 'null'
        vendorId:
          type: integer
          format: int32
        supplierFacilityId:
          type: integer
          format: int32
        createdAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: ISO 8601 date-time
      required:
        - email
        - name
        - vendorId
        - supplierFacilityId
  responses:
    BadRequest:
      description: >-
        Bad request — invalid input, a disallowed state transition, the API
        key's contact is not associated with the required company/facility, or
        the key lacks read/write permission for the entity (permission failures
        are returned as 400 with type "unauthorizedException", not as 403)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid X-API-KEY
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Entity not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    TooManyRequests:
      description: Rate limit exceeded (10 requests per 20-second window per key)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Supplier partner API key. Rate limited to 10 requests per 20-second
        window.
    OwKeyAuth:
      type: apiKey
      in: header
      name: OW-KEY
      description: >-
        OpenWrench shared secret. Required on every request alongside X-API-KEY;
        issued together with your API key.

````