- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Hi Experts!
I am new to square payment gateway. I have a php website where i want to charge a card for payment. I have created account in square and created an application. Now i want to test in sandbox mode, so i do have sandbox access token and location-id so far I am successful in generating the form, but when i submit the form i get the below error:
category AUTHENTICATION_ERROR
code UNAUTHORIZED
detail This request could not be authorized.
in response, So kindly guide me through this issue.
FYI, i generated the form via below link:
https://github.com/square/connect-api-examples/tree/master/templates/web-ui/payment-form/basic
Regards,
Ali
- Labels:
-
Connect API
-
Customers API
-
Payments
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Hey @ahsanali, I escalated your question to an API Specialist who confirmed that the AUTHENTICATION_ERROR message you received occurs when your Application ID and Personal Access Token do not match the information in your Developer Portal. Please make sure your Application ID and Personal Access Token are accurately updated in your sqpaymentform.js and your process-card files.
Feel free to also view our Developer Documentation for information on troubleshooting errors.
Seller Community Manager
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
FYI, i copied the error from the response of below url via browser console
https://pci-connect.squareup.com/v2/card-nonce?_=1545914[Redacted]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Hey @ahsanali, I escalated your question to an API Specialist who confirmed that the AUTHENTICATION_ERROR message you received occurs when your Application ID and Personal Access Token do not match the information in your Developer Portal. Please make sure your Application ID and Personal Access Token are accurately updated in your sqpaymentform.js and your process-card files.
Feel free to also view our Developer Documentation for information on troubleshooting errors.
Seller Community Manager
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Thanks Helen,
You were correct!
My bad,
added sandbox access token instead of sandbox application id
😞
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
I also face same issue as below
Square payment error: Error calling ListLocations: {"errors":[{"category":"AUTHENTICATION_ERROR","code":"UNAUTHORIZED","detail":"This request could not be authorized."}]}.
please let me know how to make sandbox request authorized for testing
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Hello, Helen.
I am stuck with problems and will be glad if you help me.
I am new to square and my problem is "request not authorized error".
I followed the steps of documentation, and if I click Pay button, then the javascript alerts "request not authorized error.".
Please help me.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Hi @Crystal-Moon! Thanks for reaching out. Make sure you have a completely verified and set up account that is approved to accept credit cards. If your identity has not been approved, then you will also receive that error.
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
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
@amchauhan Did you get a chance to read @Helen 's Best Answer above?
It looks like she reached out to the API team and posted the solution for this error there!
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
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
As per your suggestion I have follow all step still error remain same, at a time of listLocation menthod call
//get list of all locations
var listLocationsResponse = locationsApi.ListLocations();
above method throw exception as mentioned below
Square payment error: Error calling ListLocations: {"errors":[{"category":"AUTHENTICATION_ERROR","code":"UNAUTHORIZED","detail":"This request could not be authorized."}]}.
please let me know what can i do
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Hello,
I have configure sandbox application id and sandbox access token of default authorized account and also set return url to square sandbox account but still when LocationApi call, this exception accour
Square payment error: Error calling ListLocations: {"errors":[{"category":"AUTHENTICATION_ERROR","code":"UNAUTHORIZED","detail":"This request could not be authorized."}]}.
we can not fetch sandbox account locations through api call please let me know how to resolve this error
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Hi @amchauhan!
I reached out to the API channel and they said the error you're getting is due to having credentials mismatched or the base path URL not configured to the right environment.
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
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Im having the same problem. I've double checked, and even reissued the key
I got fed up and went and tried it on your page https://developer.squareup.com/explorer/square_2019-12-17/oauth-api/obtain-token
Same error. I'm copying and pasting the id and key, as well as the code thats returned from /oauth2/authorize
that said, the dashboard has malfunctioned SEVERAL times. firstly it was not saving my Redirect URL, I'd add it then try it would error, id come back and it would be cleared out.
About 6 times i had to enter it before it would save, now thats working.
DUring testing why this unauth error is coming up, I "replaced token" this also doesnt reflect an update, had to log out then back in two times before it created a new one..
Anyway SAME problem..
curl https://connect.squareup.com/oauth2/token \
-X POST \
-H 'Square-Version: 2019-12-17' \
-H 'Content-Type: application/json' \
-d '{
"client_id": "sq0idp-Lno1QXpjx8Z2Avemg3orUg",
"client_secret": "DIRECTCOPYANDPASTE",
"grant_type": "authorization_code",
"code": "sq0cgp-B2KYptDrmgYoZ3Kii1M1dw"
}'
cache-control: no-cache
content-length: 70
content-type: application/json
date: Sat, 16 May 2020 23:02:53 GMT
{
"message": "Not Authorized",
"type": "service.not_authorized"
}
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
I'm also having the same issue. Is there any sort of permission that needs to be granted?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report
- Subscribe to RSS Feed
- Mark Thread as New
- Mark Thread as Read
- Float this Thread for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
@ashc gave some insight provided by the API Team above. If you still need help, reach out to our Support Team. From there, your case will be escalated to our API Team.
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