I am successfully writing invoices to Xero, including line item information, thus:
$products_list[] = array(
'Description' => $product_description,
'Quantity' => (float) $row['Quantity'],
'UnitAmount' => (float) $row['List Price'],
'DiscountRate' => $discountPercentage,
'TaxType' => 'OUTPUT2', //20% vat
'TaxAmount' => $calculatedTaxRate, //20% vat
'Name' => $xeroProductName['itemName'],
'ItemCode' => $xeroProductName['itemCode'],
'AccountCode' => $accountCode
);
All is fine except the AccountCode - no matter what I do it simply doesn't get written (neither I think does TaxAmount). I notice in Xero that 'Account' is a dropdown and when an account is selected, the tax amount is calculated.
Any help greatly appreciated.
Andy