Preloader

Get Access Token

Get access token to initiates payment transaction.

Get Access Token

Get access token to initiate payment transactions. This endpoint authenticates your API credentials and returns a temporary access token.

Endpoint:
POST {{base_url}}/authentication/token
Parameter
Type
Comments
client_id
string
Enter merchant API client/primary key
secret_id
string
Enter merchant API secret key

Just request to that endpoint with all parameter listed below:

Request Example (Guzzle)
<?php
require_once('vendor/autoload.php');
$client = new GuzzleHttp\Client();
$response = $client->request('POST', '{{base_url}}/authentication/token', [
    'json' => [
        'client_id' => 'tRCDXCuztQzRYThPwlh1KXAYm4bG3rwWjbxM2R63kTefrGD2B9jNn6JnarDf7ycxdzfnaroxcyr5cnduY6AqpulRSebwHwRmGerA',
        'secret_id' => 'oZouVmqHCbyg6ad7iMnrwq3d8wy9Kr4bo6VpQnsX6zAOoEs4oxHPjttpun36JhGxDl7AUMz3ShUqVyPmxh4oPk3TQmDF7YvHN5M3',
    ],
    'headers' => [
        'accept' => 'application/json',
        'content-type' => 'application/json',
    ],
]);
echo $response->getBody();
                        
Response: SUCCESS (200 OK)
{
    "message": {
        "code": 200,
        "success": [
            "SUCCESS"
        ]
    },
    "data": {
        "access_token": "nyXPO8R",
            "expire_time": 600
    },
    "type": "success"
}
                        
Response: ERROR (400 FAILED)
Copy
{
"message": {
    "code": 400,
    "error": [
        "Invalid secret ID"
    ]
},
"data": [],
"type": "error"
}