I tried using https://connect.squareupsandbox.com/oauth2/token and https://connect.squareup.com/oauth2/token . Both are giving me the same error .
curl https://connect.squareupsandbox.com/oauth2/token \
-X POST \
-H 'Square-Version: 2023-01-19' \
-H 'Content-Type: application/json' \
-d '{
"code": "sandbox-sq0cgb-eXEaEE3gMDr5vI-xHF0jaQ",
"client_id": "sandbox-sq0idb-qxqHqp8Ewueh9VfCeqKNxA",
"client_secret": "<client_secret>",
"grant_type": "authorization_code"
}'
{
"message": "Not Authorized",
"type": "service.not_authorized"
}
Square Community