"TotalAmt" field is missing in the invoice

We use the Intuit API V2 to import invoices from QuickBooks Online.

We expect the TotalAmt field to be present on all accounts. There are several invoices that in the past had “TotalAmt”, but now the “TotalAmt” field is missing and the “Balance” is 0.

Is this a bug or an expected behavior?

Edit : this is one of the answers we received from the QuickBooks API (I changed only the indentation and replaced the real data with 3 points):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Invoice xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:qbo="http://www.intuit.com/sb/cdm/qbo" xmlns:qbp="http://www.intuit. com/sb/cdm/qbopayroll/v1"> <Id idDomain="QBO">36673</Id> <SyncToken>1</SyncToken> <MetaData> <CreateTime>2013-04-10T15:24:03-07:00</CreateTime> <LastUpdatedTime>2013-04-11T08:32:11-07:00</LastUpdatedTime> </MetaData> <Header> <DocNumber>...</DocNumber> <TxnDate>2013-04-10-07:00</TxnDate> <Note>...</Note> <CustomerId idDomain="QBO">464</CustomerId> <ToBePrinted>true</ToBePrinted> <ToBeEmailed>false</ToBeEmailed> <SalesTermId idDomain="QBO">1</SalesTermId> <DueDate>2013-04-10-07:00</DueDate> <BillAddr> <Line1>...</Line1> <City>...</City> <CountrySubDivisionCode>...</CountrySubDivisionCode> <PostalCode>...</PostalCode> <Tag>CUSTOMER</Tag> </BillAddr> <ShipAddr> <Line1>...</Line1> <City>...</City> <CountrySubDivisionCode>...</CountrySubDivisionCode> <PostalCode>...</PostalCode> <Tag>CUSTOMER</Tag> </ShipAddr> <ShipMethodId idDomain="QBO"/> <Balance>0.00</Balance> <DiscountTaxable>true</DiscountTaxable> </Header> <Line> <Desc>...</Desc> <Taxable>false</Taxable> <ItemId idDomain="QBO">5</ItemId> <UnitPrice>450</UnitPrice> <Qty>1</Qty> </Line> </Invoice> 
+4
source share
2 answers
 <Balance>0.00</Balance> 

He indicates that the amount associated with this account is 0. In this case, the response XML does not contain any “TotalAmt” field.

There may be several cases where "TotalAmt" does not turn on.

1.

I created an invoice with a sum of 0. PFB, which records the invoices in QBO and the corresponding XML response.

enter image description here

 <Invoice xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:qbp="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:qbo="http://www.intuit.com/sb/cdm/qbo"> <Id idDomain="QBO">50</Id> <SyncToken>0</SyncToken> <MetaData> <CreateTime>2013-07-01T01:59:37-07:00</CreateTime> <LastUpdatedTime>2013-07-01T01:59:37-07:00</LastUpdatedTime> </MetaData> <Header> <DocNumber>1016</DocNumber> <TxnDate>2013-07-01-07:00</TxnDate> <CustomerId idDomain="QBO">6</CustomerId> <ToBePrinted>false</ToBePrinted> <ToBeEmailed>true</ToBeEmailed> <SalesTermId idDomain="QBO">3</SalesTermId> <DueDate>2013-07-31-07:00</DueDate> <BillAddr> <Line1>Park Avenue NY</Line1> ... </BillAddr> <ShipAddr> <Line1>Park Avenue NY</Line1> ... </ShipAddr> <BillEmail> john_doe@digitalinsight.mint.com </BillEmail> <ShipMethodId idDomain="QBO" /> <Balance>0.00</Balance> <DiscountTaxable>true</DiscountTaxable> </Header> <Line> <Desc>Beer HB</Desc> <Taxable>true</Taxable> <ItemId idDomain="QBO">4</ItemId> </Line> </Invoice> 

2.

If you do not pass any value to the "Amount" field of the tag or If you skip this field at all.

Request and response PFB sample.

Request

 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Invoice xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:ns2="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:ns3="http://www.intuit.com/sb/cdm/qbo"> <Header> <Msg>Testing</Msg> <CustomerId>6</CustomerId> </Header> <Line> <Desc>Pens</Desc> <Amount></Amount> <Taxable>true</Taxable> <ItemId>3</ItemId> <UnitPrice>450</UnitPrice> <Qty>1</Qty> </Line> </Invoice> 

Answer

 <Invoice xmlns="http://www.intuit.com/sb/cdm/v2" xmlns:qbp="http://www.intuit.com/sb/cdm/qbopayroll/v1" xmlns:qbo="http://www.intuit.com/sb/cdm/qbo"> <Id idDomain="QBO">57</Id> <SyncToken>0</SyncToken> <MetaData> <CreateTime>2013-07-01T02:48:48-07:00</CreateTime> <LastUpdatedTime>2013-07-01T02:48:48-07:00</LastUpdatedTime> </MetaData> <Header> <DocNumber>1022</DocNumber> <TxnDate>2013-07-01-07:00</TxnDate> <Msg>Testing</Msg> <CustomerId idDomain="QBO">6</CustomerId> <ToBePrinted>false</ToBePrinted> <ToBeEmailed>false</ToBeEmailed> <DueDate>2013-07-01-07:00</DueDate> <BillAddr> <Line1>Park Avenue NY</Line1> ... </BillAddr> <ShipAddr> <Line1>Park Avenue NY</Line1> ... </ShipAddr> <ShipMethodId idDomain="QBO" /> <Balance>0.00</Balance> <DiscountTaxable>true</DiscountTaxable> </Header> <Line> <Desc>Pens</Desc> <Taxable>true</Taxable> <ItemId idDomain="QBO">3</ItemId> <UnitPrice>450</UnitPrice> <Qty>1</Qty> </Line> </Invoice> 

I assume the second is applicable in your case.

Please let me know if he answers your qts.

thanks

+1
source

It seems that the amount in the line is not set. Amount - a required field that must be set. Here is the document: https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0400_quickbooks_online/invoice

Total amount field will be calculated

thanks
Jarred

0
source

Source: https://habr.com/ru/post/1485994/


All Articles