# Receive V1\_ERROR with code Uknown when trying to obtain token after redirecting from Oauth page

**URL:** <https://developer.squareup.com/forums/t/receive-v1-error-with-code-uknown-when-trying-to-obtain-token-after-redirecting-from-oauth-page/9678>\
**Category:** Questions\
**Tags:** sdk, sandbox, web-payments-sdk, oauth-api\
**Created:** [June 3, 2023, 5:52pm UTC](https://developer.squareup.com/forums/t/receive-v1-error-with-code-uknown-when-trying-to-obtain-token-after-redirecting-from-oauth-page/9678 "2023-06-03T17:52:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimavfox](https://avatars.discourse-cdn.com/v4/letter/d/c4cdca/32.png) [@dimavfox](https://developer.squareup.com/forums/u/dimavfox)\
**Post date:** [June 3, 2023, 5:52pm UTC](https://developer.squareup.com/forums/t/receive-v1-error-with-code-uknown-when-trying-to-obtain-token-after-redirecting-from-oauth-page/9678/1 "2023-06-03T17:52:03Z")

</div>

Here is what I receive after sending request to obtain token method with code recived from Oauth page.  
**“Square\Models\Error”:{“category”:“V1\_ERROR”,“code”:“Unknown”}}**

My Oauth link is below:  
[https://connect.squareupsandbox.com/oauth2/authorize?client\_id=[id]&scope=MERCHANT\_PROFILE\_READ,PAYMENTS\_READ,SETTLEMENTS\_READ,BANK\_ACCOUNTS\_READ,BANK\_ACCOUNTS\_READ&session=false&redirect\_uri=[uri]](https://connect.squareupsandbox.com/oauth2/authorize?client_id=%5Bid%5D&scope=MERCHANT_PROFILE_READ,PAYMENTS_READ,SETTLEMENTS_READ,BANK_ACCOUNTS_READ,BANK_ACCOUNTS_READ&session=false&redirect_uri=%5Buri%5D)

Code responsible for obtaining token (PHP):

```auto
$body = new ObtainTokenRequest($this->applicationId, 'authorization_code');
$body->setScopes([
        'MERCHANT_PROFILE_READ',
        'PAYMENTS_READ',
        'BANK_ACCOUNTS_READ',
        'SETTLEMENTS_READ',
        'BANK_ACCOUNTS_READ',
]);
$body->setClientSecret($this->applicationSecret);
$body->setRedirectUri($this->redirectUrl);
$body->setCode($code);

$apiResponse = $client->getOAuthApi()->obtainToken($body);

```

What can be wrong?

Also, I issued some problems with Log In, and receive the message that Square is blocked in Ukraine, maybe that is the reason of such behavior.

```auto
The owner of this website (developer.squareup.com) has banned the country or region your IP address is in (UA) from accessing this website.

```

Need urgent help!

---

<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:** [June 5, 2023, 4:10pm UTC](https://developer.squareup.com/forums/t/receive-v1-error-with-code-uknown-when-trying-to-obtain-token-after-redirecting-from-oauth-page/9678/2 "2023-06-05T16:10:20Z")

</div>

Yes, as per regulatory sanctions we do restrict traffic to certain regions. If your are in one of these sanctioned regions you won’t be able to use Square. 🙂

---

<div class="post-metadata">

**Author:** ![dimavfox](https://avatars.discourse-cdn.com/v4/letter/d/c4cdca/32.png) [@dimavfox](https://developer.squareup.com/forums/u/dimavfox)\
**Post date:** [June 5, 2023, 7:34pm UTC](https://developer.squareup.com/forums/t/receive-v1-error-with-code-uknown-when-trying-to-obtain-token-after-redirecting-from-oauth-page/9678/3 "2023-06-05T19:34:47Z")

</div>

How I can develop functionality for my customer located in USA if I am in Ukraine?

---

<div class="post-metadata">

**Author:** ![dimavfox](https://avatars.discourse-cdn.com/v4/letter/d/c4cdca/32.png) [@dimavfox](https://developer.squareup.com/forums/u/dimavfox)\
**Post date:** [June 7, 2023, 3:15pm UTC](https://developer.squareup.com/forums/t/receive-v1-error-with-code-uknown-when-trying-to-obtain-token-after-redirecting-from-oauth-page/9678/4 "2023-06-07T15:15:29Z")

</div>

@Bryan-Square please help me.

---

<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:** [June 7, 2023, 4:22pm UTC](https://developer.squareup.com/forums/t/receive-v1-error-with-code-uknown-when-trying-to-obtain-token-after-redirecting-from-oauth-page/9678/5 "2023-06-07T16:22:14Z")

</div>

At this time we don’t have a recommended work around since this is government mandated. 🙂

---

<div class="post-metadata">

**Author:** ![dimavfox](https://avatars.discourse-cdn.com/v4/letter/d/c4cdca/32.png) [@dimavfox](https://developer.squareup.com/forums/u/dimavfox)\
**Post date:** [June 11, 2023, 12:26pm UTC](https://developer.squareup.com/forums/t/receive-v1-error-with-code-uknown-when-trying-to-obtain-token-after-redirecting-from-oauth-page/9678/6 "2023-06-11T12:26:09Z")

</div>

Just install VPN and that’s it. With VPN it works. @Bryan-Square make some updates to API, so developers will know where to dig in to fix it. Because V1\_ERROR & Unknown doesn’t give any idea what’s wrong.
