Minimum expires_in?

darryl_ssdarryl_ss Member Posts: 112

Hi,

Does anyone know what the minimum expires_in value needs to be in order to refresh a token, do you have to wait until 0 or can it be refreshed before that?

Thanks

Tags:

Best Answer

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 925 moderator
    Accepted Answer

    Hi,

    Okay I understand now. I did a test and when the expires_in = 10 when you do a refresh it goes back to 1800.

Answers

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 925 moderator

    Hi @darryl_ss,

    Thank you for contacting us.

    You can't set this expires_in value yourself. After 3600 seconds, so 1 hour it needs to be refreshed.

  • darryl_ssdarryl_ss Member Posts: 112
    edited May 25

    Hi @LucienVersendaal

    Thanks for the response, no I get that I can't set it myself.

    What I am trying to find out is, at what value of expires_in do I need to send my token refresh request.

    Some api's you can refresh the token at any time and it will reset the expires_in value back to the max time. Others you have to wait until that expires_in time has nearly ran out.

    With the Lightspeed Retail API, is there a minimum expires_in value greater than 0 that will refresh the token and reset the expires_in to the max value (3600).

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 925 moderator

    Sorry I didn't understand, my bad.

    You can refresh the token after 10 seconds if you want. We don't have a minimum expires_in value.

  • darryl_ssdarryl_ss Member Posts: 112

    I think that maybe you still don't understand my question. Let try to be more explicit.

    1. A token request is sent
    2. A token is received, with an expires_in field at 3600
    3. If a new token request is sent when expires_in = 3000, the expires_in value does not reset to 3600 and continues it's countdown to 0. Also, a new token is not provided.

    At which value of expires_in is a new token provided and the expires_in value reset to 3600?

    Is it 'expires_in: 0' ?

    Or is there a more convenient point at which the token can be refreshed and the expires_in reset to 3600?

    I.e. do I have to wait for an error in my application to refresh my token or can I refresh it at say 'expires_in: 60'?

  • darryl_ssdarryl_ss Member Posts: 112

    Thanks @LucienVersendaal I appreciate the help 👍

  • LucienVersendaalLucienVersendaal Moderator, Lightspeed Staff Posts: 925 moderator

    Hi @darryl_ss,

    Okay perfect! Pleasure to help!

Sign In or Register to comment.