- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Exception when calling TransactionApi->charge:
C:\wamp\www\square_pay\v3\connect-php-sdk-master1\payment-process.php:38: object(stdClass)[6] public 'errors' => array (size=1) 0 => object(stdClass)[7] public 'category' => string 'AUTHENTICATION_ERROR' (length=20) public 'code' => string 'UNAUTHORIZED' (length=12) public 'detail' => string 'The `Authorization` http header of your request was malformed. The header value is expected to be of the format "Bearer TOKEN" (without quotation marks), where TOKEN is to be replaced with your access token (e.g. "Bearer ABC123def456GHI789jkl0"). For more information, see https://developer.squareup.com/docs/build-basics/using-rest-api#__set-the-headers__. If you are seeing this error message while using one of our officially supported SDKs, please report this to developers@squareup.com.' (length=491)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
@ndulg - Passing this up to our API team. We'll come back once we get a response. ๐
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
Exception when calling TransactionApi->charge:object(stdClass)#7 (1) { ["errors"]=> array(1) { [0]=> object(stdClass)#6 (3) { ["category"]=> string(20) "AUTHENTICATION_ERROR" ["code"]=> string(12) "UNAUTHORIZED" ["detail"]=> string(352) "The `Authorization` http header of your request was incorrect or expired. The header value is expected to be of the format "Bearer TOKEN" (without quotation marks), where TOKEN is a valid access token (e.g. "Bearer ABC123def456GHI789jkl0"). For more information, see https://developer.squareup.com/docs/build-basics/using-rest-api#__set-the-headers__ ." } } }
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
Does this thread that I moved you to help? @gautam
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
Unauthorized errors are typically due to incorrect access tokens. If you're using sandbox, make sure you're using https://connect.squareupsandbox.com
instead of https://connect.squareup.com
.
Another reason could be that your access token has expired. If the above doesnโt help them, send you their application ID as well as a code snippet of how you're setting your credentials in PHP (with the access token hidden).
Community Moderator, Square
Sign in and click Mark as Best Answer if my reply answers your question.
I got the same error:
{"errors": [{"code": "UNAUTHORIZED","detail": "Your request did not include an `Authorization` http header with an access token. The header value is expected to be of the format \"Bearer TOKEN\" (without quotation marks), where TOKEN is to be replaced with your access token (e.g. \"Bearer ABC123def456GHI789jkl0\"). For more information, see https://developer.squareup.com/docs/build-basics/using-rest-api#__set-the-headers__ . If you are seeing this error message while using one of our officially supported client libraries, please report this to developers@squareup.com.","category": "AUTHENTICATION_ERROR"}]}
Thuy Sinh Nha Trang: https://thuysinhnhatrang.com
MICROTRAN: https://microtran.org
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
My Opencart 3.0.3.7 uses Square. It was configured properly and worked fine before. Then I got an email asking to update the SSN/EIN. After I updated with a new EIN, Square stop working. I got similar error:
{"errors": [{"code": "UNAUTHORIZED","detail": "Your request did not include an `Authorization` http header with an access token. The header value is expected to be of the format \"Bearer TOKEN\" (without quotation marks), where TOKEN is to be replaced with your access token (e.g. \"Bearer ABC123def456GHI789jkl0\"). For more information, see https://developer.squareup.com/docs/build-basics/using-rest-api#__set-the-headers__ . If you are seeing this error message while using one of our officially supported client libraries, please report this to developers@squareup.com.","category": "AUTHENTICATION_ERROR"}]}
Please help.
Thuy Sinh Nha Trang: https://thuysinhnhatrang.com
MICROTRAN: https://microtran.org
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report