# How can I retrieve my sandbox refresh token after logged into Square using developer account?

**URL:** <https://developer.squareup.com/forums/t/how-can-i-retrieve-my-sandbox-refresh-token-after-logged-into-square-using-developer-account/7265>\
**Category:** Questions\
**Tags:** oauth-api\
**Created:** [October 12, 2022, 3:41pm UTC](https://developer.squareup.com/forums/t/how-can-i-retrieve-my-sandbox-refresh-token-after-logged-into-square-using-developer-account/7265 "2022-10-12T15:41:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gayathri](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@Gayathri](https://developer.squareup.com/forums/u/Gayathri)\
**Post date:** [October 12, 2022, 3:41pm UTC](https://developer.squareup.com/forums/t/how-can-i-retrieve-my-sandbox-refresh-token-after-logged-into-square-using-developer-account/7265/1 "2022-10-12T15:41:42Z")

</div>

I have to use OAuth ObtainToken[[POST /oauth2/token - Square API Explorer](https://developer.squareup.com/explorer/square/oauth-api/obtain-token)] endpoint to generate a new access token in my implementation when my access token is expired. But when I created my developer account in Square, after creating a new application I could see access token in Credentials Tab and application id, secret in OAuth tab, not able to find the refresh token associated with this application’s access token. Could someone please help me on how can I retrieve my refresh token of my application? Thanks!

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [October 12, 2022, 4:33pm UTC](https://developer.squareup.com/forums/t/how-can-i-retrieve-my-sandbox-refresh-token-after-logged-into-square-using-developer-account/7265/2 "2022-10-12T16:33:00Z")

</div>

The credentials that you see in the Developer Dashboard are for pulling information from your Square account. They don’t expire which is why there isn’t a `refresh_token`. The `refresh_token` will be returned when calling `Obtain_token` too `authorize`. At that point you’ll need to securely store the tokens since the `refresh_token` isn’t available after that. 🙂

---

<div class="post-metadata">

**Author:** ![Gayathri](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@Gayathri](https://developer.squareup.com/forums/u/Gayathri)\
**Post date:** [October 13, 2022, 11:40am UTC](https://developer.squareup.com/forums/t/how-can-i-retrieve-my-sandbox-refresh-token-after-logged-into-square-using-developer-account/7265/3 "2022-10-13T11:40:35Z")

</div>

Thanks for the clarity @Bryan-Square . But, to execute the _Obtain\_token API_  
using developer account access token, I would need to pass in the refresh token as a payload since my _grant\_type_ I would need to choose as _refresh\_token_. To achieve this, somehow I need to have the refresh token in prior. Could you please assist here? Thanks!

---

<div class="post-metadata">

**Author:** ![Bryan-Square](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/bryan-square/32/38_2.png) [@Bryan-Square](https://developer.squareup.com/forums/u/Bryan-Square)\
**Post date:** [October 13, 2022, 5:41pm UTC](https://developer.squareup.com/forums/t/how-can-i-retrieve-my-sandbox-refresh-token-after-logged-into-square-using-developer-account/7265/4 "2022-10-13T17:41:34Z")

</div>

The `obtain_token` API call doesn’t require the access token. It just needs the application secret. If you’ve already made the initial `obtain_token` call with the `grant_type` of `authorize` you’ll get the `refresh_token` in the response. At that point you’ll need to securely store the token as it’s not retrievable via API call or in the Dashboard. 🙂
