SAQ DigitalDocs

    Auth Token

    Generate OAuth 2.0 access token using client credentials. The access token is valid for 60 minutes.

    POSThttps://api.saq.digital/v2/finance/auth-token/
    curl --request POST \
      --url 'https://api.saq.digital/v2/finance/auth-token/' \
      --header 'Authorization: Bearer <ACCESS_TOKEN>' \
      --header 'Content-Type: application/json' \
      --data '{
      "client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
      "client_secret": "xxxxxxxxxxxxxxxxxxxxxxx"
    }'
    Response200
    {
      "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzEzMzAwOTMxLCJpYXQiOjE3MTMyOTczMzEsImp0aSI6Ijc2ZWI4ZTE5ZjM4YjQ4NmZiODdmNzNjNTdkMWVmNDJhIiwidXNlcl9pZCI6MjQ2fQ.5zekMa7CUj9p-MvNHns5ke4ZPhYV3Y1CLOsYL7hDUUo",
      "token_type": "Bearer"
    }

    Auth Token

    POST /v2/finance/auth-token/

    The access token is valid for 60 minutes

    Body Details

    {
      "client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
      "client_secret": "xxxxxxxxxxxxxxxxxxxxxxx"
    }
    ParameterDescriptionRequired
    client_idPublic identifier for your application (used during the OAuth 2.0 authorization request)Yes
    client_secretConfidential secret for authentication. Never expose this in client-side code or public reposYes

    Response (200 OK)

    {
      "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzEzMzAwOTMxLCJpYXQiOjE3MTMyOTczMzEsImp0aSI6Ijc2ZWI4ZTE5ZjM4YjQ4NmZiODdmNzNjNTdkMWVmNDJhIiwidXNlcl9pZCI6MjQ2fQ.5zekMa7CUj9p-MvNHns5ke4ZPhYV3Y1CLOsYL7hDUUo",
      "token_type": "Bearer"
    }
    FieldTypeDescription
    access_tokenStringJWT access token to be used in the Authorization header of subsequent API requests
    token_typeStringAlways "Bearer". Use as: Authorization: Bearer {access_token}

    Error Responses

    400 Bad Request

    {
      "error": "invalid_client",
      "error_description": "Invalid client credentials"
    }

    401 Unauthorized

    {
      "detail": "Account is disabled"
    }