How do I get an Access Token?

To get an Access Token, you must make an OAuth2 token call using your application’s Client ID and Secret. You can locate your Client ID and Secret by navigating to the Apps & Credentials tab of your Developer Dashboard and selecting your desired application. Your credentials will be available under API Credentials.

There are a few ways to get a token, here is an example using the Postman app:

  • Set the verb to POST.
  • Enter https://api-m.sandbox.paypal.com/v1/oauth2/token as the request URL.
  • Select the Authorization tab.
  • From the TYPE list, select Basic Auth.
  • In the Username field, enter your client ID.
  • In the Password field, enter your client secret.
  • Select the Body tab.
  • Select the x-www-form-urlencoded option.
  • In the KEY field, enter grant_type.
  • In the VALUE field, enter client_credentials.
  • Click Send.

In the response, you'll receive an access token and the number of seconds the access token is valid for.

Note: The access token authenticates your app when calling PayPal REST APIs. You can call the PayPal OAuth API in any language. For more information and examples on how to get an Access Token, visit Get an Access Token.

See also:

How do I create REST API credentials?
Authentication
Refresh Token?

Autres manières d'obtenir de l'aide

Si vous acceptez les cookies, nous les utiliserons pour améliorer votre expérience et permettre à nos partenaires de vous présenter des publicités PayPal personnalisées lorsque vous visitez d'autres sites. En savoir plus et gérer les cookies