Problem response of List-disputes api

nkondo
Contributor
Contributor

Hi, I trying to request for next dispute list page. (at Sandbox)
However, in the case of the remaining one item, an empty item is returned.

Is this a bug?

 

 

 

------- Response excerpt -------

###
## List disputes (page_size=default)
$ curl -X GET https://api.sandbox.paypal.com/v1/customer/disputes?dispute_state=REQUIRED_ACTION \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer ****"|jq

# response (page_size=default)
{
  "items": [
    {
      "dispute_id": "PP-D-14993",
        :
      (snip)
        :
    },
    {
      "dispute_id": "PP-D-14992",
        :
      (snip)
        :
    },
    {
      "dispute_id": "PP-D-14990",
        :
      (snip)
        :
    },
    {
      "dispute_id": "PP-D-14991",
        :
      (snip)
        :
    }
  ],
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/customer/disputes?dispute_state=REQUIRED_ACTION",
      "rel": "self",
      "method": "GET",
      "encType": "application/json"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/customer/disputes?dispute_state=REQUIRED_ACTION",
      "rel": "first",
      "method": "GET",
      "encType": "application/json"
    }
  ]
}

###
## List disputes (page_size=3 first)
$ curl -X GET https://api.sandbox.paypal.com/v1/customer/disputes?dispute_state=REQUIRED_ACTION\&page_size=3 \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer ****"|jq

# response (page_size=3 first)
{
  "items": [
    {
      "dispute_id": "PP-D-14993",
        :
      (snip)
        :
    },
    {
      "dispute_id": "PP-D-14992",
        :
      (snip)
        :
    },
    {
      "dispute_id": "PP-D-14990",
        :
      (snip)
        :
    }
  ],
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/customer/disputes?dispute_state=REQUIRED_ACTION&page_size=3",
      "rel": "self",
      "method": "GET",
      "encType": "application/json"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/customer/disputes?dispute_state=REQUIRED_ACTION&page_size=3",
      "rel": "first",
      "method": "GET",
      "encType": "application/json"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/customer/disputes?dispute_state=REQUIRED_ACTION&page_size=3&next_page_token=AAGWD-LhsrivF0eylPYSo.06RtOl0AOcwMRDjB511-b3917M1zmZiK8CqvahTmMEdOplgepHig3xvoimRyZTY6dXL92d6fJPYRjIOzH6CnASKiY=",
      "rel": "next",
      "method": "GET",
      "encType": "application/json"
    }
  ]
}

###
## List disputes (page_size=3 next)
$ curl -X GET https://api.sandbox.paypal.com/v1/customer/disputes?dispute_state=REQUIRED_ACTION\&page_size=3\&next_page_token=AAGWD-LhsrivF0eylPYSo.06RtOl0AOcwMRDjB511-b3917M1zmZiK8CqvahTmMEdOplgepHig3xvoimRyZTY6dXL92d6fJPYRjIOzH6CnASKiY= \
 -H "Content-Type: application/json" \
 -H "Authorization: Bearer ****"|jq

# response (page_size=3 next)
{
  "items": [],
  "links": [
    {
      "href": "https://api.sandbox.paypal.com/v1/customer/disputes?dispute_state=REQUIRED_ACTION&page_size=3&next_page_token=AAGWD-LhsrivF0eylPYSo.06RtOl0AOcwMRDjB511-b3917M1zmZiK8CqvahTmMEdOplgepHig3xvoimRyZTY6dXL92d6fJPYRjIOzH6CnASKiY=",
      "rel": "self",
      "method": "GET",
      "encType": "application/json"
    },
    {
      "href": "https://api.sandbox.paypal.com/v1/customer/disputes?dispute_state=REQUIRED_ACTION&page_size=3",
      "rel": "first",
      "method": "GET",
      "encType": "application/json"
    }
  ]
}

 

 

 

 

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.