Quickbooks API和检测已删除的项目

时间:2014-07-17 18:20:24

标签: quickbooks

我正在使用Quickbooks XML API导入销售订单,商品和客户。一切都很好,但我还没弄清楚如何处理Quickbooks中删除的内容。在我的系统中查询导入的数据不是一种选择,因为我有20,000多个销售人员。我的问题是,Quickbooks是否有查询已删除的项目?

1 个答案:

答案 0 :(得分:6)

适用于Windows的QuickBooks:

如果您使用 QuickBooks for Windows ,则可以执行TxnDeletedQueryRq请求以获取最近删除的交易列表。

示例:

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="9.0"?>
<QBXML>
    <QBXMLMsgsRq onError="stopOnError">
        <TxnDeletedQueryRq>

            <!-- TxnDelType may have one of the following values: ARRefundCreditCard, Bill, BillPaymentCheck, BillPaymentCreditCard, BuildAssembly, Charge, Check, CreditCardCharge, CreditCardCredit, CreditMemo, Deposit, Estimate, InventoryAdjustment, Invoice, ItemReceipt, JournalEntry, PayrollLiabilityAdjustment [PRIVATE], PayrollPriorPayment [PRIVATE], PayrollYearToDateAdjustment [PRIVATE], PurchaseOrder, ReceivePayment, SalesOrder, SalesReceipt, SalesTaxPaymentCheck, TimeTracking, TransferInventory, VehicleMileage, VendorCredit -->

            <TxnDelType>Invoice</TxnDelType>
            <TxnDelType>ReceivePayment</TxnDelType>
        </TxnDeletedQueryRq>
    </QBXMLMsgsRq>
</QBXML>

此处的示例:

可以在QuickBooks OSR中找到包含所有选项/标志的完整语法:

QuickBooks Online:

如果您使用 QuickBooks Online ,则可以使用CDC请求轮询最近更改的数据,包括已删除的内容。

https://quickbooks.api.intuit.com/v3/company/1234/cdc?entities=Class,Item,Invoice&changedSince=2012-07-20T22:25:51-07:00

会返回类似的内容:

<IntuitResponse xmlns="http://schema.intuit.com/finance/v3" time="2013-04-03T10:36:19.393Z">
   <CDCResponse>
    <QueryResponse>
        <Customer>...
        </Customer>
        ...

其中一些可能包含status="Deleted"属性,以告知您已将其删除。