GET
/
access
/
token
/
refresh
Refresh a user access token
curl --request GET \
  --url https://authservice.withbenji.com/access/token/refresh \
  --header 'Content-Type: application/json' \
  --data '{
  "refresh_token": "<string>",
  "access_token": "<string>"
}'
{
    "code": "ok",
    "data": {
        "user_id": 1,
        "merchant_id": 1,
        "token_data": {
            "access_token": "0c371a1c-aa81-11ef-b28c-0a58a9feac02",
            "refresh_token": "05tghegts-aa81-sgte-hgte-u8nhgbvgtio",
            "access_token_expires_at": "Tue, 22 Oct 2024 21:57:02 GMT"
        }
    }
}
The Bearer token to be used on this API is your partner access token
refresh_token
string
required
The refresh token received from the exchange token API flow or previsouly received from refreshing an access token form this API
access_token
string
required
The current access token you are refreshing

Return values

user_id
integer
required
The Benji Platform ID associated with the user.
merchant_id
integer
required
Your system ID as specified on the Benji Platform
token_data
object
required
An object representing the access_token, refresh_token to use when using the Benji Platform APIs as well as the access token expiry date. Once an access token expires, you can use the refresh tpken to obtain a new access token silently without requiring the user to authenticate again.
{
    "code": "ok",
    "data": {
        "user_id": 1,
        "merchant_id": 1,
        "token_data": {
            "access_token": "0c371a1c-aa81-11ef-b28c-0a58a9feac02",
            "refresh_token": "05tghegts-aa81-sgte-hgte-u8nhgbvgtio",
            "access_token_expires_at": "Tue, 22 Oct 2024 21:57:02 GMT"
        }
    }
}
Access token are typically valid for 90 days. You can refresh an access token either before it expires proactively, or after calling an API and getting an expired_token 401 status code