Clarification on sandbox (and live) access tokens

newnaturals
Contributor
Contributor

If I understand correctly, the sandbox access tokens are good for roughly 30 seconds? That means if you're chasing bugs in your code, you'd have to request a new access token each time you needed to test a change?

How does this work in the live environment? I'm working on integrating subscriptions into my website, and I need to display the available subscription plans for each product. I'd rather not have to hard-code the subscription plan numbers into the software, but to do a call for a list of available plans when a customer requests it.  Is an access token request going to be required every time a customer clicks on the dropdown for plans, in order to display the list?

Login to Me Too
2 REPLIES 2

not_here
Moderator
Moderator

Hi @newnaturals

 

I can answer half this question right now. Access tokens are valid for a minimum of 8 hours. Between sandbox and live, these two environments should be at parity. Does this help you answering your 2nd part of this question? 

 

This detail can be confirmed in our REST API Authentication sample code documentation. Note: The below number is reflective of seconds.

 

Screenshot 2023-04-28 at 3.42.38 PM.png

Login to Me Too

newnaturals
Contributor
Contributor

Thanks, eight hours is certainly better than 30 seconds. It doesn't solve the problem of having to obtain a new access key for each customer inquiry, but will help with debugging situations.

Login to Me Too

Haven't Found your Answer?

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