Get SSO Token
Retrieves a client instance-level access token from your redirect URI after a successful user login through the Punchh-hosted authentication form. After you retrieve the client-level access token from this endpoint, supply it to the Fetch User Information API to retrieve a user-level authentication or access token. You can then use that user-level token to authenticate API calls for the remainder of the user's session.
Note: This endpoint is the second step in a multi-step authorization process. For more information, see SSO Flow for Web and Mobile.
- Type: stringAcceptrequired
Advertises which content types the client is able to understand
- Type: stringContent
- Type requiredSet this header to application/json.
- Type: stringUser
- Agent requiredFor details, see User Agent.
- Type: stringx
-pch -digest requiredThe signature for the API call
- Type: stringclient
_id requiredOAuth client ID of the business
- Type: stringclient
_secret requiredOAuth client secret of the business
- Type: stringcoderequired
Authorization code retrieved from the redirect URL after a successful user login. See SSO Flow for Web and Mobile
- Type: stringgrant
_type requiredGrant type the Punchh server will use to generate the access token
- Type: stringredirect
_uri requiredRedirect URI configured in the OAuth app where users are sent after a successful user login through the Punchh-hosted authentication form
- application/json
- application/json
curl https://SERVER_NAME_GOES_HERE.punchh.com/oauth/token \
--request POST \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'User-Agent: Punchh/OnlineOrder/1.0/Web/BrowserVersion/OS_Type' \
--header 'x-pch-digest: SIGNATURE_GOES_HERE' \
--data '{
"code": "TOKEN_GOES_HERE",
"client_id": "CLIENT_GOES_HERE",
"client_secret": "SECRET_GOES_HERE",
"grant_type": "authorization_code",
"redirect_uri": "https://redirect-uri.com/auth"
}'
{
"access_token": "ACCESS_TOKEN_GOES_HERE",
"token_type": "Bearer",
"refresh_token": "REFRESH_TOKEN_GOES_HERE",
"scope": "null",
"created_at": "1695818361"
}