Reputation: 249
I'm trying to use PayPal REST API to get a list of payments. Typically these payments will have been made via eBay.
When I try the sandbox I can get a token, and then get a list of payments as expected. But when I switch to live the list is always empty.
For example, using curl:
curl https://api.paypal.com/v1/oauth2/token \
-H "Accept: application/json" \
-H "Accept-Language: en_US" \
-u "ASnXAXXXXXXXXXXXXXXXXXXXXXPP7sBaB:EGWXXXXXXXXXXXXXXXXXXXXXXXs-NU" \
-d "grant_type=client_credentials"
<response>
{"scope":"https://api.paypal.com/v1/payments/.* https://api.paypal.com/v1/vault /credit-card https://api.paypal.com/v1/vault/credit-card/.* openid","access_token":"dzXXXXXXXXXXXXXXXXXXHJs-XXXXXA","token_type":"Bearer","app_id":"APP-1JCXXXXXXXXXXX08","expires_in":28800}
Then I take the token from the response body and call the payments list resource:
curl -v -X GET https://api.paypal.com/v1/payments/payment \
-H "Content-Type:application/json" \
-H "Authorization: Bearer dzXXXXXXXXXXXXXXXXXXHJs-XXXXXA"
<response>
{"count":0}
There are actually payments in the account, so am I doing something wrong? I've not managed to google up any useful answers. I saw a suggestion on one post that maybe only payments made via the REST API are returned by the REST API? If that is the case (then the rest API would be of limited used) then is there another way to get a list of payments received? Again, I've had no luck in finding one in the paypal docs or google so far.
Thanks for any advice or help.
Upvotes: 3
Views: 1391
Reputation: 167
I also ran into this issue. Strangely, It seems that the PayPal REST API only returns results for payments made through the REST API. See here: https://stackoverflow.com/a/18139747
Classic API will remain the way to do this until the REST API is improved.
Upvotes: 6