Question

I'm having an issue trying to get tax applied to an invoice with QBXML. I'm using SalesTaxCodeRef in InvoiceLineAdd but it doesn't seem that it's working for whatever reason. This same code worked for SalesReceiptAddRq. Am I missing a flag or something?

<?xml version="1.0" encoding="UTF-8"?>
<?qbxml version="11.0"?><QBXML>
 <QBXMLMsgsRq onError="stopOnError">
  <InvoiceAddRq requestID="c16d1753af62163f3891551c07a1eed493bb291a">
   <InvoiceAdd>
    <CustomerRef>
     <FullName>Customers FullName</FullName>
    </CustomerRef>
    <TemplateRef>
     <FullName>Default Template</FullName>
    </TemplateRef>
    <TxnDate>2013-07-31</TxnDate>
    <RefNumber>12324</RefNumber>
    <BillAddress>
     <Addr1>Customers FullName</Addr1>
     <Addr2>123 Test Dr</Addr2>
     <Addr3></Addr3>
     <City>Customer City</City>
     <State>AL</State>
     <PostalCode>12323</PostalCode>
     <Country>US</Country>
    </BillAddress>
    <ShipAddress>
     <Addr1>Customers FullName</Addr1>
     <Addr2>123 Test Dr</Addr2>
     <Addr3></Addr3>
     <City>Customer City</City>
     <State>AL</State>
     <PostalCode>12323</PostalCode>
     <Country>US</Country>
    </ShipAddress>
    <IsPending>false</IsPending>
    <IsToBePrinted>false</IsToBePrinted>
    <IsToBeEmailed>false</IsToBeEmailed>
    <InvoiceLineAdd>
     <ItemRef>
      <ListID>80000540-1339572998</ListID>
     </ItemRef>
     <Desc>Item Desc</Desc>
     <Quantity>1</Quantity>
     <Rate>39.27</Rate>
     <SalesTaxCodeRef>
      <FullName>SBT</FullName>
     </SalesTaxCodeRef>
    </InvoiceLineAdd>
   </InvoiceAdd>
  </InvoiceAddRq>
 </QBXMLMsgsRq>
</QBXML>
Was it helpful?

Solution

For non-USA versions of QuickBooks (CA, UK, etc.):

What you have should work, ASSUMING that the Sales Tax Code "SBT" is correctly mapped to a tax rate in your tax preferences within QuickBooks.

For USA versions of QuickBooks:

Sales tax codes just indicate whether something is TAXable, or NONtaxable. They do NOT actually indicate any tax amount, or force tax to be recorded/charged.

In addition to the Sales tax code, you also need to specify an ItemSalesTaxRef, which is a reference to a specific tax item (a specific tax rate, e.g. 7%).

...
<ItemSalesTaxRef>
  <FullName>My Existing Tax Item Name</FullName>
</ItemSalesTaxRef>
<IsToBePrinted>true</IsToBePrinted>
...

OTHER TIPS

CHeck your XML with the SDK Validator.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top