按客户ID PHP Devkit过滤发票

时间:2013-04-23 05:09:29

标签: intuit-partner-platform

我正在尝试过滤使用QuickBook IPP和PHP devkit的发票,但出于某种原因,quickbooks不断发回一个空结果。我的代码如下:

$query = '<ContactIdSet><Id>340</Id></ContactIdSet>';
$invoices = $invoiceService->findAll($quickbooks->Context, $quickbooks->creds['qb_realm'], $query, 1, 999);

使用此代码,我的请求(减去Oauth信息)是:

POST https://services.intuit.com/sb/invoice/v2/538361885 HTTP/1.1
Content-Type: text/xml
Authorization: OAuth realm="",  oauth_signature_method="HMAC-SHA1",  oauth_signature="",  oauth_nonce="GAmtH",  oauth_timestamp="1366692972", oauth_token="", oauth_consumer_key="",  oauth_version="1.0"
Content-Length: 298

<?xml version="1.0" encoding="UTF-8"?>
<InvoiceQuery xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.intuit.com/sb/cdm/v2">
    <StartPage>1</StartPage>
    <ChunkSize>999</ChunkSize>
        <ContactIdSet>
            <Id>340</Id>
        </ContactIdSet>
      </InvoiceQuery>

但即使该客户ID下有发票,响应也没有发票:

HTTP/1.1 200 OK
Date: Tue, 23 Apr 2013 05:06:39 GMT
Server: Apache/2.2.22 (Unix)
ContextInitTime: 9
Response-Id: cb8b6eaa-f810-4fad-9f69-3485f400680d
IdRestateTime: 4
HeaderQueryTime: 4
Content-Encoding: gzip
HeaderDAOTime: 4
Response-App-Time: 62
Response-Routing-Time: 67
Content-Length: 133
Connection: close
Content-Type: text/xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><RestResponse xmlns="http://www.intuit.com/sb/cdm/v2"><Invoices/></RestResponse>

有关为什么quickbooks不会退回与该客户相关的发票的任何想法?

以下是我在使用 - &gt; findAll()

时显示发票存在的XML响应
HTTP/1.1 200 OK
Date: Tue, 23 Apr 2013 17:44:02 GMT
Server: Apache/2.2.22 (Unix)
LineQueryTime: 35
ContextInitTime: 94
Response-Id: 9b3d4e46-a6b5-4f90-81f4-3c42b0462330
AssemblingTime: 0
HeaderQueryTime: 91
Content-Encoding: gzip
HeaderDAOTime: 91
LineDAOTime: 35
Response-App-Time: 271
Response-Routing-Time: 276
Content-Length: 930
Connection: close
Content-Type: text/xml



<?xml version="1.0" encoding="UTF-8" standalone="yes"?><RestResponse xmlns="http://www.intuit.com/sb/cdm/v2"><Invoices><Invoice><Id idDomain="NG">681891</Id><SyncToken>3</SyncToken><MetaData><CreateTime>2013-04-18T03:13:26.796Z</CreateTime><LastUpdatedTime>2013-04-23T03:49:05.800Z</LastUpdatedTime></MetaData><ExternalKey idDomain="QB">1189</ExternalKey><Synchronized>true</Synchronized><Header><DocNumber>WEB000126</DocNumber><TxnDate>2013-02-28T00:00:00Z</TxnDate><Status>Paid</Status><CustomerId idDomain="QB">340</CustomerId><CustomerName>Test, Ray &amp; Teryl</CustomerName><RemitToId idDomain="QB">340</RemitToId><RemitToName>Test, Ray &amp; Teryl</RemitToName><ShipDate>2013-02-28T00:00:00Z</ShipDate><SubTotalAmt>375</SubTotalAmt><TaxRate>0</TaxRate><TaxAmt>0</TaxAmt><TotalAmt>375</TotalAmt><ToBePrinted>true</ToBePrinted><ToBeEmailed>false</ToBeEmailed><ARAccountId idDomain="QB">64</ARAccountId><ARAccountName>Accounts Receivable</ARAccountName><SalesTermId idDomain="QB">8</SalesTermId><SalesTermName>Due on 1st</SalesTermName><DueDate>2013-03-01T00:00:00Z</DueDate><BillAddr><Id idDomain="QB">00000000000001cg</Id><Line1>Ray &amp; Teryl Test</Line1><Line2>3290 Test Test</Line2><City>Stone Mountain</City><CountrySubDivisionCode>GA</CountrySubDivisionCode><PostalCode>30087</PostalCode><Default>true</Default><Tag>Billing</Tag></BillAddr><ShipAddr><Id idDomain="QB">00000000000003rW</Id><Default>false</Default><Tag>Shipping</Tag></ShipAddr><BillEmail>Test@Test.com</BillEmail><Balance>0</Balance></Header><Line><Id idDomain="QB">1191</Id><Desc>Conservatory Registration Fee</Desc><Amount>125</Amount><Taxable>false</Taxable><ItemId idDomain="QB">14</ItemId><ItemName>Artios Conservatory</ItemName><ItemType>Service</ItemType><UnitPrice>125</UnitPrice><Qty>1</Qty><SalesTaxCodeId idDomain="QB">2</SalesTaxCodeId><SalesTaxCodeName>Non</SalesTaxCodeName></Line><Line><Id idDomain="QB">1192</Id><Desc>Preparatory Registration Fee</Desc><Amount>125</Amount><Taxable>false</Taxable><ItemId idDomain="QB">142</ItemId><ItemName>Elem Prep Reg (5/1-8/31)</ItemName><ItemType>Service</ItemType><UnitPrice>125</UnitPrice><Qty>1</Qty><SalesTaxCodeId idDomain="QB">2</SalesTaxCodeId><SalesTaxCodeName>Non</SalesTaxCodeName></Line><Line><Id idDomain="QB">1193</Id><Desc>Preparatory Registration Fee</Desc><Amount>125</Amount><Taxable>false</Taxable><ItemId idDomain="QB">142</ItemId><ItemName>Elem Prep Reg (5/1-8/31)</ItemName><ItemType>Service</ItemType><UnitPrice>125</UnitPrice><Qty>1</Qty><SalesTaxCodeId idDomain="QB">2</SalesTaxCodeId><SalesTaxCodeName>Non</SalesTaxCodeName></Line><Line><Id idDomain="QB">1194</Id><Desc>PayPal Convenience Fee</Desc></Line></Invoice></Invoices></RestResponse>

1 个答案:

答案 0 :(得分:1)

要为问题添加答案,不支持API的v2中的特定过滤器。 您需要在应用程序中进行过滤

感谢
震动