Create Access Token
curl -X POST \
$AUTH_HEADERS \
https://api.thanxsandbox.com/partner/oauth/token \
-d '{
"merchant_id": "k2lye10h32l5wzo",
"user_id": "wroeiu2304hfwf",
"expires_in": 3600
}'
{
"access_token": "945148251b603ae34561d90acfe4050e67494d6d1e65d4d3d52798407f03c0bd",
"token_type": "Bearer",
"scope": "passwordless",
"created_at": 1577836800,
"expires_in": 3600
}
Scope required: auth.create
This endpoint allows for the programmatic generation of an API access token for a given user. This access token can then be used to access the Consumer API.
Programmatic generation of access tokens on behalf of users is designed for Kiosk integrations to facilitate user reward redemption, hence the limited TTL of each token generated.
Parameters
Merchant ID
The number of seconds after which this access token will expire. Defaults to 900 seconds (15 minutes). The maximum allowed expiration for a partner-generated token is 3600 seconds (1 hour).
Response
The user’s access token, for use in accessing the Consumer API
The type of token, “Bearer”
The API scopes granted to the access token
The number of seconds since the epoch
The number of seconds after which this access token will expire
curl -X POST \
$AUTH_HEADERS \
https://api.thanxsandbox.com/partner/oauth/token \
-d '{
"merchant_id": "k2lye10h32l5wzo",
"user_id": "wroeiu2304hfwf",
"expires_in": 3600
}'
{
"access_token": "945148251b603ae34561d90acfe4050e67494d6d1e65d4d3d52798407f03c0bd",
"token_type": "Bearer",
"scope": "passwordless",
"created_at": 1577836800,
"expires_in": 3600
}