Project
Our API project is designed to serve as an integrated platform for grouping merchant businesses within our application. By centralizing various merchant operations, this robust API allows for streamlined management, enhanced data analytics, and optimized user experience, all while simplifying administrative tasks for the merchants. The objective is to create a cohesive ecosystem that benefits both the merchants and end-users.
This API is exclusively accessible to a select group of merchants for enhanced security and customization. If you're interested in accessing this feature to streamline your business operations within our application, please contact our support team for eligibility and activation.
Create Project
Allows Merchants to create new project from the SenGo
- Name
name- Type
- mandatory
- Description
The name or identifier of the project can be filled with letters and numbers.
- Name
domain- Type
- mandatory
- Description
A unique website address of the project by the merchant.
- Name
ip- Type
- mandatory
- Description
The IP address that will be able to access the engine.
You need to authenticate your Headers request to access any endpoint in the SenGo API, to see the authentication documentation please read the Authentication section.
Create Project
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '{{HOST}}/projects',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"name": "Project SenGo",
"domain": "https://sengo.id",
"ip": [
"0.0.0.0/0"
]
}',
CURLOPT_HTTPHEADER => array(
'X-Client-Key: ',
'X-Client-Token: ',
'X-Signature: '
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response Create Project
Response Create Project
{
"responseCode": 200,
"responseMessage": "success",
"responseData": {
"id": 1,
"name": "SenGo",
"domain": "https://sengo.id",
"ip": [
"0.0.0.0/0"
],
"status": "Review"
}
}
Response Parameters
| Parameter | Description |
|---|---|
| responseCode | The HTTP response code indicating the status of the request. See the Error Codes section for details. |
| responseMessage | A descriptive message indicating the status of the request. |
| responseData | An object containing the data related to the transaction response. |
| responseData.id | SenGo unique identifier for the transaction. |
| responseData.name | The name of the merchant's project. |
| responseData.domain | The total balance of the merchant's project. |
| responseData.ip | The whitelisted IP addresses have permission to access the engine. |
| responseData.status | The status of the created project. |
If you want to see the error code status, please read the Extras >> Error Code section.
Check Balance
This is especially true when there's no message body to include. Hashing only the Project Key ensures a level of authentication between the client and the server.
# Signature SenGo Check Balance For PHP Code
$codesignature = hash_hmac('sha512', $key, $token)
Allows Merchants to check the project's balance from the SenGo API
Check Balance
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => '{{HOST}}/balance',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'X-Client-Key: ',
'X-Client-Token: ',
'X-Signature: '
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response Create Project
Response Check Balance
{
"responseCode": 200,
"responseMessage": "success",
"responseData": {
"active": 1000000,
"pending": 10000,
"total": 1010000
}
}
