π₯ Top 24h Volume

SWAMP/DOGE
0.1
+17.65%
Vol: 4.02K SWAMP
β 290.770852 DOGE
β $20.30 USDT

GVIA/USDT
0.0048
+2.13%
Vol: 519.853982 GVIA
β $2.47 USDT

MNT/USDT
0.00044
+119.99%
Vol: 7.55K MNT
β $2.36 USDT

YERB/DOGE
0.001468
0.00%
Vol: 8.27K YERB
β 12.133432 DOGE
β $0.85 USDT

SMOKE/DOGE
0.00015005
+4.20%
Vol: 14.06K SMOKE
β 9.156352 DOGE
β $0.64 USDT
Gatevia Private API Documentation
The Gatevia API allows programmatic trading and balance management. All private requests require an API Key and Secret.
Base URL: https://api.gatevia.io/private
Authentication Details
Method: POST
Content-Type: application/x-www-form-urlencoded
Required Headers
| Header | Description |
|---|---|
| X-GATEVIA-KEY | Your API Key string. |
| X-GATEVIA-SIGNATURE | HMAC-SHA256 of nonce + payload. |
| X-GATEVIA-NONCE | Millisecond timestamp (strictly increasing). |
Signature Calculation
The signature is calculated using HMAC-SHA256 with your API Secret. The data to sign is the concatenation of the nonce and the raw query string of the parameters.
$signature = hash_hmac('sha256', $nonce . $payload, $apiSecret);
Important: Data Types & Precision
Precision & Format: All numerical values (prices, amounts, balances) are returned as Strings formatted to 8 decimal places. This ensures high precision and prevents scientific notation errors (e.g., 1.0E-5).
1. Place Order
Submit a new limit order to the matching engine.
POST /place_order
Parameters
| Param | Type | Description |
|---|---|---|
| side | string | "buy" or "sell". |
| pair | string | Pair format: BASE_QUOTE (e.g. BTC_USDT). |
| price | string | Limit price as string (max 8 decimals). |
| amount | string | Quantity as string (max 8 decimals). |
Example Success Response
{ "success": true, "order_id": 178000, "status": "open" }
Full PHP Implementation
<?php
$apiKey = "YOUR_GATEVIA_KEY";
$apiSecret = "YOUR_SECRET_API";
$apiUrl = "https://api.gatevia.io/private/place_order";
$params = [
'side' => 'buy',
'pair' => 'GVIAT_USDTT',
'price' => '0.00000100',
'amount' => '10.00000000'
];
$payload = http_build_query($params);
$nonce = (int)(microtime(true) * 1000);
$signature = hash_hmac('sha256', $nonce . $payload, $apiSecret);
$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-GATEVIA-KEY: $apiKey",
"X-GATEVIA-SIGNATURE: $signature",
"X-GATEVIA-NONCE: $nonce",
"Content-Type: application/x-www-form-urlencoded"
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));
curl_close($ch);
?>
2. Cancel Order
Cancel an open order and unlock funds.
POST /cancel_order
Full PHP Implementation
<?php
$apiKey = "YOUR_GATEVIA_KEY";
$apiSecret = "YOUR_SECRET_API";
$apiUrl = "https://api.gatevia.io/private/cancel_order";
$params = ['id' => 177913];
$payload = http_build_query($params);
$nonce = (int)(microtime(true) * 1000);
$signature = hash_hmac('sha256', $nonce . $payload, $apiSecret);
$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-GATEVIA-KEY: $apiKey",
"X-GATEVIA-SIGNATURE: $signature",
"X-GATEVIA-NONCE: $nonce",
"Content-Type: application/x-www-form-urlencoded"
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));
curl_close($ch);
?>
3. Open Orders
Retrieve active orders for the authenticated user.
POST /open_orders
Example Response
[
{
"id": 177917,
"pair": "GVIAT_USDTT",
"side": "buy",
"price": "0.00000100",
"amount": "10.00000000",
"filled": "0.00000000",
"pct": 0
}
]
Full PHP Implementation
<?php
$apiKey = "YOUR_GATEVIA_KEY";
$apiSecret = "YOUR_SECRET_API";
$apiUrl = "https://api.gatevia.io/private/open_orders";
$params = ['pair' => 'GVIAT_USDTT'];
$payload = http_build_query($params);
$nonce = (int)(microtime(true) * 1000);
$signature = hash_hmac('sha256', $nonce . $payload, $apiSecret);
$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-GATEVIA-KEY: $apiKey",
"X-GATEVIA-SIGNATURE: $signature",
"X-GATEVIA-NONCE: $nonce",
"Content-Type: application/x-www-form-urlencoded"
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));
curl_close($ch);
?>
4. Get Balances
Get current asset availability and locked quantities.
POST /get_balances
Example Response
[
{
"coin": "GVIA",
"available": "150.75000000",
"locked": "10.00000000"
}
]
Full PHP Implementation
<?php
$apiKey = "YOUR_GATEVIA_KEY";
$apiSecret = "YOUR_SECRET_API";
$apiUrl = "https://api.gatevia.io/private/get_balances";
$params = ['coin' => 'BTC'];
$payload = http_build_query($params);
$nonce = (int)(microtime(true) * 1000);
$signature = hash_hmac('sha256', $nonce . $payload, $apiSecret);
$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-GATEVIA-KEY: $apiKey",
"X-GATEVIA-SIGNATURE: $signature",
"X-GATEVIA-NONCE: $nonce",
"Content-Type: application/x-www-form-urlencoded"
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));
curl_close($ch);
?>
Server Error Responses
If a request fails, the server will return a success: false status along with an error code.
| Error Code | Description |
|---|---|
| not_authenticated | API Key or Signature is invalid or missing. |
| rate_limit_exceeded | Too many requests. Limit: 10 requests per second per user. |
| insufficient_funds | User does not have enough balance to cover the order + fee. |
| invalid_params | Missing or malformed parameters (e.g., negative price). |
| market_not_found | The requested trading pair does not exist. |
| order_not_found | Attempting to cancel an ID that does not exist or belongs to another user. |
| already_closed | Order is already filled or cancelled and cannot be modified. |
| below_min_amount | Order amount is lower than the market's minimum trade amount. |
Example Error Response
{
"success": false,
"error": "insufficient_funds",
"need": "10.00000000",
"have": "2.50000000",
"coin": "USDT"
}