younifyd
Menu

Create Items

Creates one or more items

PUT/Items

Use it in a workflow

  1. Add a step and choose the Xero connector.
  2. Pick the Create Items action (under Xero).
  3. Fill in the fields below, then reference the result from later steps as {{createItems.response.data}}.

Request

Query parameters

summarizeErrorsboolean

If false return 200 OK and mix of successfully created objects and any with validation errors

Default false

unitdpinteger

e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts

Headers

xero-tenant-idstringrequired

Xero identifier for Tenant

Idempotency-Keystring

This allows you to safely retry requests without the risk of duplicate processing. 128 character max.

Request body

Enter the body as JSON in the step's Body field.

Itemsarray<object>
Codestringrequired

User defined item code (max length = 30)

InventoryAssetAccountCodestring

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

Namestring

The name of the item (max length = 50)

IsSoldboolean

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.

IsPurchasedboolean

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.

Descriptionstring

The sales description of the item (max length = 4000)

PurchaseDescriptionstring

The purchase description of the item (max length = 4000)

PurchaseDetailsobject4 fields
SalesDetailsobject4 fields
IsTrackedAsInventoryboolean

True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set.

TotalCostPoolnumber (double)

The value of the item on hand. Calculated using average cost accounting.

QuantityOnHandnumber (double)

The quantity of the item on hand

UpdatedDateUTCstring

Last modified date in UTC format

ItemIDstring (uuid)

The Xero identifier for an Item

StatusAttributeStringstring

Status of object

ValidationErrorsarray<object>1 fields

Displays array of validation error messages from the API

json
{
  "Items": [
    {
      "Code": "string",
      "InventoryAssetAccountCode": "string",
      "Name": "string",
      "IsSold": false,
      "IsPurchased": false,
      "Description": "string",
      "PurchaseDescription": "string",
      "PurchaseDetails": {
        "UnitPrice": 0,
        "AccountCode": "string",
        "COGSAccountCode": "string",
        "TaxType": "string"
      },
      "SalesDetails": {
        "UnitPrice": 0,
        "AccountCode": "string",
        "COGSAccountCode": "string",
        "TaxType": "string"
      },
      "IsTrackedAsInventory": false,
      "TotalCostPool": 0,
      "QuantityOnHand": 0
    }
  ]
}

Response

Returns 200 with an object. Read it in later steps with {{createItems.response.data.<field>}}.

Itemsarray<object>
Codestringrequired

User defined item code (max length = 30)

InventoryAssetAccountCodestring

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

Namestring

The name of the item (max length = 50)

IsSoldboolean

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.

IsPurchasedboolean

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.

Descriptionstring

The sales description of the item (max length = 4000)

PurchaseDescriptionstring

The purchase description of the item (max length = 4000)

PurchaseDetailsobject4 fields
SalesDetailsobject4 fields
IsTrackedAsInventoryboolean

True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set.

TotalCostPoolnumber (double)

The value of the item on hand. Calculated using average cost accounting.

QuantityOnHandnumber (double)

The quantity of the item on hand

UpdatedDateUTCstring

Last modified date in UTC format

ItemIDstring (uuid)

The Xero identifier for an Item

StatusAttributeStringstring

Status of object

ValidationErrorsarray<object>1 fields

Displays array of validation error messages from the API

json
{
  "Items": [
    {
      "Code": "string",
      "InventoryAssetAccountCode": "string",
      "Name": "string",
      "IsSold": false,
      "IsPurchased": false,
      "Description": "string",
      "PurchaseDescription": "string",
      "PurchaseDetails": {
        "UnitPrice": 0,
        "AccountCode": "string",
        "COGSAccountCode": "string",
        "TaxType": "string"
      },
      "SalesDetails": {
        "UnitPrice": 0,
        "AccountCode": "string",
        "COGSAccountCode": "string",
        "TaxType": "string"
      },
      "IsTrackedAsInventory": false,
      "TotalCostPool": 0,
      "QuantityOnHand": 0
    }
  ]
}

Need more? See the Xero guide for connection setup and behaviour shared by every action.

Create Items — Xero — Documentation