curl -X POST https://www.uapi.io/api/v1/order/create.php \
-H "X-API-KEY: sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"amount": 100.00,
"chain": "trc20",
"merchant_order_id": "ORD-001",
"notify_url": "https://yoursite.com/callback",
"domain": "yoursite.com"
}'
<?php
$apiKey = 'sk_live_your_api_key';
$data = [
'amount' => 100.00,
'chain' => 'trc20',
'merchant_order_id' => 'ORD-001',
'notify_url' => 'https://yoursite.com/callback',
'domain' => 'yoursite.com'
];
$ch = curl_init('https://www.uapi.io/api/v1/order/create.php');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'X-API-KEY: ' . $apiKey,
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$result = json_decode($response, true);
echo $result['data']['payment_url'] ?? 'Create order failed';
const axios = require('axios');
const createOrder = async () => {
const response = await axios.post('https://www.uapi.io/api/v1/order/create.php', {
amount: 100.00,
chain: 'trc20',
merchant_order_id: 'ORD-001',
notify_url: 'https://yoursite.com/callback',
domain: 'yoursite.com'
}, {
headers: {
'X-API-KEY': 'sk_live_your_api_key',
'Content-Type': 'application/json'
}
});
console.log(response.data.data.payment_url);
};