Skip to main content

Get a Token

Makes an authentication request and receives an access token upon success.


Headers

    Content-Type String - (Required)
    x-www-form-urlencoded


Parameters

    client_id String - (Optional)
    Your clientID, available in the support portal


    client_secret String - (Required)
    Your client secret, available in the support portal


    scope String - (Optional)
    Link-Core | Link-Payment


    grant_type String - (Required)
    client_credentials


Post Request

POST - /v1/tokens
POST Request
1curl --location --request POST '{API_BASE_URL}/v1/tokens' \
2--header 'Content-Type: application/x-www-form-urlencoded' \
3--data-urlencode 'client_id={CLIENT_ID}' \
4--data-urlencode 'client_secret={CLIENT_SECRET}' \
5--data-urlencode 'scope=Link-Core' \
6--data-urlencode 'grant_type=client_credentials'

Returns

    Token-Type String
    The type of token granted


    expires_in Numberic
    The lifetime in seconds of the access token. For example, the value '3600' denotes that the access token will expire in one hour from the time the response was generated


    access_token String
    The access token issued by the authorization server


    scope String
    The scope to which the token is granted access for



Response Body

Response
1{ 
2	 "token_type": "Bearer", 
3	 "expires_in": 3600, 
4	 "access_token": "{ACCESS_TOKEN}", 
5	 "scope": "Link-Core" 
6}

Overview


Calls to Link Money's APIs are authenticated with an authorization token. This token can be retrieved by making a call to our authentication servers as in the following example. The two pieces of information needed to get an authorization token are your Client ID and Client Secret. See later steps in this tutorial for examples of how to use your auth token.


Retrieving Your Auth Token

Client ID and Secret

Your Client ID and Secret can be retrieved from Link Money's merchant portal. Use the following links for sandbox and production. Navigate to the Accounts page and look for the tile pictured below. Enter these values in the template in the next step.


Auth Token Request

This is an example of retrieving an auth token in bash. Ensure that a POST method is being used, you have the correct URL, you include the content-type header with the value given in the following example, fill in your client ID and secret in the appropriate fields, and include the appropriate scope for the request you are making.

Scope types

  • Link-Payment

    string

    Used for Payments, Refunds, Credits, and Cancelations

  • Link-Core

    string

    For all other requests