Ask for an access token before you create a payment. A token is valid for 600 seconds (10 minutes).
Endpoint:POST{{base_url}}/authentication/token
| Parameter | Type | Details |
|---|---|---|
client_id | string | Your client ID from DPay Merchant |
secret_id | string | Your secret key from DPay Merchant |
Request example (PHP, Guzzle)
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', '{{base_url}}/authentication/token', [
'json' => [
'client_id' => 'YOUR_CLIENT_ID',
'secret_id' => 'YOUR_SECRET_KEY',
],
'headers' => [
'accept' => 'application/json',
'content-type' => 'application/json',
],
]);
echo $response->getBody();Response: success (200)
{
"message": { "code": 200, "success": ["SUCCESS"] },
"data": { "access_token": "ACCESS_TOKEN", "expire_time": 600 },
"type": "success"
}Response: error
{
"message": { "code": 400, "error": ["Requested credentials is invalid"] },
"data": [],
"type": "error"
}





