HttpException: {"error":"invalid_client","error_description":"Client Authentication failed"}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
this posted and here
<Removed>
using Javascript SDK created sample live 0.01 sales SUCCESS
following the
ID/secret here live
<Removed>
<Removed>
PHP SDK
https://developer.paypal.com/docs/checkout/reference/server-integration/setup-sdk/
Where put this:
$request = new OrdersCreateRequest();
$request->headers["prefer"] = "return=representation";
???
BUT here >>>
<Removed>
GETTING: // WHERE is the error??? I used Live --- are headers the problem or is auth ???
Fatal error: Uncaught PayPalHttp\HttpException: {"error":"invalid_client","error_description":"Client Authentication failed"} in /home/polislatchiaptsv/public_html/main/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpClient.php:215 Stack trace: #0 /home/polislatchiaptsv/public_html/main/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpClient.php(100): PayPalHttp\HttpClient->parseResponse(Object(PayPalHttp\Curl)) #1 /home/polislatchiaptsv/public_html/main/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AuthorizationInjector.php(37): PayPalHttp\HttpClient->execute(Object(PayPalCheckoutSdk\Core\AccessTokenRequest)) #2 /home/polislatchiaptsv/public_html/main/vendor/paypal/paypal-checkout-sdk/lib/PayPalCheckoutSdk/Core/AuthorizationInjector.php(29): PayPalCheckoutSdk\Core\AuthorizationInjector->fetchAccessToken() #3 /home/polislatchiaptsv/public_html/main/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpClient.php(64): PayPalCheckoutSdk\Core\AuthorizationInjector->inject(Object(PayPalCheckoutSdk\Orders\OrdersGetRequest)) #4 /ho in /home/polislatchiaptsv/public_html/main/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpClient.php on line 215
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi there!
I'd love to know how you fixed this problem.
I've been experiencing the same problem for two days now, and I can't seem to go anywhere.
I'm still at development and testing phrase, and I'm trying to create an order. My client id
and client secret are correct for sure, but I keep getting exactly the same error message.
Thank you for sharing your solution.
Kind regards,
Alex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Make sure you use API Keys from proper Environment.
If use SDK:
use PayPalCheckoutSdk\Core\ProductionEnvironment;
use PayPalCheckoutSdk\Core\SandboxEnvironment;
$clientId = 'YOUR_PAYPAL_CLIENT_ID'; //'YOUR_PAYPAL_SANDBOX_CLIENT_ID';
$clientSecret = 'YOUR_PAYPAL_CLIENT_SECRET'; //'YOUR_PAYPAL_CLIENT_SANDBOX_SECRET'
/* sandbox */
$environment = new SandboxEnvironment($clientId, $clientSecret);
/* production */
$environment = new ProductionEnvironment($clientId, $clientSecret);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there anything else? I have $clientId $clientSecret supplied by PayPal and it still throws up this error. I know they work.
( ! ) Fatal error: Uncaught PayPalHttp\HttpException in D:\wamp64\www\scripts\PayPalCheckout-SDK\vendor\paypal\paypalhttp\lib\PayPalHttp\HttpClient.php on line 215( ! ) PayPalHttp\HttpException: in D:\wamp64\www\scripts\PayPalCheckout-SDK\vendor\paypal\paypalhttp\lib\PayPalHttp\HttpClient.php on line 215Call Stack# Time Memory Function Location
1 | 0.0007 | 422432 | {main}( ) | ...\index.php:0 |
2 | 0.0244 | 1762432 | Sample\CaptureIntentExamples\GetOrder::getOrder( ) | ...\index.php:104 |
3 | 0.0299 | 1968440 | PayPalCheckoutSdk\Core\PayPalHttpClient->execute( ) | ...\index.php:70 |
4 | 0.8049 | 2001832 | PayPalCheckoutSdk\Core\PayPalHttpClient->parseResponse( ) | ...\HttpClient.php:100 |
checkout v2 has been beating me up for a month now. I almost miss the mess of IPN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This answer was close to my solution,
The correct naming for ProductionEnvironment is LiveEnvironment
class PayPalClient:
def __init__(self):
self.client_id = client_id
self.client_secret = client_secret
self.environment = LiveEnvironment(client_id=self.client_id, client_secret=self.client_secret)
self.client = PayPalHttpClient(self.environment)

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Error message for obtaining access_token in REST APIs
- Google Pay SCA authentication dialog appears behind pay.google.com overlay in REST APIs
- Advanced checkout and no 3DS information in the response in REST APIs
- Paypal 3DS intigration error in NVP/SOAP APIs
- Help Resolving Declined PayPal Log In Application for Seller Authentication in REST APIs