I'm trying to retrieve the list of payments received (sales) on behalf on an user using Oauth.
I can connect via Oauth successfully, but when I try to retrieve the list of payments with the following request:
r = requests.get(
'https://api.sandbox.paypal.com/v1/payments/payment',
headers={'authorization': 'Bearer {0}'.format(access_token)},
params={
'count': 100,
'sort_by': 'create_time',
'sort_order': 'desc'
}
)
I get an error from the server: PERMISSION_DENIED
{"name":"PERMISSION_DENIED","message":"No permission for the requested operation","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"33d30d1074b1e"}
I'm pretty sure it's related to the scopes I asked when connecting the customer (none for the tests) but when I try to use the following scope:
'scope': "openid https://api.paypal.com/v1/payments/.*"
I get the following error : "Scope invalid".
So, how can I retrieve a list of payments on behalf of a user? (just read access!)