<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>thread Re: Pagination broken using List Payments API with &amp;quot;me&amp;quot; location? in Archived Discussions (Read Only)</title>
    <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Pagination-broken-using-List-Payments-API-with-quot-me-quot/m-p/34993#M94644</link>
    <description>&lt;P&gt;Thank you for your well written question! We are looking into this now.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Apr 2017 21:45:52 GMT</pubDate>
    <dc:creator>tristansokol</dc:creator>
    <dc:date>2017-04-04T21:45:52Z</dc:date>
    <item>
      <title>Pagination broken using List Payments API with "me" location?</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Pagination-broken-using-List-Payments-API-with-quot-me-quot/m-p/34739#M94643</link>
      <description>&lt;P&gt;Hi, I'm pulling payments using the List Payments API, &lt;A href="https://docs.connect.squareup.com/api/connect/v1/?q=payments#navsection-payments" target="_self"&gt;documented here&lt;/A&gt;, and puzzled that pagination appears to&amp;nbsp;not be working for me when I use the "me" location_id. That API doc says "&lt;SPAN&gt;If you specify &lt;/SPAN&gt;&lt;CODE&gt;me&lt;/CODE&gt;&lt;SPAN&gt;, this endpoint returns payments aggregated from &lt;/SPAN&gt;&lt;EM&gt;all&lt;/EM&gt;&lt;SPAN&gt; of the business' locations" and also that "This endpoint might &lt;A href="https://docs.connect.squareup.com/api/connect/v1/?q=payments#pagination" target="_blank"&gt;paginate&lt;/A&gt; its results", so I believe pagination&amp;nbsp;is supposed to work in this case.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Test case below using 2 curl commands, the sole difference between the two is that one goes to /v1/ABC/payments and the other hits the /v1/me/payments endpoint. Both return proper data, but one returns a "Link" HTTP header as expected for pagination and one does not. Subbing in XXX for my Bearer token and ABC for one of my location_ids.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;EXPECTED CASE&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;curl -v -G -H "Authorization: Bearer XXX" https://connect.squareup.com/v1/ABC/payments --data-urlencode 'limit=200' --data-urlencode 'begin_time=2016-07-20T06:00:00-04:00' --data-urlencode 'end_time=2016-07-21T06:00:00-04:00' | python -mjson.tool | grep payment_url | wc -l
&amp;gt; GET /v1/ABC/payments?limit=200&amp;amp;begin_time=2016-07-20T06%3A00%3A00-04%3A00&amp;amp;end_time=2016-07-21T06%3A00%3A00-04%3A00 HTTP/1.1
&amp;gt; User-Agent: curl/7.26.0
&amp;gt; Host: connect.squareup.com
&amp;gt; Accept: */*
&amp;gt; Authorization: Bearer XXX
&amp;gt;
&amp;lt; HTTP/1.1 200 OK
&amp;lt; Content-Type: application/json
&amp;lt; Link: &amp;lt;https://connect.squareup.com/v1/ABC/payments?batch_token=5bYwycCRNdXkGO3kQqE6Zy1wI8jACMOU80G5qAjFzpgvyTX1E4pTYXmyaCmmGaN02owBEmAeFdkn67TvlD6uZzA5OHTo8yBj7tYnV5VLaE&amp;amp;begin_time=2016-07-20T10%3A00%3A00Z&amp;amp;end_time=2016-07-21T10%3A00%3A00Z&amp;amp;limit=200&amp;gt;;rel='next'
&amp;lt; Vary: Origin, Accept-Encoding
&amp;lt; X-Content-Type-Options: nosniff
&amp;lt; X-Download-Options: noopen
&amp;lt; X-Frame-Options: SAMEORIGIN
&amp;lt; X-Permitted-Cross-Domain-Policies: none
&amp;lt; X-Xss-Protection: 1; mode=block
&amp;lt; Date: Sat, 01 Apr 2017 21:33:03 GMT
&amp;lt; Transfer-Encoding: chunked
&amp;lt; Keep-Alive: timeout=60
&amp;lt; Strict-Transport-Security: max-age=631152000
&amp;lt;
{ [data not shown]
100 428k 0 428k 0 0 241k 0 --:--:-- 0:00:01 --:--:-- 259k
* Connection #0 to host connect.squareup.com left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
} [data not shown]
200&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UNEXPECTED CASE&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;curl -v -G -H "Authorization: Bearer XXX" https://connect.squareup.com/v1/me/payments --data-urlencode 'limit=200' --data-urlencode 'begin_time=2016-07-20T06:00:00-04:00' --data-urlencode 'end_time=2016-07-21T06:00:00-04:00' | python -mjson.tool | grep payment_url | wc -l
&amp;gt; GET /v1/me/payments?limit=200&amp;amp;begin_time=2016-07-20T06%3A00%3A00-04%3A00&amp;amp;end_time=2016-07-21T06%3A00%3A00-04%3A00 HTTP/1.1
&amp;gt; User-Agent: curl/7.26.0
&amp;gt; Host: connect.squareup.com
&amp;gt; Accept: */*
&amp;gt; Authorization: Bearer XXX
&amp;gt;
&amp;lt; HTTP/1.1 200 OK
&amp;lt; Content-Type: application/json
&amp;lt; Vary: Origin, Accept-Encoding
&amp;lt; X-Content-Type-Options: nosniff
&amp;lt; X-Download-Options: noopen
&amp;lt; X-Frame-Options: SAMEORIGIN
&amp;lt; X-Permitted-Cross-Domain-Policies: none
&amp;lt; X-Xss-Protection: 1; mode=block
&amp;lt; Date: Sat, 01 Apr 2017 21:30:03 GMT
&amp;lt; Transfer-Encoding: chunked
&amp;lt; Keep-Alive: timeout=60
&amp;lt; Strict-Transport-Security: max-age=631152000
&amp;lt;
{ [data not shown]
100 437k 0 437k 0 0 357k 0 --:--:-- 0:00:01 --:--:-- 367k
* Connection #0 to host connect.squareup.com left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
} [data not shown]
200&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;SUMMARY&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you can see above, I'm using wc to count the result data and both endpoints correctly return&amp;nbsp;200 transactions (as 200 is the set limit), however only the&amp;nbsp;&lt;SPAN&gt;/v1/ABC/payments endpoint properly returns the "Link" HTTP header indicating paginated results. The /v1/me/payments endpoint is&amp;nbsp;not returning a Link header for some reason I can't figure out.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Is this a known issue or expected behavior? The only other forum post I see on api pagination seems unrelated / user error.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Let me know if I can send over any additional info for debug.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;cheers,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;dan&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Apr 2017 22:11:29 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Pagination-broken-using-List-Payments-API-with-quot-me-quot/m-p/34739#M94643</guid>
      <dc:creator>aeronaut</dc:creator>
      <dc:date>2017-04-01T22:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination broken using List Payments API with "me" location?</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Pagination-broken-using-List-Payments-API-with-quot-me-quot/m-p/34993#M94644</link>
      <description>&lt;P&gt;Thank you for your well written question! We are looking into this now.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 21:45:52 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Pagination-broken-using-List-Payments-API-with-quot-me-quot/m-p/34993#M94644</guid>
      <dc:creator>tristansokol</dc:creator>
      <dc:date>2017-04-04T21:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination broken using List Payments API with "me" location?</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Pagination-broken-using-List-Payments-API-with-quot-me-quot/m-p/36095#M94645</link>
      <description>&lt;P&gt;Any update on this from Square engineers&amp;nbsp;&lt;a href="https://community.squareup.com/t5/user/viewprofilepage/user-id/32513"&gt;@tristansokol&lt;/a&gt;, or should I contact support directly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's not terribly comforting&amp;nbsp;for me to see an API that provides financial information producing incorrect results. Still not working for me.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 19:46:04 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Pagination-broken-using-List-Payments-API-with-quot-me-quot/m-p/36095#M94645</guid>
      <dc:creator>aeronaut</dc:creator>
      <dc:date>2017-04-19T19:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: Pagination broken using List Payments API with "me" location?</title>
      <link>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Pagination-broken-using-List-Payments-API-with-quot-me-quot/m-p/36105#M94646</link>
      <description>&lt;P&gt;Sorry for the delay. Our documentation incorrectly suggests that you can use the /me endopints for payments, but really they should only be used for employees. Please use the /location versions of the endpoints to get all of your payment history. We will be updating our documation soon.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for bringing this issue to our attention!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 22:18:19 GMT</pubDate>
      <guid>https://community.squareup.com/t5/Archived-Discussions-Read-Only/Pagination-broken-using-List-Payments-API-with-quot-me-quot/m-p/36105#M94646</guid>
      <dc:creator>tristansokol</dc:creator>
      <dc:date>2017-04-19T22:18:19Z</dc:date>
    </item>
  </channel>
</rss>

