我是销售基于网络的商业软件产品的公司的程序员,该产品可以让用户管理他们的业务。我们的系统还需要将所有财务信息同步到我们用户的桌面QuickBoooks。我们使用QB Web连接器来执行此操作。
当我向QB发送已经在我们系统中支付的发票时,首先我发送InvoiceAddRq。我在ARAccountRef字段中指定了确切的AR帐户名称。
当InvoiceAddRs返回时,如果statusSeverity为INFO且statusMessage为" Status OK",则我从XML读取TxnID并存储在我们的数据库中。
然后,当Web连接器发送下一个操作的请求时,我从数据库中读取相同的TxnID并发送一个ReceivePaymentAddRq,其中我在ARAccountRef中使用完全相同的AR帐户名,完全相同的客户名称在CustomerRef,在ReceivePaymentAddRq的AppliedToTxnAdd块中,我使用InvoiceAddRs中与TxnID相同的TxnID以及我在InvoiceAddRq的InvoiceLineAdd的金额字段中发送的PaymentAmount的相同发票总额。
(我们的InvoiceAddRq' s始终只包含一张发票行,其中包含我们系统中的发票总额。我们不会导入客户的个别物品。)
现在 - 有时候这种方法很好,但有时候ReceivePaymentAddRs包含错误"对象" ..."在请求中指定无法找到" - " ..."是我从最初的InvoiceAddRs获得的TxnID。
如果发生这种情况,客户会向我们核实相应的发票确实在他们的QB中,但未标记为付款。
另外,注意,我们的客户不使用多种货币,所有货币都是USD $,而且ReceivePaymentAddRq在InvoiceAddRq之后的几秒钟内发生,这意味着客户的公司中没有QB用户修改新插入的发票的时间。
为什么会这样?这是QB错误吗?
编辑:
2017-01-04 14:24:21
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="8.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<InvoiceAddRq>
<InvoiceAdd>
<CustomerRef>
<FullName>SILMAN DC</FullName>
</CustomerRef>
<ARAccountRef>
<FullName>Accounts Receivable:Accounts Receivable</FullName>
</ARAccountRef>
<TxnDate>2017-01-04</TxnDate>
<RefNumber>77671</RefNumber>
<BillAddress>
<Addr1>SILMAN DC</Addr1>
<Addr2>1053 31ST STREET NW</Addr2>
<Addr3/>
<Addr4/>
<City>WASHINGTON</City>
<State>DC</State>
<PostalCode>20007</PostalCode>
</BillAddress>
<ShipAddress>
<Addr1>1053 31ST STREET NW</Addr1>
<Addr2/>
<Addr3/>
<City>WASHINGTON</City>
<State>DC</State>
<PostalCode>20007</PostalCode>
</ShipAddress>
<PONumber/>
<TermsRef>
<FullName>Credit Card</FullName>
</TermsRef>
<InvoiceLineAdd>
<ItemRef>
<FullName>Invoice</FullName>
</ItemRef>
<Desc>Invoice</Desc>
<Quantity>1</Quantity>
<Amount>59.21</Amount>
</InvoiceLineAdd>
</InvoiceAdd>
</InvoiceAddRq>
</QBXMLMsgsRq>
</QBXML>
2017-01-04 14:24:21
<?xml version="1.0"?>
<QBXML>
<QBXMLMsgsRs>
<InvoiceAddRs statusCode="0" statusSeverity="Info" statusMessage="Status OK">
<InvoiceRet>
<TxnID>A13F8-1483561159</TxnID>
<TimeCreated>2017-01-04T15:19:19-05:00</TimeCreated>
<TimeModified>2017-01-04T15:19:19-05:00</TimeModified>
<EditSequence>1483561159</EditSequence>
<TxnNumber>133184</TxnNumber>
<CustomerRef>
<ListID>800005FF-1478123373</ListID>
<FullName>SILMAN DC</FullName>
</CustomerRef>
<ARAccountRef>
<ListID>80000025-1423671174</ListID>
<FullName>Accounts Receivable:Accounts Receivable</FullName>
</ARAccountRef>
<TemplateRef>
<ListID>80000003-1423576739</ListID>
<FullName>Intuit Service Invoice</FullName>
</TemplateRef>
<TxnDate>2017-01-04</TxnDate>
<RefNumber>77671</RefNumber>
<BillAddress>
<Addr1>SILMAN DC</Addr1>
<Addr2>1053 31ST STREET NW</Addr2>
<City>WASHINGTON</City>
<State>DC</State>
<PostalCode>20007</PostalCode>
</BillAddress>
<BillAddressBlock>
<Addr1>SILMAN DC</Addr1>
<Addr2>1053 31ST STREET NW</Addr2>
<Addr3>WASHINGTON, DC 20007</Addr3>
</BillAddressBlock>
<ShipAddress>
<Addr1>1053 31ST STREET NW</Addr1>
<City>WASHINGTON</City>
<State>DC</State>
<PostalCode>20007</PostalCode>
</ShipAddress>
<ShipAddressBlock>
<Addr1>1053 31ST STREET NW</Addr1>
<Addr2>WASHINGTON, DC 20007</Addr2>
</ShipAddressBlock>
<IsPending>false</IsPending>
<IsFinanceCharge>false</IsFinanceCharge>
<TermsRef>
<ListID>80000009-1425488517</ListID>
<FullName>Credit Card</FullName>
</TermsRef>
<DueDate>2017-01-04</DueDate>
<ShipDate>2017-01-04</ShipDate>
<Subtotal>59.21</Subtotal>
<SalesTaxPercentage>0.00</SalesTaxPercentage>
<SalesTaxTotal>0.00</SalesTaxTotal>
<AppliedAmount>0.00</AppliedAmount>
<BalanceRemaining>59.21</BalanceRemaining>
<IsPaid>false</IsPaid>
<IsToBePrinted>true</IsToBePrinted>
<IsToBeEmailed>false</IsToBeEmailed>
<InvoiceLineRet>
<TxnLineID>A13FA-1483561159</TxnLineID>
<ItemRef>
<ListID>80000003-1423676477</ListID>
<FullName>Invoice</FullName>
</ItemRef>
<Desc>Invoice</Desc>
<Quantity>1</Quantity>
<Rate>59.21</Rate>
<Amount>59.21</Amount>
<SalesTaxCodeRef>
<ListID>80000002-1423576739</ListID>
<FullName>Non</FullName>
</SalesTaxCodeRef>
</InvoiceLineRet>
</InvoiceRet>
</InvoiceAddRs>
</QBXMLMsgsRs>
</QBXML>
2017-01-04 14:25:33
<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="8.0"?>
<QBXML>
<QBXMLMsgsRq onError="stopOnError">
<ReceivePaymentAddRq>
<ReceivePaymentAdd>
<CustomerRef>
<FullName>SILMAN DC</FullName>
</CustomerRef>
<TotalAmount>59.21</TotalAmount>
<PaymentMethodRef>
<FullName>Credit Card</FullName>
</PaymentMethodRef>
<DepositToAccountRef>
<FullName>Undeposited Funds</FullName>
</DepositToAccountRef>
<AppliedToTxnAdd>
<TxnID>A13F8-1483561159</TxnID>
<PaymentAmount>59.21</PaymentAmount>
</AppliedToTxnAdd>
</ReceivePaymentAdd>
</ReceivePaymentAddRq>
</QBXMLMsgsRq>
</QBXML>
2017-01-04 14:25:33
<?xml version="1.0"?>
<QBXML>
<QBXMLMsgsRs>
<ReceivePaymentAddRs statusCode="3120" statusSeverity="Error" statusMessage="Object "A13F8-1483561159" specified in the request cannot be found. "/>
</QBXMLMsgsRs>
</QBXML>
好的,一次更正:我的ReceivePaymentAddRq中似乎没有包含ARAccountRef聚合。可能是因为IDN Unified OSR表示它是可选的。这是问题吗?请记住,它只会偶尔发生一次......
**编辑:
我在ReceivePaymentAddRq中添加了ARAccountRef聚合。仍然得到错误。