Reputation: 657
The question is about paypal API v2 and curl request, I'm getting "error":"invalid_client","error_description":"Client Authentication failed"
(tested with cCurl and PHP, both same invalid_client error)
I'm using the documentation https://developer.paypal.com/docs/api/orders/v2#orders_get and https://developer.paypal.com/docs/checkout/reference/server-integration/get-transaction/
curl -v -X GET https://api.sandbox.paypal.com/v2/checkout/orders/___orderID___ -H "Content-Type: application/json" -H "Authorization: Basic __id__:__secret__"
I'm still in sandbox phase.
I have the feeling I miss a step or something but unable to figure out what...
I went to https://developer.paypal.com/ in the section My apps & credentials were there is SANDBOX API CREDENTIALS with Client ID and Secret Secret is enabled and tried to create a new one....
Is someone knows what to do at this point ?
Upvotes: 0
Views: 638
Reputation: 6965
This documentation and this example of using basic authorization say that you need to base64 encode your id and secret. If you want to do this on the command line with curl:
curl -v -X GET https://api.sandbox.paypal.com/v2/checkout/orders/___orderID___ \
-H "Content-Type: application/json" \
-H "Authorization: Basic $(echo -n __id__:__secret__ | base64)"
Upvotes: 2