Adding invoice to QuickBooks Harmony, getting "Business Validation Error" related to taxes?

StackOverflow https://stackoverflow.com/questions/22391929

  •  14-06-2023
  •  | 
  •  

Pregunta

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:

  • Is this related to a sales tax setting that our client has set?
  • Which setting? (I'd like to be able to reproduce the setup on a test company)
  • Do we need to send additional data in the invoice add request to accommodate that setting?

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>
¿Fue útil?

Solución

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

Otros consejos

If you have sales tax enabled in QBO, then all line items in invoice need to have a TaxCodeRef, and there needs to be a TxnTaxDetail object on the invoice itself. You should be able to get the numerical values that need to go into these values from the TaxCode/TaxRate endpoints.

Your best bet is to create the invoice in the UI and then load it through the API so you can see what it's meant to look like.

I have run into this as well and while it took me forever to figure it out, the answer is simple.

If tax is enabled for the company, every line must have a tax code, whether there is tax applied or not. That means that there should be a tax code in the system for "no tax". (For Australia, this is called "OOS" or "Out Of Scope" - apparently which one you get depends on when you set up tax, so look for both!)

If there is $0 tax for a particular line, you must explicitly attach this no-tax tax code, and cannot leave it null.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top