OAuth
ObtainToken
Returns an OAuth access token.
The endpoint supports distinct methods of obtaining OAuth access tokens. Applications specify a method by adding the grant_type parameter in the request and also provide relevant information.
Note: Regardless of the method application specified, the endpoint always returns two items; an OAuth access token and a refresh token in the response.
OAuth tokens should only live on secure servers. Application clients should never interact directly with OAuth tokens.
post/oauth2/token
Request body
Example request
{
"request_body": {
"client_id": "APPLICATION_ID",
"client_secret": "APPLICATION_SECRET",
"code": "CODE_FROM_AUTHORIZE",
"grant_type": "authorization_code"
}
}Response
Success
Example response
{
"access_token": "ACCESS_TOKEN",
"expires_at": "2006-01-02T15:04:05Z",
"merchant_id": "MERCHANT_ID",
"refresh_token": "REFRESH_TOKEN",
"token_type": "bearer"
}