---
updatedAt: 2026-02-26T13:11:07.000Z
agentTools:
  projectIndex: https://docs.ksa.ngenius-payments.com/llms.txt
---

# Request an access token

This section will describe how you will authenticate yourself to the N-Genius Online identity services, and receive an access token in return, which you can then use to perform more meaningful operations using the N-Genius Online payment APIs.

[block:api-header]
{
  "title": "Request an access token"
}
[/block]

The first step for any **N-Genius Online** gateway interaction is to validate ourselves with the identity service and obtain an access token. This token allows us to execute operations on the gateway APIs with authority, and whilst a single token will expire after 5 minutes, we can use our Service Account API key to generate one at any time.

**HTTP Request Method**: POST
**Resource (URI)**: https\://api-gateway.sandbox.ksa.ngenius-payments.com/identity/auth/access-token

## Headers:

Add these headers to your request (note that you should replace '*your\_api\_key*' with the service account API key in the [Getting started](https://docs.ksa.ngenius-payments.com/ksa/docs/getting-started-1)  section).

[block:parameters]
{
  "data": {
    "0-0": "Content-Type",
    "1-0": "Authorization",
    "0-1": "application/vnd.ni-identity.v1+json",
    "1-1": "Basic *your_api_key*",
    "h-0": "Header",
    "h-1": "Value"
  },
  "cols": 2,
  "rows": 2
}
[/block]

## Example response (body):

[block:code]
{
  "codes": [
    {
      "code": "{\n  \"access_token\": \"eyJhbGciOiJSUzI1N…0eDloZnVRI\",\n\"expires_in\": 300,\n\"refresh_expires_in\": 1800,\n\"refresh_token\": \"eyJhbGciOi…eDloZnVRIn0\",\n\"token_type\": \"bearer\"\n}",
      "language": "json"
    }
  ]
}
[/block]

**Note**: you will require the *access\_token* value for any subsequent calls to the N-Genius Online platform APIs.