按升序排序客户响应,quickbooks在线PHP API

时间:2013-08-05 05:41:54

标签: php quickbooks intuit-partner-platform quickbooks-online

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

页次= 1&安培; ResultsPerPage = 25安培;排序= LastUpdatedTime + OldestToNewest     [_last_response:protected] => HTTP / 1.1 400错误请求 日期:星期一,05八月2013 05:40:34 GMT 服务器:Apache Set-Cookie:qboeuid = 10.129.32.5.1375681234314737;路径= /; expires =星期二,05-Aug-14 05:40:34 GMT;域= .intuit.com 变化:接受编码 内容编码:gzip 内容长度:248 连接:关闭 Content-Type:application / xml

<?xml version =“1.0”encoding =“UTF-8”standalone =“yes”?>< FaultInfo xmlns =“http://www.intuit.com/sb/cdm/baseexceptionmodel/xsd “><消息>排序条件中的无效属性名称:LastUpdatedTime < /消息><错误码> BAD_QUERY_REQUEST< /错误码><原因和GT; QUERY_INVALID_SORT_CRITERIA< /原因和GT;< / FaultInfo>     [_last_debug:protected] =>排列         (             [QuickBooks_IPP] =>排列                 (                     [http_request_response_duration] => 1.5505950450897                 )

    )

[_flavor:protected] => 
[_errcode:protected] => 0
[_errtext:protected] => 
[_errdetail:protected] => 

客户响应:

<!--?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>

1 个答案:

答案 0 :(得分:4)

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

根据Intuit's documentation about the Customer endpoint,客户不支持按LastUpdatedTime字段排序

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