Refresh Token
Exchanges a refresh token for new access/refresh tokens. The previous refresh token is invalidated upon successful exchange. Token Renewal Policy:
- Use this endpoint to obtain a new access token using an unexpired refresh token.
- Refresh Token Validity: 1–30 days (default: 1 day). If the refresh token has expired, an authentication error is returned and the user must sign in again. Contact your Punchh representative to update this Punchh platform configuration.
- Access Token Validity: 5–60 minutes (default: 5 minutes). The response includes the
data.expires_inattribute indicating token lifetime in seconds. Contact your Punchh representative to update this Punchh platform configuration.
Previous Token Lifecycle on Refresh
- Refresh Token: The previously used refresh token is immediately invalidated (enforcing refresh token rotation) and cannot be reused.
- Access Token: A new access token is issued. If the previous access token has not yet expired, it remains valid until the end of its original validity period. Mobile and web applications should immediately replace the existing access token with the newly issued access token.
Headers
- Type: stringX
- Correlation - Id Optional caller-provided correlation ID; echoed in responses when present.
Body·
required
application/json
- Type: stringclientrequired
OAuth client ID provided by the business. Required to identify the client application for token refresh. The OAuth application must have the Advance Auth scope enabled.
- Type: stringrefresh
_token requiredRefresh token that the client application can use to get new tokens without re-authenticating. You can retrieve the value of the refresh_token from the response of the Sign Up/Sign In API.
Responses
- application/json
- application/json
- application/json
- application/json
- application/json
- application/json
Request Example for post/api2/refresh_token
curl https://SERVER_NAME_GOES_HERE/api2/refresh_token \
--request POST \
--header 'Content-Type: application/json' \
--data '{
"client": "CLIENT_GOES_HERE",
"refresh_token": "REFRESH_TOKEN_GOES_HERE"
}'
{
"data": {
"access_token": "ACCESS_TOKEN_GOES_HERE",
"token_type": "Bearer",
"refresh_token": "REFRESH_TOKEN_GOES_HERE",
"expires_in": 3600
}
}