---
title: "Update multiple part uses for a work order and an asset"
method: POST
path: "/workorders/inventory/parts/bulkPartUsage"
tags: ["Parts"]
---

# Update multiple part uses for a work order and an asset

`POST /workorders/inventory/parts/bulkPartUsage`

## Request

- Base URL: `https://sb2api.servicechannel.com/v3`
- URL: `https://sb2api.servicechannel.com/v3/workorders/inventory/parts/bulkPartUsage`
- Auth: OAuth 2
  - Authorization code: `https://sb2login.servicechannel.com/oauth/authorize`
  - Token URL: `https://sb2login.servicechannel.com/oauth/token`
- TypeScript: <https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/docs/workorders/inventory/parts/bulkPartUsage/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates, updates, or deletes multiple part uses for the **work order + asset** pair.
             • Supports both refrigerant and non-refrigerant parts. 
             • Supports inventory and vendor-supplied parts.
            <br />**Example request for removing part use records:**
            
               { 
                "DeleteItems": [
                { 
                    "PartId": 58069830,
                    "DeletionReason": "Incorrect Quantity",
                    "InventoryPartId": 80467,
                    "IsInventoryPart": true
                },
                { 
                    "PartId": 58069831,
                    "DeletionReason": "Wrong Part",
                    "IsInventoryPart": false
                }
               ]
               }

## Request body

- ServiceChannelServicesMessagingRefrigerantTrackingWorkOrderPartRefrigerantBulkChangeRequest: Object for modifying part use records in bulk
  - `AddItems` ServiceChannelServicesMessagingRefrigerantTrackingAddWorkOrderPartRefrigerantItem[]
    - `AssetId` integer: Unique numeric identifier of the asset to which the new part use records should be added. Only one asset can be processed in the request. For a non-refrigerant part use, the `AssetId` is not required.
    - `RecId` integer: Unique numeric identifier of the work order associated with the `AssetId`. Only one work order can be processed in the request.
    - `Quantity` number, double: Quantity of parts used.
    - `UnitCost` number, double: Cost of each part.
    - `IsRefrigerant` boolean: Specifies whether the part you are trying to add is classified as a refrigerant. Possible input values: `true` and `false`.
    - `IsInventoryPart` boolean: Specifies whether the part you are trying to add is listed in the inventory catalog for the location or the part is supplied by the vendor. Possible input values: • `true`: Indicates an inventory part • `false`: Indicates a vendor-supplied part
    - `InventorySource` string, byte: Specifies Part inventory source option Possible input values: • `0` = InventoryLocation • `1` = ProviderSupplied • `2` = ClientSupplied • `3` = ManualNonInventory
    - `UseDate` string, date-time: Date and time when the part was used. The format is `YYYY-MM-DDThh:mm:ss.sssZ`.
    - `UseDateStr` string: Date and time when the part was used. The format is `YYYY-MM-DDThh:mm:ss.sssZ`.
    - `ReasonCode` integer: Reason code name for the refrigerant part use — as configured by the subscriber. Possible values: • `Leak` • `Repair` • `Adjustment` • `System Expansion` • `Removal` • `Initial Charge` • `Retrofit` • `Removed Reused` <br />To get the list of reason codes for the subscriber, use the [GET/refrigeranttracking/{subscriberId}/GetRefrigerantUseReasonCodes](https://developer.servicechannel.com/swagger/index.html#/RefrigerantTracking/GETv3_refrigeranttracking_%7BsubscriberId%7D_GetRefrigerantUseReasonCodes) method.
    - `ReasonCodeId` integer: Unique numeric identifier of the refrigerant use reason code. To get the list of reason code IDs for the subscriber, use the [GET/refrigeranttracking/{subscriberId}/GetRefrigerantUseReasonCodes](https://developer.servicechannel.com/swagger/index.html#/RefrigerantTracking/GETv3_refrigeranttracking_%7BsubscriberId%7D_GetRefrigerantUseReasonCodes) method.
    - `PartNumber` string: Part number. Shouldn’t exceed 50 characters.
    - `PartName` string: Part name. Shouldn’t exceed 100 characters.
    - `PartGroup` string: Part group. Required only if the `IsRefrigerant` is set to `true`.
    - `PartGroupId` integer: Unique numeric identifier of the part group. Required only if the `IsRefrigerant` is set to `true`.
    - `SupplierName` string: Name of a company that supplies the part.
    - `Description` string: Part description. Any additional information on the part. Shouldn’t exceed 250 characters.
    - `RefrigerantChargeOptionsId` integer: Unique numeric identifier of the charge method used. Possible values: • `1`: Calculation • `2`: Established • `3`: Manufacturer Tag • `4`: Measurement • `5`: MFG Info (Established Range) • `6`: Onsite Documentation • `7`: Approximate <br />To get charge options and their IDs, use the [GET/refrigeranttracking/ChargeDescriptions](https://developer.servicechannel.com/swagger/index.html#/RefrigerantTracking/GETv3_refrigeranttracking_ChargeDescriptions) method.
    - `RefrigerantChargeVendor` string: Provider who identified the initial charge of the system. Only applicable when the `ReasonCode` is set to `Initial Charge`.
    - `InventoryLocationId` integer: Unique numeric identifier of the inventory location where the inventory part is stored.
    - `InventoryLocationGuid` string: GUID of the inventory location.
    - `InventoryPartId` integer: Unique numeric identifier of the inventory part. To get the inventory part ID, use the [GET/Setup/parts](https://inventoryapi.servicechannel.com/swagger/index.html) method.
    - `RefrigerantUseReason` ServiceChannelServicesMessagingRefrigerantTrackingRefrigerantUseReasonCode: Object containing refrigerant use reasons.
      - `Id` integer: Unique numeric identifier of the refrigerant use reason code.
      - `Order` integer: Order of appearance of a reason code.
      - `Purpose` integer: Unique numeric identifier of the reason code for the refrigerant part use. Possible values: `0` - Leak, `1` - InitialCharge, `2` - SystemExpansion, `3` - Removal, `4` - Other, `5` - RemovedReused, `6` - Retrofit. <br />Each reason code on the subscriber side is associated with a hardcoded purpose value in the database. Since reason codes can vary across subscribers, the purpose helps identify the valid reason code. <br />***Note:*** Purpose value `0` is assigned to the `Leak` and `Repair` reason codes, indicating that a leak record gets calculated for these reason codes.
      - `Name` string: Reason code name for the refrigerant part use as configured by the subscriber. Possible values: • `Leak` • `Repair` • `Adjustment` • `System Expansion` • `Removal` • `Initial Charge` • `Retrofit` • `Removed Reused`
      - `SubscriberId` integer: Unique numeric identifier of the subscriber.
      - `IsActive` boolean: Defines whether a user can select a reason code when capturing refrigerant use. Possible response values: • `true`: Reason code is enabled. • `false`: Reason code is disabled.
    - `RefrigerantRemovalStatus` 'Destroyed' | 'Reused' | 'Reclaimed' | 'Banked' | 'ChargeLost' | 'Sold': Status that describes what was done with the removed refrigerant in the event of the retrofit plan: • `Destroyed` • `Reused` • `Reclaimed` • `Banked` • `ChargeLost` • `Sold` <br />***Note:*** Applicable for the retrofit plan. <br />Not recommended for use in this request.
    - `RefrigerantTypeId` integer: Unique numeric identifier of the refrigerant type. To get the list of refrigerant types and their IDs, run the [GET/refrigeranttracking/RefrigerantTypes](https://developer.servicechannel.com/swagger/index.html#/RefrigerantTracking/GETv3_refrigeranttracking_RefrigerantTypes%3FsubscriberId%3D%7BsubscriberId%7D) method.
    - `RefrigerantTypeName` string: Refrigerant type name.
    - `SubmitMoeQtyExceeded` boolean: For Canadian locations. When the part use meets or exceeds the threshold, set the parameter’s value to `true` to be able to proceed with the request.
    - `MoeNumber` string: Agency number that will be assigned to the work order and the leak record. The number can be up to 20 characters. An agency number needs to be entered when the system threshold has been met or exceeded. For Canadian locations only. <br />Available with the *SCP_RTCanadaRefrigeration* feature flag.
    - `IsRetrofit` string, byte: Specifies whether the part use is associated with a retrofit plan. Possible values: • `true`: The part is linked to a retrofit plan. The `RefrigerantRemovalStatus` should be specified. • `false`: The part isn’t associated with a retrofit plan. <br />Not recommended for use in this request.
    - `RefrigerantSourceTypeId` integer: Unique numeric identifier of the refrigerant source type. To get the list of refrigerant source types and their IDs, run the [GET/refrigeranttracking/refrigerantSourceTypes](https://developer.servicechannel.com/swagger/index.html#/RefrigerantTracking/GETv3_refrigeranttracking_refrigerantSourceTypes) method. <br />Is required when *RTRefrigeSourceType* feature flag is enabled for the subscriber.
  - `UpdateItems` ServiceChannelServicesMessagingRefrigerantTrackingUpdateWorkOrderPartRefrigerantItem[]
    - `PartId` integer: Unique numeric identifier of the part use record that you want to update. Use the [GET/workorders/{workorderId}/partsUsage](https://developer.servicechannel.com/swagger/index.html#/Parts/GETv3_workorders_%7BworkorderId%7D_partsUsage) method to identify the required part use record ID.
    - `Quantity` number, double: Quantity of parts used.
    - `UnitCost` number, double: Cost of each part.
    - `IsRefrigerant` boolean: Specifies whether the part you are trying to update is classified as a refrigerant. Possible input values: `true` and `false`.
    - `IsInventoryPart` boolean: Specifies whether the part you are trying to update is listed in the inventory catalog for the location or the part is supplied by the vendor. Possible input values: • `true`: Indicates an inventory part • `false`: Indicates a vendor-supplied part
    - `InventorySource` string, byte: Specifies Part inventory source option Possible input values: • `0` = InventoryLocation • `1` = ProviderSupplied • `2` = ClientSupplied • `3` = ManualNonInventory
    - `UseDate` string, date-time: Date and time when the part was used.
    - `UseDateStr` string: Date and time when the part was used.
    - `ReasonCode` integer: Reason code name for the refrigerant part use — as configured by the subscriber. Possible values: • `Leak` • `Repair` • `Adjustment` • `System Expansion` • `Removal` • `Initial Charge` • `Retrofit` • `Removed Reused` <br />To get the list of reason codes for the subscriber, use the [GET/refrigeranttracking/{subscriberId}/GetRefrigerantUseReasonCodes](https://developer.servicechannel.com/swagger/index.html#/RefrigerantTracking/GETv3_refrigeranttracking_%7BsubscriberId%7D_GetRefrigerantUseReasonCodes) method.
    - `ReasonCodeId` integer: Unique numeric identifier of the refrigerant use reason code. To get the list of reason code IDs for the subscriber, use the [GET/refrigeranttracking/{subscriberId}/GetRefrigerantUseReasonCodes](https://developer.servicechannel.com/swagger/index.html#/RefrigerantTracking/GETv3_refrigeranttracking_%7BsubscriberId%7D_GetRefrigerantUseReasonCodes) method.
    - `PartNumber` string: Part number. Shouldn’t exceed 50 characters.
    - `PartName` string: Part name. Shouldn’t exceed 100 characters.
    - `PartGroup` string: Part group. Required only if the `IsRefrigerant` is set to `true`.
    - `SupplierName` string: Name of a company that supplies the part.
    - `Description` string: Part description. Any additional information on the part. Shouldn’t exceed 250 characters.
    - `RefrigerantChargeOptionsId` integer: Unique numeric identifier of the charge method used. Possible values: • `1`: Calculation • `2`: Established • `3`: Manufacturer Tag • `4`: Measurement • `5`: MFG Info (Established Range) • `6`: Onsite Documentation • `7`: Approximate <br />To get charge options and their IDs, use the [GET/refrigeranttracking/ChargeDescriptions](https://developer.servicechannel.com/swagger/index.html#/RefrigerantTracking/GETv3_refrigeranttracking_ChargeDescriptions) method.
    - `RefrigerantChargeVendor` string: Provider who identified the initial charge of the system. Only applicable when the `ReasonCode` is set to `Initial Charge`.
    - `InventoryLocationId` integer: Unique numeric identifier of the inventory location where the inventory part is stored.
    - `InventoryLocationGuid` string: GUID of the inventory location.
    - `InventoryPartId` integer: Unique numeric identifier of the inventory part.
    - `RefrigerantUseReason` ServiceChannelServicesMessagingRefrigerantTrackingRefrigerantUseReasonCode: Object containing refrigerant use reasons.
      - `Id` integer: Unique numeric identifier of the refrigerant use reason code.
      - `Order` integer: Order of appearance of a reason code.
      - `Purpose` integer: Unique numeric identifier of the reason code for the refrigerant part use. Possible values: `0` - Leak, `1` - InitialCharge, `2` - SystemExpansion, `3` - Removal, `4` - Other, `5` - RemovedReused, `6` - Retrofit. <br />Each reason code on the subscriber side is associated with a hardcoded purpose value in the database. Since reason codes can vary across subscribers, the purpose helps identify the valid reason code. <br />***Note:*** Purpose value `0` is assigned to the `Leak` and `Repair` reason codes, indicating that a leak record gets calculated for these reason codes.
      - `Name` string: Reason code name for the refrigerant part use as configured by the subscriber. Possible values: • `Leak` • `Repair` • `Adjustment` • `System Expansion` • `Removal` • `Initial Charge` • `Retrofit` • `Removed Reused`
      - `SubscriberId` integer: Unique numeric identifier of the subscriber.
      - `IsActive` boolean: Defines whether a user can select a reason code when capturing refrigerant use. Possible response values: • `true`: Reason code is enabled. • `false`: Reason code is disabled.
    - `SubmitMoeQtyExceeded` boolean: For Canadian locations. When the part use meets or exceeds the threshold, set the parameter’s value to `true` to be able to proceed with the request.
    - `MoeNumber` string: Agency number that will be assigned to the work order and the leak record. The number can be up to 20 characters. An agency number needs to be entered when the system threshold has been met or exceeded. For Canadian locations only. <br />Available with the *SCP_RTCanadaRefrigeration* feature flag.
    - `RecId` integer: Unique numeric identifier of the work order associated with the `AssetId`. Only one work order can be processed in the request.
    - `RefrigerantSourceTypeId` integer: Unique numeric identifier of the refrigerant source type. To get the list of refrigerant source types and their IDs, run the [GET/refrigeranttracking/refrigerantSourceTypes](https://developer.servicechannel.com/swagger/index.html#/RefrigerantTracking/GETv3_refrigeranttracking_refrigerantSourceTypes) method. <br />Is required when *RTRefrigeSourceType* feature flag is enabled for the subscriber.
  - `DeleteItems` ServiceChannelServicesMessagingRefrigerantTrackingDeleteWorkOrderPartRefrigerantItem[]
    - `PartId` integer: Unique numeric identifier of the part use record that should be removed. Use the [GET/workorders/{workorderId}/partsUsage](https://developer.servicechannel.com/swagger/index.html#/Parts/GETv3_workorders_%7BworkorderId%7D_partsUsage) method to identify the required part use record ID.
    - `InventoryLocationGuid` string: GUID of the inventory location.
    - `DeletionReason` string, byte: Reason for removing the refrigerant part use record. Possible values: • `Wrong Part` • `Wrong Asset` • `Incorrect Quantity` • `Other`
    - `DeletionReasonDescription` string: When the `DeletionReason` is set to `Other`, the `DeletionReasonDescription` parameter provides additional information on why the part use record is being removed. Shouldn’t exceed 150 characters.
    - `InventoryPartId` integer: Unique numeric identifier of the inventory part. To get the inventory part ID, use the [GET/Setup/parts](https://inventoryapi.servicechannel.com/swagger/index.html) method.
    - `IsInventoryPart` boolean: Specifies whether the part you are trying to remove is listed in the inventory catalog for the location or the part is supplied by the vendor. Possible input values: • `true`: Indicates an inventory part • `false`: Indicates a vendor-supplied part
  - `RetrofitRetirePlanParts` ServiceChannelServicesMessagingRetrofitRetirementRetrofitRetirePlanPart[]
    - `Id` integer
    - `PlanId` integer
    - `PartId` integer
    - `NewChargeId` integer
    - `LeakRecordId` integer
    - `InitialChargeId` integer
  - `IsLocalTime` boolean: Specifies whether the `UseDate` should be converted based on the work order location time zone. Possible values: • `true`: `UseDate` will not be converted to the location time zone. • `false`: `UseDate` is provided in UTC (global standard time zone) and automatically converted to the local time zone.
  - `SubmitQuantityExceeded` boolean: When the part use meets or exceeds the threshold, set the parameter’s value to `true` to be able to proceed with the request.
  - `SubmitMoeQtyExceeded` boolean: For Canadian locations. When the part use meets or exceeds the threshold, set the parameter’s value to `true` to be able to proceed with the request.

## Response `200`

Part use records have been successfully modified.

## Other responses

- `400`: The request was not accepted due to bad syntax, missing parameters, insufficient data, etc. <br/>Error codes: 3227 &mdash; Inventory part cannot be changed 5027 &mdash; Refrigerant tracking is not available for the location 503 &mdash; Refrigerant type entered is not defined. Part usage was blocked 3205 &mdash; Entered inventory parts don’t correspond to the asset refrigerant 3235 &mdash; Failed to process the inventory request 3219 &mdash; MOE number is required; part usage cannot be processed 3222 &mdash; Inventory part IDs and location IDs or GUIDs should not be null 3309 &mdash; There are uncompleted leak records in another WO 3306 &mdash; Refrigerant Tracking Connector is turned on. Only the external client's assets can be processed 3307 &mdash; Refrigerant Tracking Connector is not supported. Only the client's assets can be processed 3304 &mdash; Inventory usage is not allowed on refrigerant tracking for Connected Subscribers and Subcontractors 3237 &mdash; Another WO part use request is in processing now. Please try later 3236 &mdash; Duplicated parts detected 3327 &mdash; The same part is passed for update and removal in the same request 3207 &mdash; Parts with specified part IDs were not found 503 &mdash; Refrigerant usage cannot be processed. There are no refrigerant settings 503 &mdash; Only one asset can be processed in the request 3213 &mdash; Asset is not assigned to the work order 3305 &mdash; External WO currently doesn’t exist. Refrigerant usage is blocked 3212 &mdash; Add part usage: Either remove the Reason Code and the IsRefrigerant flag or specify an asset 3212 &mdash; Asset is not using refrigerant. Reason Code and IsRefrigerant values are not allowed 3213 &mdash; Either the asset is deactivated or you don’t have access to it 503 &mdash; Asset is not connected to any rack 809 &mdash; Work order is in the completed status. Only RT Admins can process 3230 &mdash; Incorrect refrigerant type entered 4003 &mdash; Asset uses refrigerant. RT setting is required 503 &mdash; There are no any charge records with the date earlier than the use date 3303 &mdash; A closed leak record exists for this work order. Only one leak record can exist per work order. Please enter additional part usage on a new work order 3232 &mdash; Leak record part usages cannot be attached to the Retro/Retire plan leak record 503 &mdash; Asset doesn’t contain charge prior to the given date 503 &mdash; Work order refrigerant leak part usages should belong to the same asset charge 3218 &mdash; Use date cannot be after the completed/scheduled date and earlier than the call date 3315 &mdash; Used reason code Retrofit cannot be selected for non-retrofit work orders 503 &mdash; Description field length cannot be more than 250 symbols 503 &mdash; Part number field length cannot be more than 50 symbols 3208 &mdash; Request should contain only one work order ID. Work order IDs found: 3206 &mdash; Incorrect work order 3201 &mdash; Incorrect reason code for the subscriber was entered 3209 &mdash; Invalid IsRefrigerant and Reason Code combination 3210 &mdash; IsRefrigerant flag cannot be changed 3211 &mdash; Reason code change is not allowed 3224 &mdash; Add part usages are not allowed after the Retrofit/Retire creation 3223 &mdash; Part removal is not allowed on the Retrofit/Retire WO 3319 &mdash; Zero charge value. Leak event calculation cannot be executed 3226 &mdash; Initial charge or system expansion are not allowed on “Connected to the rack” assets 3201 &mdash; System expansion and the leak repair cannot be processed in one WO 3215 &mdash; Asset doesn’t contain charge 3217 &mdash; Leak record is currently in processing on another work order 3229 &mdash; Duplicated request detected. Please wait a minute and try again 3227 &mdash; Inventory part cannot be changed 3228 &mdash; Inventory location cannot be changed 3231 &mdash; Part usage date is not allowed in the Retire/Retrofit date interval 503 &mdash; Broken date order in part usages for the system expansion
- `500`: Something went wrong, and the server was unable to complete your request.

---

[API](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3.md) - [All operations](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/llms.txt) - [OpenAPI document](https://skmtc.dev/servicechannel/apis/servicechannel-api-v-3/revisions/d490d6596809?raw)
