0

从http://consolibyte.com/downloads/quickbooks-php-devkit/下载代码

下面是代码,我用来按升序检索客户

$Service = new QuickBooks_IPP_Service_Customer();

if ($creds['qb_flavor'] == QuickBooks_IPP_IDS::FLAVOR_ONLINE)
{
    $query = array('Sort' => 'LastUpdatedTime OldestToNewest');
}

$page = 1;
$limit = 25;
$list = $Service->findAll($Context, $realm, $query, $page, $limit);
print_r($Service);print_r($list);die;

回复:

QuickBooks_IPP_Service_Customer 对象( [_last_request:protected] => POST https://qbo.intuit.com/qbo32/resource/customers/v2/739135155 HTTP/1.1 内容类型:application/x-www-form-urlencoded 授权:OAuth 领域="", oauth_signature_method="HMAC-SHA1", oauth_signature="aYDo4x%2BzncJu5zr0E9qthrzjJGg%3D", oauth_nonce="I06pZ", oauth_timestamp="1375681233", oauth_token="qyprdrTTlD08zozgugfGLF1R3agdRB2U3TYEUdhhPPLGOZzq", oauth_consumer_key="qyprdvBrNnwXryRrxd1ElZxVikvNG3", oauth_version="1.0 " 内容长度:63

PageNum=1&ResultsPerPage=25&Sort=LastUpdatedTime+OldestToNewest [_last_response:protected] => HTTP/1.1 400 错误请求日期:星期一,2013 年 8 月 5 日 05:40:34 GMT 服务器:Apache Set-Cookie:qboeuid=10.129.32.5.1375681234314737;路径=/; expires=星期二,2014 年 8 月 5 日 05:40:34 GMT;domain=.intuit.com 变化:接受编码内容编码:gzip 内容长度:248 连接:关闭内容类型:应用程序/xml

<?xml version="1.0" encoding="UTF-8" Standalone="yes"?><FaultInfo xmlns="http://www.intuit.com/sb/cdm/baseexceptionmodel/xsd"><Message>无效排序标准中的属性名称:LastUpdatedTime </Message><ErrorCode>BAD_QUERY_REQUEST</ErrorCode><Cause>QUERY_INVALID_SORT_CRITERIA</Cause></FaultInfo> [_last_debug:protected] => Array ([QuickBooks_IPP] => Array ([http_request_response_duration] => 1.5505950450897)

    )

[_flavor:protected] =&gt; 
[_errcode:protected] =&gt; 0
[_errtext:protected] =&gt; 
[_errdetail:protected] =&gt; 

)

客户反应:

<!--?xml version="1.0" encoding="UTF-8" standalone="yes"?--><qbo:searchresults 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"><qbo:cdmcollections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Customers"><customer><id iddomain="QBO">15</id><synctoken>1</synctoken><metadata><createtime>2013-07-10T08:35:33-07:00</createtime><lastupdatedtime>2013-08-03T06:56:11-07:00</lastupdatedtime></metadata><name>Brown Elizabeth CON11</name><address><line1>123 Anywhere Street</line1><city>San Jose</city><country>USA</country><countrysubdivisioncode>CA</countrysubdivisioncode><postalcode>99999</postalcode><geocode>INVALID</geocode><tag>Billing</tag></address><phone><devicetype>Primary</devicetype><freeformnumber>(162) 938-2491</freeformnumber></phone><phone><devicetype>Mobile</devicetype><freeformnumber>(704) 297-3005</freeformnumber></phone><website><email><address>elizabeth_brown@company.com</address></email><givenname>Elizabeth</givenname><familyname>Brown</familyname><customfield xsi:type="BooleanTypeCustomField"><definitionid>Bill With Parent</definitionid><value>false</value></customfield><customfield xsi:type="StringTypeCustomField"><definitionid>Preferred Delivery Method</definitionid><value>EMAIL</value></customfield><showas>Brown Elizabeth CON11</showas><openbalance><amount>0</amount></openbalance></website></customer><customer><id iddomain="QBO">16</id><synctoken>1</synctoken><metadata><createtime>2013-07-10T08:35:36-07:00</createtime><lastupdatedtime>2013-08-06T00:22:56-07:00</lastupdatedtime></metadata><name>Davis Jennifer CON12</name><address><line1>123 Anywhere Street</line1><city>San Jose</city><country>USA</country><countrysubdivisioncode>CA</countrysubdivisioncode><postalcode>99999</postalcode><geocode>INVALID</geocode><tag>Billing</tag></address><phone><devicetype>Primary</devicetype><freeformnumber>(415) 668-0506</freeformnumber></phone><phone><devicetype>Mobile</devicetype><freeformnumber>(321) 403-8057</freeformnumber></phone><website><email><address>jennifer_davis@company.com</address></email><givenname>Jennifer</givenname><familyname>Davis</familyname><customfield xsi:type="BooleanTypeCustomField"><definitionid>Bill With Parent</definitionid><value>false</value></customfield><customfield xsi:type="StringTypeCustomField"><definitionid>Preferred Delivery Method</definitionid><value>EMAIL</value></customfield><showas>Davis Jennifer CON12</showas><openbalance><amount>528</amount></openbalance></website></customer><customer><id iddomain="QBO">12</id><synctoken>1</synctoken><metadata><createtime>2013-07-10T08:35:26-07:00</createtime><lastupdatedtime>2013-08-03T06:56:19-07:00</lastupdatedtime></metadata><name>Johnson Patricia CON13</name><address><line1>345 Sugar Blvd.</line1><city>San Francisco</city><country>USA</country><countrysubdivisioncode>CA</countrysubdivisioncode><postalcode>99999</postalcode><geocode>LAT=37.8887062,LNG=-122.4587342</geocode><tag>Billing</tag></address><phone><devicetype>Primary</devicetype><freeformnumber>(728) 984-9068</freeformnumber></phone><phone><devicetype>Mobile</devicetype><freeformnumber>(111) 598-3326</freeformnumber></phone><website><email><address>patricia_johnson@company.com</address></email><givenname>Patricia</givenname><familyname>Johnson</familyname><customfield xsi:type="BooleanTypeCustomField"><definitionid>Bill With Parent</definitionid><value>false</value></customfield><customfield xsi:type="StringTypeCustomField"><definitionid>Preferred Delivery Method</definitionid><value>EMAIL</value></customfield><showas>Johnson Patricia CON13</showas><openbalance><amount>0</amount></openbalance></website></customer><customer><id iddomain="QBO">22</id><synctoken>0</synctoken><metadata><createtime>2013-08-03T06:58:43-07:00</createtime><lastupdatedtime>2013-08-03T06:58:43-07:00</lastupdatedtime></metadata><name>Johnson Patricia CON2</name><address><line1>345 Sugar Blvd.</line1><city>San Francisco</city><country>USA</country><countrysubdivisioncode>CA</countrysubdivisioncode><postalcode>99999</postalcode><geocode>LAT=37.8887062,LNG=-122.4587342</geocode><tag>Billing</tag></address><phone><devicetype>Primary</devicetype><freeformnumber>(728) 984-9068</freeformnumber></phone><phone><devicetype>Mobile</devicetype><freeformnumber>(111) 598-3326</freeformnumber></phone><website><email><address>patricia_johnson@company.com</address></email><givenname>Patricia</givenname><familyname>Johnson</familyname><customfield xsi:type="BooleanTypeCustomField"><definitionid>Bill With Parent</definitionid><value>false</value></customfield><customfield xsi:type="StringTypeCustomField"><definitionid>Preferred Delivery Method</definitionid><value>EMAIL</value></customfield><showas>Johnson Patricia CON2</showas><openbalance><amount>0</amount></openbalance></website></customer><customer><id iddomain="QBO">14</id><synctoken>1</synctoken><metadata><createtime>2013-07-10T08:35:31-07:00</createtime><lastupdatedtime>2013-08-03T06:56:23-07:00</lastupdatedtime></metadata><name>Jones Barbara CON14</name><address><line1>123 Anywhere Street</line1><city>San Francisco</city><country>USA</country><countrysubdivisioncode>CA</countrysubdivisioncode><postalcode>99999</postalcode><geocode>INVALID</geocode><tag>Billing</tag></address><phone><devicetype>Primary</devicetype><freeformnumber>(237) 024-7627</freeformnumber></phone><phone><devicetype>Mobile</devicetype><freeformnumber>(841) 775-2009</freeformnumber></phone><website><email><address>barbara_jones@company.com</address></email><givenname>Barbara</givenname><familyname>Jones</familyname><customfield xsi:type="BooleanTypeCustomField"><definitionid>Bill With Parent</definitionid><value>false</value></customfield><customfield xsi:type="StringTypeCustomField"><definitionid>Preferred Delivery Method</definitionid><value>EMAIL</value></customfield><showas>Jones Barbara CON14</showas><openbalance><amount>0</amount></openbalance></website></customer><customer><id iddomain="QBO">24</id><synctoken>0</synctoken><metadata><createtime>2013-08-03T06:59:30-07:00</createtime><lastupdatedtime>2013-08-03T06:59:30-07:00</lastupdatedtime></metadata><name>Jones Barbara CON4</name><address><line1>123 Anywhere Street</line1><city>San Francisco</city><country>USA</country><countrysubdivisioncode>CA</countrysubdivisioncode><postalcode>99999</postalcode><geocode>INVALID</geocode><tag>Billing</tag></address><phone><devicetype>Primary</devicetype><freeformnumber>(237) 024-7627</freeformnumber></phone><phone><devicetype>Mobile</devicetype><freeformnumber>(841) 775-2009</freeformnumber></phone><website><email><address>barbara_jones@company.com</address></email><givenname>Barbara</givenname><familyname>Jones</familyname><customfield xsi:type="BooleanTypeCustomField"><definitionid>Bill With Parent</definitionid><value>false</value></customfield><customfield xsi:type="StringTypeCustomField"><definitionid>Preferred Delivery Method</definitionid><value>EMAIL</value></customfield><showas>Jones Barbara CON4</showas><openbalance><amount>0</amount></openbalance></website></customer><customer><id iddomain="QBO">17</id><synctoken>1</synctoken><metadata><createtime>2013-07-10T08:35:39-07:00</createtime><lastupdatedtime>2013-08-03T06:56:28-07:00</lastupdatedtime></metadata><name>Miller Maria CON15</name><address><line1>1715 Scott Dr</line1><city>San Mateo</city><country>USA</country><countrysubdivisioncode>CA</countrysubdivisioncode><postalcode>99999</postalcode><geocode>LAT=37.5662478,LNG=-122.2883717</geocode><tag>Billing</tag></address><phone><devicetype>Primary</devicetype><freeformnumber>(968) 916-1248</freeformnumber></phone><phone><devicetype>Mobile</devicetype><freeformnumber>(075) 401-6608</freeformnumber></phone><website><email><address>maria_miller@company.com</address></email><givenname>Maria</givenname><familyname>Miller</familyname><customfield xsi:type="BooleanTypeCustomField"><definitionid>Bill With Parent</definitionid><value>false</value></customfield><customfield xsi:type="StringTypeCustomField"><definitionid>Preferred Delivery Method</definitionid><value>EMAIL</value></customfield><showas>Miller Maria CON15</showas><openbalance><amount>0</amount></openbalance></website></customer><customer><id iddomain="QBO">23</id><synctoken>0</synctoken><metadata><createtime>2013-08-03T06:59:09-07:00</createtime><lastupdatedtime>2013-08-06T00:23:13-07:00</lastupdatedtime></metadata><name>Miller Maria CON7</name><address><line1>1715 Scott Dr</line1><city>San Mateo</city><country>USA</country><countrysubdivisioncode>CA</countrysubdivisioncode><postalcode>99999</postalcode><geocode>LAT=37.5662478,LNG=-122.2883717</geocode><tag>Billing</tag></address><phone><devicetype>Primary</devicetype><freeformnumber>(968) 916-1248</freeformnumber></phone><phone><devicetype>Mobile</devicetype><freeformnumber>(075) 401-6608</freeformnumber></phone><website><email><address>maria_miller@company.com</address></email><givenname>Maria</givenname><familyname>Miller</familyname><customfield xsi:type="BooleanTypeCustomField"><definitionid>Bill With Parent</definitionid><value>false</value></customfield><customfield xsi:type="StringTypeCustomField"><definitionid>Preferred Delivery Method</definitionid><value>EMAIL</value></customfield><showas>Miller Maria CON7</showas><openbalance><amount>10</amount></openbalance></website></customer><customer><id iddomain="QBO">19</id><synctoken>1</synctoken><metadata><createtime>2013-07-10T08:35:43-07:00</createtime><lastupdatedtime>2013-08-03T06:56:32-07:00</lastupdatedtime></metadata><name>Moore Margaret CON16</name><address><line1>123 Anywhere Street</line1><city>San Francisco</city><country>USA</country><countrysubdivisioncode>CA</countrysubdivisioncode><postalcode>99999</postalcode><geocode>INVALID</geocode><tag>Billing</tag></address><phone><devicetype>Primary</devicetype><freeformnumber>(381) 260-9729</freeformnumber></phone><phone><devicetype>Mobile</devicetype><freeformnumber>(731) 228-7024</freeformnumber></phone><website><email><address>margaret_moore@company.com</address></email><givenname>Margaret</givenname><familyname>Moore</familyname><customfield xsi:type="BooleanTypeCustomField"><definitionid>Bill With Parent</definitionid><value>false</value></customfield><customfield xsi:type="StringTypeCustomField"><definitionid>Preferred Delivery Method</definitionid><value>EMAIL</value></customfield><showas>Moore Margaret CON16</showas><openbalance><amount>0</amount></openbalance></website></customer><customer><id iddomain="QBO">21</id><synctoken>0</synctoken><metadata><createtime>2013-08-03T06:58:21-07:00</createtime><lastupdatedtime>2013-08-03T06:58:21-07:00</lastupdatedtime></metadata><name>Moore Margaret CON9</name><address><line1>123 Anywhere Street</line1><city>San Francisco</city><country>USA</country><countrysubdivisioncode>CA</countrysubdivisioncode><postalcode>99999</postalcode><geocode>INVALID</geocode><tag>Billing</tag></address><phone><devicetype>Primary</devicetype><freeformnumber>(381) 260-9729</freeformnumber></phone><phone><devicetype>Mobile</devicetype><freeformnumber>(731) 228-7024</freeformnumber></phone><website><email><address>margaret_moore@company.com</address></email><givenname>Margaret</givenname><familyname>Moore</familyname><customfield xsi:type="BooleanTypeCustomField"><definitionid>Bill With Parent</definitionid><value>false</value></customfield><customfield xsi:type="StringTypeCustomField"><definitionid>Preferred Delivery Method</definitionid><value>EMAIL</value></customfield><showas>Moore Margaret CON9</showas><openbalance><amount>0</amount></openbalance></website></customer><customer><id iddomain="QBO">11</id><synctoken>1</synctoken><metadata><createtime>2013-07-10T08:35:23-07:00</createtime><lastupdatedtime>2013-08-03T06:56:36-07:00</lastupdatedtime></metadata><name>Smith Mary CON17</name><address><line1>1715 Scott Dr</line1><city>Sunnyvale</city><country>USA</country><countrysubdivisioncode>CA</countrysubdivisioncode><postalcode>99999</postalcode><geocode>LAT=37.3681306,LNG=-122.0306042</geocode><tag>Billing</tag></address><phone><devicetype>Primary</devicetype><freeformnumber>(077) 885-6854</freeformnumber></phone><phone><devicetype>Mobile</devicetype><freeformnumber>(721) 945-7563</freeformnumber></phone><website><email><address>mary_smith@company.com</address></email><givenname>Mary</givenname><familyname>Smith</familyname><customfield xsi:type="BooleanTypeCustomField"><definitionid>Bill With Parent</definitionid><value>false</value></customfield><customfield xsi:type="StringTypeCustomField"><definitionid>Preferred Delivery Method</definitionid><value>EMAIL</value></customfield><showas>Smith Mary CON17</showas><openbalance><amount>0</amount></openbalance></website></customer><customer><id iddomain="QBO">25</id><synctoken>1</synctoken><metadata><createtime>2013-08-03T07:00:59-07:00</createtime><lastupdatedtime>2013-08-03T07:29:37-07:00</lastupdatedtime></metadata><name>Taylor Dorothy CON10</name><address><line1>1715 Scott Dr</line1><city>San Francisco</city><country>USA</country><countrysubdivisioncode>CA</countrysubdivisioncode><postalcode>99999</postalcode><geocode>LAT=37.7858312,LNG=-122.4382959</geocode><tag>Billing</tag></address><phone><devicetype>Primary</devicetype><freeformnumber>(175) 329-7081</freeformnumber></phone><phone><devicetype>Mobile</devicetype><freeformnumber>(935) 444-1766</freeformnumber></phone><website><email><address>dorothy_taylor@company.com</address></email><givenname>Dorothy</givenname><familyname>Taylor 1</familyname><customfield xsi:type="BooleanTypeCustomField"><definitionid>Bill With Parent</definitionid><value>false</value></customfield><customfield xsi:type="StringTypeCustomField"><definitionid>Preferred Delivery Method</definitionid><value>EMAIL</value></customfield><showas>Taylor Dorothy CON10</showas><openbalance><amount>0</amount></openbalance></website></customer><customer><id iddomain="QBO">20</id><synctoken>1</synctoken><metadata><createtime>2013-07-10T08:35:46-07:00</createtime><lastupdatedtime>2013-08-03T06:56:40-07:00</lastupdatedtime></metadata><name>Taylor Dorothy CON18</name><address><line1>1715 Scott Dr</line1><city>San Francisco</city><country>USA</country><countrysubdivisioncode>CA</countrysubdivisioncode><postalcode>99999</postalcode><geocode>LAT=37.7858312,LNG=-122.4382959</geocode><tag>Billing</tag></address><phone><devicetype>Primary</devicetype><freeformnumber>(175) 329-7081</freeformnumber></phone><phone><devicetype>Mobile</devicetype><freeformnumber>(935) 444-1766</freeformnumber></phone><website><email><address>dorothy_taylor@company.com</address></email><givenname>Dorothy</givenname><familyname>Taylor</familyname><customfield xsi:type="BooleanTypeCustomField"><definitionid>Bill With Parent</definitionid><value>false</value></customfield><customfield xsi:type="StringTypeCustomField"><definitionid>Preferred Delivery Method</definitionid><value>EMAIL</value></customfield><showas>Taylor Dorothy CON18</showas><openbalance><amount>0</amount></openbalance></website></customer><customer><id iddomain="QBO">13</id><synctoken>1</synctoken><metadata><createtime>2013-07-10T08:35:29-07:00</createtime><lastupdatedtime>2013-08-06T00:23:25-07:00</lastupdatedtime></metadata><name>Williams Linda CON19</name><address><line1>345 Sugar Blvd.</line1><city>San Francisco</city><country>USA</country><countrysubdivisioncode>CA</countrysubdivisioncode><postalcode>99999</postalcode><geocode>LAT=37.8887062,LNG=-122.4587342</geocode><tag>Billing</tag></address><phone><devicetype>Primary</devicetype><freeformnumber>(660) 958-6460</freeformnumber></phone><phone><devicetype>Mobile</devicetype><freeformnumber>(534) 043-4859</freeformnumber></phone><website><email><address>linda_williams@company.com</address></email><givenname>Linda</givenname><familyname>Williams</familyname><customfield xsi:type="BooleanTypeCustomField"><definitionid>Bill With Parent</definitionid><value>false</value></customfield><customfield xsi:type="StringTypeCustomField"><definitionid>Preferred Delivery Method</definitionid><value>EMAIL</value></customfield><showas>Williams Linda CON19</showas><openbalance><amount>391</amount></openbalance></website></customer><customer><id iddomain="QBO">26</id><synctoken>0</synctoken><metadata><createtime>2013-08-03T07:01:20-07:00</createtime><lastupdatedtime>2013-08-03T07:01:20-07:00</lastupdatedtime></metadata><name>Williams Linda CON3</name><address><line1>345 Sugar Blvd.</line1><city>San Francisco</city><country>USA</country><countrysubdivisioncode>CA</countrysubdivisioncode><postalcode>99999</postalcode><geocode>LAT=37.8887062,LNG=-122.4587342</geocode><tag>Billing</tag></address><phone><devicetype>Primary</devicetype><freeformnumber>(660) 958-6460</freeformnumber></phone><phone><devicetype>Mobile</devicetype><freeformnumber>(534) 043-4859</freeformnumber></phone><website><email><address>linda_williams@company.com</address></email><givenname>Linda</givenname><familyname>Williams</familyname><customfield xsi:type="BooleanTypeCustomField"><definitionid>Bill With Parent</definitionid><value>false</value></customfield><customfield xsi:type="StringTypeCustomField"><definitionid>Preferred Delivery Method</definitionid><value>EMAIL</value></customfield><showas>Williams Linda CON3</showas><openbalance><amount>0</amount></openbalance></website></customer><customer><id iddomain="QBO">18</id><synctoken>1</synctoken><metadata><createtime>2013-07-10T08:35:41-07:00</createtime><lastupdatedtime>2013-08-03T06:56:49-07:00</lastupdatedtime></metadata><name>Wilson Susan CON20</name><address><line1>999 Baker Way</line1><city>Sunnyvale</city><country>USA</country><countrysubdivisioncode>CA</countrysubdivisioncode><postalcode>99999</postalcode><geocode>LAT=37.3118253,LNG=-122.0549614</geocode><tag>Billing</tag></address><phone><devicetype>Primary</devicetype><freeformnumber>(422) 519-5069</freeformnumber></phone><phone><devicetype>Mobile</devicetype><freeformnumber>(333) 629-8844</freeformnumber></phone><website><email><address>susan_wilson@company.com</address></email><givenname>Susan</givenname><familyname>Wilson</familyname><customfield xsi:type="BooleanTypeCustomField"><definitionid>Bill With Parent</definitionid><value>false</value></customfield><customfield xsi:type="StringTypeCustomField"><definitionid>Preferred Delivery Method</definitionid><value>EMAIL</value></customfield><showas>Wilson Susan CON20</showas><openbalance><amount>0</amount></openbalance></website></customer></qbo:cdmcollections><qbo:count>16</qbo:count><qbo:currentpage>1</qbo:currentpage></qbo:searchresults>
4

1 回答 1

4

根据您的示例代码,您查询的是 CUSTOMERS,而不是 INVOICES。因此,我的其余回复将假设您正在谈论客户。

根据Intuit 关于Customer端点的文档,客户不支持按 LastUpdatedTime 字段排序

如果要对结果集进行排序,则必须使用支持的排序字段之一。

于 2013-08-05T10:56:27.023 回答