Skip to content

Auftrag prüfen

POST /v1/orders/check

Gibt den aktuellen Status und die Details eines bestehenden Auftrags zurück.

Anfrage-Body

FeldTypErforderlichBeschreibung
order_idstringjaULID, der von POST /v1/orders zurückgegeben wurde.

Beispiele

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'])

Antwort

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
  }
}

Die Antwortstruktur ist identisch mit POST /v1/orders. Siehe Auftragsstatus für die vollständige Liste der möglichen status-Werte.

Empfehlungen zum Abfragen

  • Frage alle 5–10 Sekunden ab, nachdem der Nutzer bestätigt hat, dass er TRX gesendet hat.
  • Stoppe die Abfrage, wenn status einen der terminalen Zustände hat: completed, failed, cancelled, expired.
  • ttl: 0 zeigt an, dass der Auftrag abgelaufen oder terminal ist.

TronZap Partner Documentation