Hey , i am testing my sandbox accesss token and location id to create Payment on API explorer . but i get error
{
“errors”: [
{
“category”: “AUTHENTICATION_ERROR”,
“code”: “UNAUTHORIZED”,
“detail”: “This request could not be authorized.”
}
]
}
import { SquareClient, SquareEnvironment } from “square”;
I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.
That looks like the correct request body. Have you double checked the configuration? The only way to get an unauthorized error is when something is misconfigured.
Oops – my issue (which is different from the original poster’s issue) is that my call to new SquareClient(), I was passing accessToken: ... when I should have passed token: ...