Sipariş Kontrolü
POST /v1/orders/check
Mevcut bir siparişin güncel durumunu ve ayrıntılarını döndürür.
İstek gövdesi
| Alan | Tür | Zorunlu | Açıklama |
|---|---|---|---|
order_id | string | evet | POST /v1/orders tarafından döndürülen ULID. |
Örnekler
bash
curl -X POST https://api.tronzap.com/v1/orders/check \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"order_id": "01HZX5N6Q9TY3K2P0VWB7HRD4M"
}'javascript
const response = await fetch('https://api.tronzap.com/v1/orders/check', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
},
body: JSON.stringify({ order_id: '01HZX5N6Q9TY3K2P0VWB7HRD4M' }),
})
const { result } = await response.json()
console.log(result.status)php
$response = file_get_contents('https://api.tronzap.com/v1/orders/check', false, stream_context_create([
'http' => [
'method' => 'POST',
'header' => "Content-Type: application/json\r\nAccept: application/json",
'content' => json_encode(['order_id' => '01HZX5N6Q9TY3K2P0VWB7HRD4M']),
],
]));
$status = json_decode($response, true)['result']['status'];python
import requests
resp = requests.post('https://api.tronzap.com/v1/orders/check', json={
'order_id': '01HZX5N6Q9TY3K2P0VWB7HRD4M',
})
print(resp.json()['result']['status'])Yanıt
json
{
"code": 0,
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"result": {
"order_id": "01HZX5N6Q9TY3K2P0VWB7HRD4M",
"status": "completed",
"deposit_address": "TLa2f6VPqDgRE67v1736s7bJ8Ray5wYjU7",
"amount": 2.69,
"currency": "TRX",
"expires_at": "2026-05-18T16:07:05+00:00",
"ttl": 0
}
}Yanıt yapısı POST /v1/orders ile aynıdır. Olası status değerlerinin tam listesi için Sipariş Durumları sayfasına bakın.
Sorgulama önerileri
- Kullanıcı TRX gönderdiğini onayladıktan sonra her 5–10 saniyede bir sorgulayın.
statusşu terminal durumlardan biri olduğunda sorgulamayı durdurun:completed,failed,cancelled,expired.ttl: 0, siparişin süresi dolmuş veya terminal durumda olduğunu gösterir.
