Getting Not Authorized on API Call


Hi, I am trying to make a call to Paypal's REST API to list transactions.  I am using PHP, have a business account, have created a new app in developer portal and I do get back an access token from my token call.  I take that access token and make a call with that token in header as the documentation states.  It returns this error:


{"name":"NOT_AUTHORIZED","debug_id":"7587f9e973334","message":"Authorization failed due to insufficient permissions.","details":[{"issue":"NOT_AUTHORIZED","description":"Authorization failed due to insufficient permissions."}]}


Here's the code:

	$URL_LISTTRX = "[Removed. Phone #s not permitted]amp;transaction_status=S&transaction_type=T0002&fields=all&page_size=100&page=1";
        $ch = curl_init();
	curl_setopt($ch, CURLOPT_URL,$URL_LISTTRX);
        curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' );
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_HTTPHEADER, array(
            "Authorization: Bearer $access_token",
            'Content-Type: application/json',
			'Accept: application/json'));
	$result = curl_exec($ch);
	$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
	echo $result;


Login to Me Too


It removed some of the URL above assuming it was a phone number.  It assumed wrong.  It was only a timestamp.

Login to Me Too


Good day @rightway77 


Thank you for posting to the PayPal community.


I would suggest to please contact your website developer or the third party eCommerce support to cross check your using same SANDBOX/LIVE  REST API Credentials(Client ID & Secret) while performing the below API calls. 


Also, If a third-party eCommerce partner is performing API operation on your behalf, you(i.e merchant) should be on-boarded and necessary API permissions should be granted to the Partner(API Caller). 


Merchants can manually grant permission to a third-party eCommerce to access specific information in your PayPal account and perform PayPal API operations on your behalf.


Login >> Settings >> Account Settings >> Website payments >> API Access >> Pre-built payment solution >> Grant API permission >> contact your "Third party software eCommerce" for Third Party Permission Username >> enter the username.


Direct link -



If you are still experiencing issues, please create an MTS ticket via the following URL - . Please ensure that you provide detailed information and error details when submitting the ticket.




PayPal MTS


If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

Login to Me Too

Haven't Found your Answer?

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