latestOpenAPI 3.0.02026-08-2217901.1 MB

ef9153fcac7c

Parts

Create or update part by external ID

Idempotent upsert keyed on the external ID in the path. If a part has this external ID, it will be updated (and undeleted, if the part was previously deleted). Otherwise, a new part will be created with this external ID.

patch/parts/external/{externalId}

Path parameters

externalIdstring required

External ID of the part

Query parameters

skipWebhookboolean

Set skipWebhook=true, skipWebhook=1 or skipWebhook=yes to skip all webhooks upon successful operation on the endpoint. Learn more about webhooks

Headers

x-organization-idinteger

Required if using a multi organizations token

Request body

namestring
descriptionstring nullable
areastring nullable

Area of the part. Deprecated: Use new field inside locations. Will cause error if both fields are sent. See https://help.getmaintainx.com/multi-location-parts#integration-issues-with-multi-location-parts for more information.

unitCostinteger nullable

Cost in cents. For example, for $1.20, put 120.

availableQuantityinteger

Total quantity currently in stock. Deprecated: Use new field inside locations. Will cause error if both fields are sent. See https://help.getmaintainx.com/multi-location-parts#integration-issues-with-multi-location-parts for more information.

minimumQuantityinteger

Total minimum quantity before you should restock. Deprecated: Use new field inside locations. Will cause error if both fields are sent. See https://help.getmaintainx.com/multi-location-parts#integration-issues-with-multi-location-parts for more information.

barcodestring nullable

String encoded barcode

locationIdinteger nullable

ID of the location where the part is located. Deprecated: Use new field inside locations. Will cause error if both fields are sent. See https://help.getmaintainx.com/multi-location-parts#integration-issues-with-multi-location-parts for more information.

partTypesstring[]

List of part types

assetIdsinteger[]

List of asset IDs

teamIdsinteger[]

List of team IDs in charge of the part

extraFieldsobject

Custom Fields on the entity. The object keys are the exact Custom Field labels, including spaces or special characters. (ie: "Part Number")

assignedQuantityinteger

Total quantity currently assigned to work orders across all stages.

vendorIdsinteger[]

List of vendor IDs. Deprecated: Use the vendorId field inside vendors.

createdAtstring date-time

Date & time at which the part was created

updatedAtstring date-time

Date & time at which the part was last updated. This doesn't include comments

deletedAtstring date-time nullable

Date at which the part was deleted

Example request

{
  "name": "Locknut - 1/8",
  "area": "tool room",
  "unitCost": 120,
  "availableQuantity": 10,
  "minimumQuantity": 5,
  "barcode": "bWFpbnRhaW54Cg==",
  "locationId": 852,
  "assetIds": [
    12,
    4561
  ],
  "teamIds": [
    1,
    4
  ],
  "extraFields": {
    "Part Number": "000000000"
  },
  "vendors": [
    {
      "partNumber": "XC230"
    }
  ],
  "committedQuantities": {
    "kitted": 5,
    "reserved": 3,
    "staged": 2
  },
  "assignedQuantity": 10,
  "vendorIds": [
    23,
    56
  ],
  "createdAt": "2022-01-01T00:00:00.000Z",
  "updatedAt": "2022-01-01T00:00:00.000Z",
  "deletedAt": "2022-01-01T00:00:00.000Z",
  "locations": {
    "addedUpdated": [
      {
        "locationId": 852,
        "availableQuantity": 10,
        "minimumQuantity": 5,
        "maximumQuantity": 100,
        "area": "tool room"
      }
    ],
    "removedLocationIds": [
      742,
      514
    ]
  }
}

Response

Successfully updated part

Example response

{
  "part": {
    "id": 123456,
    "name": "Locknut - 1/8",
    "area": "tool room",
    "unitCost": 120,
    "availableQuantity": 10,
    "inStockQuantity": 10,
    "minimumQuantity": 5,
    "barcode": "bWFpbnRhaW54Cg==",
    "locationId": 852,
    "locations": [
      {
        "locationId": 852,
        "availableQuantity": 10,
        "minimumQuantity": 5,
        "maximumQuantity": 100,
        "area": "tool room",
        "reservedQuantity": 10,
        "committedQuantities": {
          "kitted": 5,
          "reserved": 3,
          "staged": 2
        },
        "assignedQuantity": 5
      }
    ],
    "assetIds": [
      12,
      4561
    ],
    "teamIds": [
      1,
      4
    ],
    "extraFields": {
      "Part Number": "000000000"
    },
    "vendors": [
      {
        "partNumber": "XC230"
      }
    ],
    "externalId": "ext-part-001",
    "orderedQuantity": 15,
    "reservedQuantity": 3,
    "committedQuantities": {
      "kitted": 5,
      "reserved": 3,
      "staged": 2
    },
    "assignedQuantity": 10,
    "maximumQuantity": 100,
    "vendorIds": [
      23,
      56
    ],
    "thumbnail": {
      "id": 12345,
      "mimeType": "image/png",
      "fileName": "image.png",
      "url": "http://example.com/image.png",
      "createdAt": "2022-01-01T00:00:00.000Z",
      "width": 220,
      "height": 100
    },
    "attachments": [
      {
        "id": 12345,
        "mimeType": "image/png",
        "fileName": "image.png",
        "url": "http://example.com/image.png",
        "createdAt": "2022-01-01T00:00:00.000Z",
        "width": 220,
        "height": 100
      }
    ],
    "createdAt": "2022-01-01T00:00:00.000Z",
    "updatedAt": "2022-01-01T00:00:00.000Z",
    "deletedAt": "2022-01-01T00:00:00.000Z"
  }
}