Post Get API Keys
Production: https://api.logisticprotrade.com/v1/getApiKey
Sandbox: https://dev.logisticprotrade.com/v1/getApiKey
REQUEST
Name | Details | |
username | Respective Client Username value | |
password | Respective Client Password value |
RAW JSON BODY
{
“username”: “(respective clients username value)”,
“password”: “(respective clients password value)”
}
*All fields are required
RESPONSE
Name | Details | |
status | Transaction Status | |
data | Transaction Data Node | |
– name | Merchant Name | |
– merchant_id | Merchant ID | |
– public_key | Merchant respective Public Key | |
– secret_key | Merchant respective Secret Key |
Example Successful Response
{
“status”: “success”,
“data”:
{
“name”: (Merchant Name),
“merchant_id”: (Merchant ID),
“public_key”: “qw92332bb6f07da62f17fdec1f703e3214cf2d78vv6”,
“secret_key”: “3w0482d4f3ea4f1f12f8fe250605472989990c6bsc”
}
}
Example Error Responses
Invalid credentials
{
“status”: “error”,
“message”: “Invalid Credentials”
}
Account KYC Not Verified
{
“status”: “error”,
“message”: “Not Verified”
}
PHP Example
<?php
function getApiKey($payload,$mode)
{
$url = "";
if($mode == "stage")
{
$url = "https://dev.logisticprotrade.com/v1/";
}
elseif($mode == "production")
{
$url = "https://api.logisticprotrade.com/v1/";
}
$url .= "currentPrice";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
if(curl_exec($ch) === false) {
$result = 'Curl error: ' . curl_error($ch);
}
curl_close ($ch);
return $result;
}
$data = [
"username" => $username,
"password" => $password
];
$mode = "stage"; // stage & production
$payload = json_encode($data);
$response = getApiKey($payload,$mode);
$response = json_decode($response);
$response_status = $response->response->status;
$responsetxid = $response->response->data->txid;
if($response_status == "error")
{
//error get data
}
else
{
$getApiKey_name = $response->response->data->name;
$getApiKey_merchant_id = $response->response->data->merchant_id;
$getApiKey_Public_Key = $response->response->data->public_key;
$getApiKey_Secret_Key = $response->response->data->secret_key;
}
?>