Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Endpoints >

Xero Tracked Inventory: "You cannot save this transaction using an inventory account type"

Started by Alastair Badman -   in API Endpoints

I am following the instructions here in order to create a Stock Adjustment to Increase the Quantity on Hand
https://developer.xero.com/documentation/api-guides/tracked-inventory-in-xero

But I get this error message:
You cannot save this transaction using an inventory account type

I am using the 630 Inventory Account and am posting the reverse to the 310 CoGs account.

[Invoices] => Array
(
[0] => Array
(
[Type] => ACCPAY
[Contact] => Array
(
[Name] => Inventory Adjustment
)
[Date] => 2019-09-23 15:00:00
[DueDate] => 2019-09-23 15:00:00
[LineAmountTypes] => Exclusive
[Status] => AUTHORISED
[LineItems] => Array
(
[0] => Array
(
[ItemCode] => WKH1
[Description] => Workhorse 1
[Quantity] => 1
[UnitAmount] => 5.51
[TaxType] => NONE
[AccountCode] => 630
)
[1] => Array
(
[ItemCode] => WKH1
[Description] => Workhorse 1
[Quantity] => 1
[UnitAmount] => 5.51
[TaxType] => NONE
[AccountCode] => 310
)
)
)
)

Not sure where I am going wrong? Thanks for any help!