我们正在使用Intuit API V2从QuickBooks Online导入发票。
我们希望所有发票上都有“TotalAmt”字段。 有几张发票在过去的某个时刻存在“TotalAmt”,但现在“TotalAmt”字段丢失,“Balance”等于0。
这是错误还是预期的行为?
编辑:这是我们从QuickBooks API获得的响应之一(我只更改了缩进并用3个点替换了实际数据):
<?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>
答案 0 :(得分:1)
<Balance>0.00</Balance>
它表示与该发票关联的金额为0.在这种情况下,响应XML不包含任何“TotalAmt”字段。
可能有几种情况“TotalAmt”未被包括在内。
我创建了一张金额为0的发票.PBB表示QBO中的发票记录和相应的响应XML。
<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>
如果您未在标记的“金额”字段中传递任何值 要么 如果您完全跳过该字段。
PFB样品申请和回复。
请求
<?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>
响应
<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>
我想,第二个适用于您的情况。
如果它能回答你的问题,请告诉我。
由于
答案 1 :(得分:0)
看起来没有设置线中的金额。金额是需要设置的必填字段。以下是文档:https://developer.intuit.com/docs/0025_quickbooksapi/0050_data_services/v2/0400_quickbooks_online/invoice
将计算总金额字段
感谢
震动