Skip to content
Developerhome

Get a Sage ID access token

  Less than to read

To work with the Provider API, Provider Messaging API and some Consumer API endpoints, you need to obtain a Sage ID access token. You use this to sign your HTTP requests.

The token is generated using your clientID, secret and audience. The Sage Network Platform team will give you this.

Follow this guide to send a POST request. If your request is successful, you will receive an access token in the JSON response. Each access token expires after a certain amount of time. When you need to renew it, send a GET request.

This only applies to Sage cloud applications.

Headers

POST /oauth/token HTTP/1.1
Host: id.sage.com

Body

{
    "grant_type" : "client_credential",
    "client_id" : "{clientId}",
    "client_secret" : "{clientSecret}",
    "audience" : "{audience}"
}

Where:

  • POST /oauth/token is the Payments Out Service endpoint where you send your request.
  • id.sage.com is the your request’s base URL.
  • grant_type specifies the type of credential you want to retrieve. For Payments Out Service this will always be client_credential.
  • client_id specifies the client ID the Sage Network Platform team has given to you.
  • client_secret specifies the client secret the Sage Network Platform team has given to you.
  • audience specifies the API you want to access. This will be provided the Sage Network Platform team.

For more information about this REST resource and its parameters, see Cloud ID API reference.

Example response

An access token looks like:

{
    "access_token": "AAAAAAAAAAA.wtwwwnifjaoisdfafMC4wLjAiLCJvcmdhbmlzYXRpb25KKKKKKKJZCI6ImFiMWY3OGIyLTM4NGUtNGUyMC1iMzY2LTZmOTBiODc2M2U2ZSIsInNvdXJjZVByb2R1Y3QiOiJzYWdlLmJyYXppbC5vbmUiLCJraWQiOiI3NTdiNTBmZDhmNDYxODAyNTI2MTFiMDY2ODI2NTBiNDYyYmYyYmE4MzNkMzExYYwMDI3IiwiaXAiOiI4MS4xMjguMjMzLjIwMiIsImlzcyI6IndwYi1hdXRoIiwiY2hhbm5lbCI6Im9ubGluZS1jaGFubmVsIiwiZXhwIjoxNTU2MDE1Njc3LCJzZXJ2aWNlSWQiOiJ3cGItYXV0aC1zZXJ2aWNlIiwiaWF0IjoxNTU2MDE0NDc3fQ.afe3qfgewgpkhidaMgo_nmrrWMEeGvq5q2yFElgZ79AnjQ74yyt1WgXKn8gNH90RwdNXStozG2cTsg8PvPvM0lWV0sRZM3yVOJs2FvZp5aSzFuFq6m2xcjwkLxTys3x1Knx3oZkXTYMoEbI3_ZvwSvxV3DK2cNT888gsTXQuwgJstR2Qpud5abcJIY64-oVnshyuJrgO391n7FHCnn1Hm-9eSegLSIl0zJYN0xVYuT21iRxZk0sObZMC12FC0qNh2gdi-kOUMEdzkJ0iEYeDp4b3tFnUSN0ijBT4XHSyY_sxrOLz-pphGiKQn0LAgJuqLLT-Q",
"scope": "scope",
"expires_in": 28800,
"token_type": "Bearer"
}