---
title: "Bulk upsert purchased components"
method: PUT
path: "/suppliers/public/purchased_components/batch"
tags: ["Purchased Components"]
---

# Bulk upsert purchased components

`PUT /suppliers/public/purchased_components/batch`

## Request

- Base URL: `https://api.paperlessparts.com/v1`
- URL: `https://api.paperlessparts.com/v1/suppliers/public/purchased_components/batch`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/paperlessparts/apis/paperless-parts-api/docs/suppliers/public/purchased_components/batch/put.ts> (a function with typed inputs; its response is checked against the schema)

Upserts purchased components in bulk. If the purchased component already exists, it will be updated. Otherwise, it will be created.

## Request body

- object
  - `purchased_components` PostPurchasedComponent[]: The list of purchased components to create. Max size is 1000 components.
    - `oem_part_number` string, required: Unique identifier for purchased component within a supplier account
    - `internal_part_number` string, nullable
    - `description` string, nullable
    - `piece_price` number, required: Cost per piece to 4 decimal places
    - `properties` PurchasedComponentCustomProperty[], required
      - `key` string: Name of corresponding purchased component column in table display
      - `value` union: Value of property, None or of type corresponding to value_type
        - string
        - number
        - boolean

## Response `200`

Successful Response

- object
  - `successes` PurchasedComponent[]
    - `oem_part_number` string: Unique identifier for purchased component within a supplier account
    - `internal_part_number` string, nullable
    - `description` string, nullable
    - `piece_price` number: Cost per piece to 4 decimal places
    - `id` integer
    - `properties` PurchasedComponentCustomProperty[]
      - `key` string: Name of corresponding purchased component column in table display
      - `value` union: Value of property, None or of type corresponding to value_type
        - string
        - number
        - boolean
    - `thumbnail_url` string, nullable
  - `failures` PurchasedComponent[]
    - `oem_part_number` string: Unique identifier for purchased component within a supplier account
    - `internal_part_number` string, nullable
    - `description` string, nullable
    - `piece_price` number: Cost per piece to 4 decimal places
    - `id` integer
    - `properties` PurchasedComponentCustomProperty[]
      - `key` string: Name of corresponding purchased component column in table display
      - `value` union: Value of property, None or of type corresponding to value_type
        - string
        - number
        - boolean
    - `thumbnail_url` string, nullable

---

[API](https://skmtc.dev/paperlessparts/apis/paperless-parts-api.md) - [All operations](https://skmtc.dev/paperlessparts/apis/paperless-parts-api/llms.txt) - [OpenAPI document](https://skmtc.dev/paperlessparts/apis/paperless-parts-api/revisions/3eb132ead1fe?raw)
