按升序对客户响应进行排序,快速在线PHP API


Sort Customer response in ascending order, quickbooks online PHP API

从下载代码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_IP_Service_Customer对象([_last_request:protected]=>岗位https://qbo.intuit.com/qbo32/resource/customers/v2/739135155HTTP://1.1内容类型:application/x-www-form-urlencoded授权:OAuth realm=",OAuth_signature_method="HMAC-SHA1",oaauth_signature="aYDo4x%2BzncJu5zr0E9qthrzjJGg%3D",oaAuth_nonce="I06pZ",oaout_timestamp="1375681233",oath_token="qyprdRTLD08zozgugfGLF1R3agdRB2U3TYEUdhhPPLGOZq",oaut_consumer_key="qypardvBrNnwXryRrxd1elZxVikvNG3",OAuth_version i="1.0"内容长度:63

PageNum=1&每页的结果=25&排序=上次更新时间+最旧到最新[_last_response:protected]=>HTTP/1.1 400错误请求日期:2013年8月5日星期一05:40:34 GMT服务器:Apache设置Cookie:qbouid=10.129.32.5.1375681234314737;路径=/;过期=2014年8月5日星期二格林尼治标准时间05:40:34;domain=.intuit.comVary:接受编码内容编码:gzip内容长度:248连接:关闭内容类型:application/xml

<?xml version="1.0"encoding="UTF-8"standalone="yes">lt;FaultInfo xmlns="http://www.intuit.com/sb/cdm/baseexceptionmodel/xsd"><消息>排序条件中的属性名称无效:LastUpdatedTime<消息>lt;错误代码>BAD_QUERY_REQUEST<错误代码>lt;原因>QUERY_INVALID_SORT_CRITERIA<原因>lt/FaultInfo>[_last_debug:protected]=>大堆([QuickBooks_IP]=>大堆([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>

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

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

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