PUT /Items
Servers
- https://api.xero.com/api.xro/2.0
Request headers
Name | Type | Required | Description |
---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
xero-tenant-id |
String | Yes |
Xero identifier for Tenant |
Idempotency-Key |
String | No |
This allows you to safely retry requests without the risk of duplicate processing. 128 character max. |
Query parameters
Name | Type | Required | Description |
---|---|---|---|
unitdp |
Integer | No |
e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts |
summarizeErrors |
Boolean | No |
If false return 200 OK and mix of successfully created objects and any with validation errors Default value: false |
Request body fields
Name | Type | Required | Description |
---|---|---|---|
Items[] |
Array | No | |
Items[].ItemID |
String | No |
The Xero identifier for an Item |
Items[].Code |
String | Yes |
User defined item code (max length = 30) |
Items[].TotalCostPool |
Number | No |
The value of the item on hand. Calculated using average cost accounting. |
Items[].Name |
String | No |
The name of the item (max length = 50) |
Items[].PurchaseDescription |
String | No |
The purchase description of the item (max length = 4000) |
Items[].StatusAttributeString |
String | No |
Status of object |
Items[].PurchaseDetails |
Object | No | |
Items[].PurchaseDetails.COGSAccountCode |
String | No |
Cost of goods sold account. Only applicable to the purchase details of tracked items. |
Items[].PurchaseDetails.UnitPrice |
Number | No |
Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. |
Items[].PurchaseDetails.AccountCode |
String | No |
Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items |
Items[].PurchaseDetails.TaxType |
String | No |
The tax type from TaxRates |
Items[].Description |
String | No |
The sales description of the item (max length = 4000) |
Items[].UpdatedDateUTC |
String | No |
Last modified date in UTC format |
Items[].IsPurchased |
Boolean | No |
Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled. |
Items[].IsTrackedAsInventory |
Boolean | No |
True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set. |
Items[].InventoryAssetAccountCode |
String | No |
The inventory asset account for the item. The account must be of type INVENTORY. The COGSAccountCode in PurchaseDetails is also required to create a tracked item |
Items[].ValidationErrors[] |
Array | No |
Displays array of validation error messages from the API |
Items[].ValidationErrors[].Message |
String | No |
Validation error message |
Items[].QuantityOnHand |
Number | No |
The quantity of the item on hand |
Items[].IsSold |
Boolean | No |
Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled. |
Items[].SalesDetails |
Object | No | |
Items[].SalesDetails.COGSAccountCode |
String | No |
Cost of goods sold account. Only applicable to the purchase details of tracked items. |
Items[].SalesDetails.UnitPrice |
Number | No |
Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request. |
Items[].SalesDetails.AccountCode |
String | No |
Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items |
Items[].SalesDetails.TaxType |
String | No |
The tax type from TaxRates |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.