Unable to make app live (using REST) #stuck in sandbox
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No matter how many times I change from Sandbox to Live, it doesnt 'stick'. I get an error: invalid_client (amongst other things) (see below).
I also include the following apiContext:
$apiContext->setConfig(
array(
'log.LogEnabled' => true,
'log.FileName' => 'PayPal.log',
'log.LogLevel' => 'DEBUG',
'mode' => 'live'
)
);
I also have business account.
But no change.
Am I missing a step?
Thanks
John
http://www.freshgroundeltham.co.uk/401%7B%22error%22:%22invalid_client%22,%22error_description%22:%22Client%20Authentication%20failed%22%7Dexception%20'PayPal/Exception/PayPalConnectionException'%20with%20message%20'Got%20Http%20response%20code%20401%20when%20accessing%20https://api.paypal.com/v1/oauth2/token.'%20in%20E:/Domains/freshgroundeltham.co.uk/wwwroot/assets/paypal/vendor/paypal/rest-api-sdk-php/lib/PayPal/Core/PayPalHttpConnection.php:202Stack%20trace:#0%20E:\Domains\freshgroundeltham.co.uk\wwwroot\assets\paypal\vendor\paypal\rest-api-sdk-php\lib\PayPal\Auth\OAuthTokenCredential.php(246):%20PayPal\Core\PayPalHttpConnection-%3Eexecute('grant_type=clie...')#1%20E:\Domains\freshgroundeltham.co.uk\wwwroot\assets\paypal\vendor\paypal\rest-api-sdk-php\lib\PayPal\Auth\OAuthTokenCredential.php(271):%20PayPal\Auth\OAuthTokenCredential-%3EgetToken(Array,%20'AQ-DD1L8VbwQ7W7...',%20'EGh8Uq3cd1Ya6Qf...',%20'grant_type=clie...')#2%20E:\Domains\freshgroundeltham.co.uk\wwwroot\assets\paypal\vendor\paypal\rest-api-sdk-php\lib\PayPal\Auth\OAuthTokenCredential.php(210):%20PayPal\Auth\OAuthTokenCredential-%3EgenerateAccessToken(Array,%20NULL)#3%20E:\Domains\freshgroundeltham.co.uk\wwwroot\assets\paypal\vendor\paypal\rest-api-sdk-php\lib\PayPal\Auth\OAuthTokenCredential.php(160):%20PayPal\Auth\OAuthTokenCredential-%3EupdateAccessToken(Array)#4%20E:\Domains\freshgroundeltham.co.uk\wwwroot\assets\paypal\vendor\paypal\rest-api-sdk-php\lib\PayPal\Handler\RestHandler.php(82):%20PayPal\Auth\OAuthTokenCredential-%3EgetAccessToken(Array)#5%20E:\Domains\freshgroundeltham.co.uk\wwwroot\assets\paypal\vendor\paypal\rest-api-sdk-php\lib\PayPal\Transport\PayPalRestCall.php(75):%20PayPal\Handler\RestHandler-%3Ehandle(Object(PayPal\Core\PayPalHttpConfig),%20'{%22intent%22:%22sale...',%20Array)#6%20E:\Domains\freshgroundeltham.co.uk\wwwroot\assets\paypal\vendor\paypal\rest-api-sdk-php\lib\PayPal\Common\PayPalResourceModel.php(104):%20PayPal\Transport\PayPalRestCall-%3Eexecute(Array,%20'/v1/payments/pa...',%20'POST',%20'{%22intent%22:%22sale...',%20NULL)#7%20E:\Domains\freshgroundeltham.co.uk\wwwroot\assets\paypal\vendor\paypal\rest-api-sdk-php\lib\PayPal\Api\Payment.php(577):%20PayPal\Common\PayPalResourceModel::executeCall('/v1/payments/pa...',%20'POST',%20'{%22intent%22:%22sale...',%20NULL,%20Object(PayPal\Rest\ApiContext),%20NULL)#8%20E:\Domains\freshgroundeltham.co.uk\wwwroot\payments.php(174):%20PayPal\Api\Payment-%3Ecreate(Object(PayPal\Rest\ApiContext))#9%20{main}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
You don't "change" from sandbox to live, both environments are available at all times when viewing a REST application. The "toggle" is only there to allow you to move from the default sandbox REST credentials page to the live REST credentials page.
"Invalid_client_id" is returned either because there is an issue with the "client_id" and "client_secret" credentials your attempting to use or your submitting the requests to the incorrect environment (ie: attempting to use a sandbox client_id and client_secret and you submit the request to our live environment.
## Request Access Token Endpoints
Sandbox : https://api.sandbox.paypal.com/v1/oauth2/token
Live : https://api.paypal.com/v1/oauth2/token
## Create Payment Endpoints
Sandbox : https://api.sandbox.paypal.com/v1/payments/payment
Live : https://api.paypal.com/v1/payments/payment
Was my post helpful? If so, please give me a kudos!

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Unable to issue a refund from our business sandbox account in Sandbox Environment
- Unable to test successful payments using sandbox personal accounts in NVP/SOAP APIs
- Unable to manually refund on the sandbox page in Sandbox Environment
- No transaction details found from the API of my sandbox account (Less than 3 years data) in Sandbox Environment
- Things don't appear to be working at the moment. Please try again later in Sandbox Environment