Hızlı başlangıç: ilk kripto depozitonuz 5 dakikada
Kontrol ettiğiniz bir cüzdan adresine ve webhook alabilen herkese açık bir URL’ye ihtiyacınız var. Kayıt ve API key gerekmez.
1. Depozito adresi oluşturun
curl -X POST https://api.chainpay.site/deposit-address \
-H 'content-type: application/json' \
-d '{
"ticker": "trc20/usdt",
"callbackUrl": "https://your-service.example.com/webhook?token=your-secret",
"forwardAddress": "TYourOwnTronWallet...",
"externalReference": "order-123"
}'
Yanıt id ve address içerir. address değerini ödeme yapana gösterin. Aynı isteği tekrarlamak aynı adresi döndürür, bu yüzden yeniden denemek güvenlidir.
2. Webhook’u alın
Depozito onay eşiğine ulaşınca (TRON’da 19) ChainPay callbackUrl adresinize status: "confirmed" içeren bir POST gönderir. Ardından fonlar, komisyon düşülerek forwardAddress adresinize aktarılır. Sorgudaki token değerini kendi tarafınızda doğrulayın: webhook’lar imzalı değildir.
3. Durum API’si ile mutabakat yapın
curl https://api.chainpay.site/deposit-address/ADDRESS_ID/status
curl https://api.chainpay.site/deposit-address/ADDRESS_ID/transactions
Webhook’ları «en az bir kez» teslim olarak ele alın ve bu uç noktaları doğruluk kaynağı olarak kullanın.
Kendi dilinizde örnekler
Node.js
const res = await fetch('https://api.chainpay.site/deposit-address', {
method: 'POST',
headers: { 'content-type': 'application/json' },
body: JSON.stringify({
ticker: 'trc20/usdt',
callbackUrl: 'https://your-service.example.com/webhook?token=your-secret',
forwardAddress: 'TYourOwnTronWallet...',
externalReference: 'order-123',
}),
});
const { id, address } = await res.json();
Python
import requests
r = requests.post("https://api.chainpay.site/deposit-address", json={
"ticker": "trc20/usdt",
"callbackUrl": "https://your-service.example.com/webhook?token=your-secret",
"forwardAddress": "TYourOwnTronWallet...",
"externalReference": "order-123",
})
address = r.json()["address"]
PHP
$ch = curl_init('https://api.chainpay.site/deposit-address');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode([
'ticker' => 'trc20/usdt',
'callbackUrl' => 'https://your-service.example.com/webhook?token=your-secret',
'forwardAddress' => 'TYourOwnTronWallet...',
'externalReference' => 'order-123',
]),
]);
$address = json_decode(curl_exec($ch), true)['address'];