Get Access Token

Our services are safeguarded by systems that mandate the possession of an access token obtained through our authentication service. You can exclusively access services that have been authorized for your use or for use by your client through this access token.

To gain access, you will initiate a request to our system to obtain an access token, which must be included in the request's header. This token serves as your authentication, confirming your permission to utilize our services. Additional information is available below.

To get started, you will need to create an account on The Interswitch developer console, or if you need help reach out to our Developer Support Representatives on Slack

How do I get my Access Token?

The steps are:

STEP 1: Make an API call to get your Access Token

Below is how to make an API call to get your access token

curl https://passport-v2.k8.isw.la/passport/oauth/token \
-H "Authorization: Basic Base64(CLIENT_ID:SECRET_KEY)" \
-H "Content-Type: application/x-www-form-urlencoded" \
-D '{
	"grant_type": "client_credentials"
}'
-X POST

πŸ“˜

NOTE

Your CLIENT_ID and SECRET_KEY can be gotten from your Interswitch Developer console profile.

The response you get should appear in the format below:

{
    "access_token": "eyJhbGciOiJSUzI1NiJ9.eyJkb21haW5fY29kZSI6IkdUQiIsImVudiI6IlRFU1QiLCJreWNfZG9tYWluIjoiR1RCIiwiY2xpZW50X2Rlc2NyaXB0aW9uIjoiIiwiY2xpZW50X2lkIjoiSUtJQUQ0MEJGNEM5NDI4M0E5RkVEOTg1MTYyRjBDREYzREExNTMwMDY1REUiLCJhdWQiOlsiYXBpLWdhdGV3YXkiLCJpc3ctY29yZSIsInBhc3Nwb3J0Iiwic3dpdGNob25saW5lLWFwaSJdLCJjbGllbnRfYXV0aG9yaXphdGlvbl9kb21haW4iOiJHVEIiLCJzY29wZSI6WyJjbGllbnRzIiwicHJvZmlsZSJdLCJleHAiOjE2OTk0MTQ4NTMsImNsaWVudF9uYW1lIjoiNjU0MTI2NWI3NDc4ZGI3OTVhMmExNTVmfFRFU1QiLCJjbGllbnRfbG9nbyI6bnVsbCwianRpIjoiNjQ1MzU3M2ItYWU3Yy00YTU0LTk1YTAtOWY3OTFjYmUwZmQ1IiwiZW1haWwiOiJhZGFAZGFnYm8uY29tIn0.OP2qAi56zyom44lpTb-6sCUWPMduKDJ7g_iO8nrnoPSnq0WNzmR5Y3ZVuXAgKDUbC9iciF4hd-n9KBxuzxqezE-D5ihqZhNF6Ecz1sspbR1eygk2CFL2Qnan9NTwStruDe8qda9b8dtiN7_LmE39psBKnJ2sktKDz7R0ueOEjThd6iTbO_AhXCI1pKxraTHyrAgo9-tg28uQEGRkFiRNvdeewieRlXjlKfQuaB0n7xtPtdxwpfTtAC-b0yn-d3U5noWn-29OiFEUqAt_QHHGYDPBvF3x7_9fn0GN8RONARUdkENlzZ4CUyJK7X03-09tUm_AehOWC-gw-2iKsRo23Q",
    "token_type": "bearer",
    "expires_in": 43199,
    "scope": "clients profile",
    "client_authorization_domain": "GTB",
    "domain_code": "GTB",
    "env": "TEST",
    "kyc_domain": "GTB",
    "client_name": "6541265b7478db795a2a155f|TEST",
    "client_logo": null,
    "client_description": "",
    "jti": "6453573b-ae7c-4a54-95a0-9f791cbe0fd5"
}

πŸ“˜

The Access token expires in the time returned by the [expires_in] value in the response. This value is in seconds.

You can reuse the same access token for your calls to the Transaction Search API till it expires.

STEP 2: Make an API call to the Transaction Search API

To then make the call to the Transaction Search API, you need to pass that generated access token. We tell you all about it here

curl 
-H "Authorization: Bearer eyJhbGciOiJSUzI1NiJ9.ey.my47J82UEkErUBJJTJg1SQ4bZkkWKJIDrd7S0-bUA_42cWb7y7PtwJYM4FJv94Ew_0ky9kv5dpv19ecgEfHvKCQ" \
-H "Content-Type: application/json" \
-d '{
    "rrn" : "309238700960",
    "merchant_code":"2057LA200001214",
    "masked_pan" : "519911******9719",
    "terminal_id" : "20577C9O",
    // "stan" : "022186"
    // "unique_reference" : "12345678811",
    "transaction_date" : "2023-09-23"
    // "transaction_amount":0.000000
    // "to_account" : "1236475"
}' 
-X POST

You are all set! πŸ‘

You can Test out the API call directly here:


What’s Next

Ready to Search for Transactions