Kamran Tarique
Kamran Tarique

Reputation: 1

PayPal Access/Bearer token

How to get Access/Bearer Token from PayPal https://api-m.paypal.com/v1/oauth2/token API call using Live PayPal ClientID and Secret Key.

I have used below setup before callling API in Postman

Basic Auth type. Body tab = x-www-form-urlencoded. grant_type = client_credentials

I am getting below response when calling above API with Live ClientID and Secret Key using Postman

{ "error": "invalid_client", "error_description": "Client Authentication failed" }

And When using SandBox api https://api-m.sandbox.paypal.com/v1/oauth2/token with Live CliendID and Secret Key it generates token but not authenticated when calling with other Live PayPal APIs to get records.

Upvotes: 0

Views: 1536

Answers (1)

Preston PHX
Preston PHX

Reputation: 30377

When using SandBox api https://api-m.sandbox.paypal.com/v1/oauth2/token with Live CliendID and Secret Key it generates token

The only way to receive a token from api-m.sandbox.paypal.com is if you are actually using a sandbox Client ID and secret. There is no other possible way, the sandbox environment is completely separate from live.

Since your question is about how to obtain a live token from api-m.paypal.com , you must instead use a Client ID and secret from the "Live" tab of a REST API app in developer.paypal.com. (Clearly you are not using the correct credentials if you think the same ones work for sandbox.)

If you still think you are, what is the actual live Client ID you are using? Update your question with this information, and test it at https://developer.paypal.com/demo/checkout/#/pattern/client -- a live Client ID will necessarily lead to a live paypal.com checkout.

Upvotes: 0

Related Questions