Generating/Refreshing Token and Checking Order Status Using REST API in Java

zahmed1
New Community Member

I am working on an application for an organization. I want to be able to use code to generate an access token in Java and then use that token to get information about the latest customer order. Where can I find documentation or help on how to do this? 

For some background, I am able to generate the token using curl and Postman (instructions here: https://developer.paypal.com/api/rest/authentication/), however, I am unsure how to write code in Java that would allow me to refresh the the token when needed.  I tried using the code here, https://developer.paypal.com/braintree/docs/guides/extend/oauth/access-tokens/java,  but I'm receiving an error that states "Value passed for clientSecret is not a valid clientSecret." I am using what I believe to be a sandbox account so not sure if that has anything to do with it. With regards to framework, I am using Java Spring for the project but am testing the Braintree code in a regular Java project. Overall, I want to be able to generate a key for my account and then use API calls to see whether an order went through and then use that information in my app to show an administrator information about customer purchases. Would really appreciate any help with where I can find Java code to generate the token and then get the order status for the latest order.

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.