Skip to content

Obtain/Refresh Access Token

OpenID Connect Token Endpoint 1.0.0

This endpoint allows for obtaining access tokens using the Client Credentials flow in the OpenID Connect protocol.


Servers

Description URL
Base URL; replace {host} and {realm} per environment. Default realm: 'myrealm'. https://{host}/realms/{realm}/protocol/openid-connect

Endpoints


POST /token

Obtain Access Token

Request body

{
    "grant_type": "client_credentials",
    "client_id": "my-client-id",
    "client_secret": "my-client-secret"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the request body
{
    "type": "object",
    "properties": {
        "grant_type": {
            "type": "string",
            "enum": [
                "client_credentials"
            ],
            "example": "client_credentials"
        },
        "client_id": {
            "type": "string",
            "example": "my-client-id",
            "description": "You can find the value under Merchant/API details"
        },
        "client_secret": {
            "type": "string",
            "example": "my-client-secret",
            "description": "You can find the value under Merchant/API details"
        }
    }
}

Response 200 OK

{
    "access_token": "eyJz93a...k4laUWw",
    "token_type": "Bearer",
    "refresh_token": "string",
    "expires_in": 3600
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "access_token": {
            "type": "string",
            "example": "eyJz93a...k4laUWw"
        },
        "token_type": {
            "type": "string",
            "example": "Bearer"
        },
        "refresh_token": {
            "type": "string"
        },
        "expires_in": {
            "type": "integer",
            "example": 3600
        }
    }
}

Response 400 Bad Request

{
    "error": "invalid_request",
    "error_description": "Invalid request parameter"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "error": {
            "type": "string",
            "example": "invalid_request"
        },
        "error_description": {
            "type": "string",
            "example": "Invalid request parameter"
        }
    }
}

Response 401 Unauthorized

{
    "error": "invalid_client",
    "error_description": "Invalid client credentials"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "error": {
            "type": "string",
            "example": "invalid_client"
        },
        "error_description": {
            "type": "string",
            "example": "Invalid client credentials"
        }
    }
}

Response 500 Internal Server Error

{
    "error": "server_error",
    "error_description": "An unexpected error occurred"
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "type": "object",
    "properties": {
        "error": {
            "type": "string",
            "example": "server_error"
        },
        "error_description": {
            "type": "string",
            "example": "An unexpected error occurred"
        }
    }
}