Request Format & Examples
Learn how to properly format and send API requests
Base URL
https://api.mintmove.ioAll API endpoints are accessed through this base URL. The API version is included in the path (e.g., /v1/).
HTTP Methods
- GET - Used for retrieving data (e.g., getting exchange rates, order details, available currencies)
- POST - Used for creating resources or performing actions (e.g., creating orders, emergency actions)
Request Headers
All requests must include the following headers:
| Header | Required | Description |
|---|---|---|
| Content-Type | Yes | application/json |
| X-API-KEY | Yes* | Your API key (required for private endpoints) |
| X-API-SIGN | Yes* | HMAC-SHA256 signature |
| X-API-TIMESTAMP | Yes* | Unix timestamp in seconds |
* Required for authenticated endpoints only
Request Body
JSON Format
All request bodies must be valid JSON with UTF-8 encoding:
- Use double quotes for strings
- No trailing commas
- Valid JSON syntax
- UTF-8 character encoding
Example Request Body
{
"from": "BNB",
"from_network": "BEP20",
"to": "USDT",
"to_network": "ERC20",
"amount": 1.202887,
"rate_type": "fixed",
"destination": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
}Response Format
Success Response
Successful requests return a JSON object with the requested data:
{
"success": true,
"data": {
"rate": 831.34,
"from": "BNB",
"to": "USDT"
}
}Error Response
Errors return a JSON object with error details:
{
"error": true,
"error_code": "INVALID_ADDRESS",
"message": "Destination address is invalid"
}Code Examples
cURL
# GET request example
curl -X GET "https://api.mintmove.io/v1/rate?from=BTC&to=USDT&amount=0.1" \
-H "Content-Type: application/json"
# POST request with authentication
curl -X POST "https://api.mintmove.io/v1/order/create" \
-H "Content-Type: application/json" \
-H "X-API-KEY: your_api_key" \
-H "X-API-SIGN: generated_signature" \
-H "X-API-TIMESTAMP: 1706284800" \
-d '{
"from": "BNB",
"from_network": "BEP20",
"to": "USDT",
"to_network": "ERC20",
"amount": 1.202887,
"rate_type": "fixed",
"destination": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
}'Python
import requests
import json
import time
import hmac
import hashlib
API_KEY = "your_api_key"
API_SECRET = "your_api_secret"
BASE_URL = "https://api.mintmove.io"
def make_request(method, endpoint, body=None):
timestamp = str(int(time.time()))
path = f"/v1{endpoint}"
# Generate signature
sign_string = method + path
if body:
sign_string += json.dumps(body, separators=(',', ':'))
sign_string += timestamp
signature = hmac.new(
API_SECRET.encode('utf-8'),
sign_string.encode('utf-8'),
hashlib.sha256
).hexdigest()
headers = {
'Content-Type': 'application/json',
'X-API-KEY': API_KEY,
'X-API-SIGN': signature,
'X-API-TIMESTAMP': timestamp
}
url = BASE_URL + path
response = requests.request(method, url, headers=headers, json=body)
return response.json()
# Example: Create order
order_data = {
"from": "BNB",
"from_network": "BEP20",
"to": "USDT",
"to_network": "ERC20",
"amount": 1.202887,
"rate_type": "fixed",
"destination": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
}
result = make_request('POST', '/order/create', order_data)
print(json.dumps(result, indent=2))PHP
<?php
$apiKey = 'your_api_key';
$apiSecret = 'your_api_secret';
$baseUrl = 'https://api.mintmove.io';
function makeRequest($method, $endpoint, $body = null) {
global $apiKey, $apiSecret, $baseUrl;
$timestamp = time();
$path = '/v1' . $endpoint;
// Generate signature
$signString = $method . $path;
if ($body) {
$signString .= json_encode($body, JSON_UNESCAPED_SLASHES);
}
$signString .= $timestamp;
$signature = hash_hmac('sha256', $signString, $apiSecret);
$headers = [
'Content-Type: application/json',
'X-API-KEY: ' . $apiKey,
'X-API-SIGN: ' . $signature,
'X-API-TIMESTAMP: ' . $timestamp
];
$ch = curl_init($baseUrl . $path);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
if ($body) {
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
}
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
// Example: Create order
$orderData = [
'from' => 'BNB',
'from_network' => 'BEP20',
'to' => 'USDT',
'to_network' => 'ERC20',
'amount' => 1.202887,
'rate_type' => 'fixed',
'destination' => '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
];
$result = makeRequest('POST', '/order/create', $orderData);
echo json_encode($result, JSON_PRETTY_PRINT);
?>Encoding Requirements
- UTF-8 Encoding - All text must be UTF-8 encoded to support international characters
- URL Encoding - Query parameters must be properly URL-encoded
- JSON Escaping - Special characters in JSON strings must be properly escaped