# Unable to retrieve authorization code

**URL:** <https://developer.squareup.com/forums/t/unable-to-retrieve-authorization-code/1472>\
**Category:** Questions\
**Created:** [December 21, 2020, 6:14am UTC](https://developer.squareup.com/forums/t/unable-to-retrieve-authorization-code/1472 "2020-12-21T06:14:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dila](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@dila](https://developer.squareup.com/forums/u/dila)\
**Post date:** [December 21, 2020, 6:14am UTC](https://developer.squareup.com/forums/t/unable-to-retrieve-authorization-code/1472/1 "2020-12-21T06:14:33Z")

</div>

I created a sandbox account and tried to get AUTHORIZE\_CODE but could not.  
Following is the link:  
[https://squareup.com/oauth2/authorize?client\_id=sandbox-sq0idb-iL\_RUhdQOtzprJyfdUHdXw](https://squareup.com/oauth2/authorize?client_id=sandbox-sq0idb-iL_RUhdQOtzprJyfdUHdXw)

The document followed: [https://developer.squareup.com/reference/square/oauth-api/authorize#query\_\_property-client\_id](https://developer.squareup.com/reference/square/oauth-api/authorize#query__property-client_id)

---

<div class="post-metadata">

**Author:** ![sjosey](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/sjosey/32/40_2.png) [@sjosey](https://developer.squareup.com/forums/u/sjosey)\
**Post date:** [December 21, 2020, 6:37pm UTC](https://developer.squareup.com/forums/t/unable-to-retrieve-authorization-code/1472/2 "2020-12-21T18:37:58Z")

</div>

Hi @dila, welcome to the forums!

It looks like you are using a production url with a sandbox application id, which will not work. You should use `squareupsandbox.com...` instead of `squareup.com...`. So I think this URL should work:

[https://squareupsandbox.com/oauth2/authorize?client\_id=sandbox-sq0idb-iL\_RUhdQOtzprJyfdUHdXw](https://squareupsandbox.com/oauth2/authorize?client_id=sandbox-sq0idb-iL_RUhdQOtzprJyfdUHdXw)

Let me know if that helps or if you have additional questions.

---

<div class="post-metadata">

**Author:** ![dila](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@dila](https://developer.squareup.com/forums/u/dila)\
**Post date:** [December 22, 2020, 3:21am UTC](https://developer.squareup.com/forums/t/unable-to-retrieve-authorization-code/1472/3 "2020-12-22T03:21:01Z")

</div>

its not working. You can click on the link that you are suggesting.

---

<div class="post-metadata">

**Author:** ![dila](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@dila](https://developer.squareup.com/forums/u/dila)\
**Post date:** [December 22, 2020, 3:27am UTC](https://developer.squareup.com/forums/t/unable-to-retrieve-authorization-code/1472/4 "2020-12-22T03:27:21Z")

</div>

aright got it, the error is different now, suggesting to do other things , Thanks man

---

<div class="post-metadata">

**Author:** ![dila](https://avatars.discourse-cdn.com/v4/letter/d/b3f665/32.png) [@dila](https://developer.squareup.com/forums/u/dila)\
**Post date:** [January 3, 2021, 5:10am UTC](https://developer.squareup.com/forums/t/unable-to-retrieve-authorization-code/1472/5 "2021-01-03T05:10:47Z")

</div>

now it says 🙂

To start the OAuth flow for a sandbox account, first launch the seller test account from the Developer Dashboard. (Few days ago i was able to launch the seller test account, but now i do not find to do the same)

---

<div class="post-metadata">

**Author:** ![sjosey](https://sea1.discourse-cdn.com/square/forums/user_avatar/developer.squareup.com/sjosey/32/40_2.png) [@sjosey](https://developer.squareup.com/forums/u/sjosey)\
**Post date:** [January 4, 2021, 6:37pm UTC](https://developer.squareup.com/forums/t/unable-to-retrieve-authorization-code/1472/6 "2021-01-04T18:37:44Z")

</div>

You do need to launch the Sandbox Seller Dashboard first, which can be found on this page: [https://developer.squareup.com/apps](https://developer.squareup.com/apps) at the bottom under Sandbox Test Accounts, you need to click “Open” and leave it open; in another tab, try the OAuth link again.
