One of our clients is unable to export an invoice to QuickBooks Online Harmony using the new v3 REST API. The error they get is "Business Validation Error: One or more transaction lines do not have a tax code associated with it. Please assign a tax code for those lines."
An example request and response are shown below.
I'm wondering:
For what it's worth, the client is based in Canada. Testing an invoice export with similar data for a non-Canadian company works fine. Thanks for the help.
EXAMPLE REQUEST:
<Invoice xmlns="http://schema.intuit.com/finance/v3" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<TxnDate>2014-03-12</TxnDate>
<PrivateNote>Some private note.</PrivateNote>
<Line>
<Description>My Description</Description>
<Amount>3333.33</Amount>
<DetailType>SalesItemLineDetail</DetailType>
<SalesItemLineDetail>
<ItemRef name="My Description">3</ItemRef>
<ClassRef name="3">3333</ClassRef>
</SalesItemLineDetail>
</Line>
<CustomerRef name="My Customer Name">33</CustomerRef>
<ClassRef name="3">3333</ClassRef>
</Invoice>
EXAMPLE RESPONSE:
<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2014-03-13T11:47:58.052-07:00">
<Fault type="ValidationFault">
<Error code="6000" element="">
<Message>A business validation error has occurred while processing your request</Message>
<Detail>Business Validation Error: One or more transaction lines do not have a tax code associated with it. Please assign a tax code for those lines.</Detail>
</Error>
</Fault>
</IntuitResponse>
I see that you have already enabled sales tax settings. The next thing you can do is create the invoice in the UI and then load it through the API as Matt suggested. Assign some tax to the invoice and Read it using API explorer. THis will give you an idea as to what is expected in the lines. This will definitely help you out with the correct tags you need to set.
Alternately refer to the docs with example request here- https://developer.intuit.com/docs/api/accounting#/complex-data-types
Global tax model- https://developer.intuit.com/docs/0100_accounting/0300_developer_guides/global_tax_model