Skip to content

Auftrag stornieren ​

POST /v1/orders/cancel

Storniert einen Auftrag, der sich noch im Status new befindet.

Keine automatische Rückerstattung

Sobald ein Auftrag storniert wurde, werden alle später für diesen Auftrag eingehenden TRX nicht automatisch erstattet. Storniere Aufträge nur, wenn du sicher bist, dass der Nutzer die Einzahlung noch nicht gesendet hat.

Anfrage-Body ​

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

Beispiele ​

bash
curl -X POST https://api.tronzap.com/v1/orders/cancel \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "order_id": "01HZX5N6Q9TY3K2P0VWB7HRD4M"
  }'
javascript
const response = await fetch('https://api.tronzap.com/v1/orders/cancel', {
  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) // "cancelled"
php
$response = file_get_contents('https://api.tronzap.com/v1/orders/cancel', false, stream_context_create([
  'http' => [
    'method' => 'POST',
    'header' => "Content-Type: application/json\r\nAccept: application/json",
    'content' => json_encode(['order_id' => '01HZX5N6Q9TY3K2P0VWB7HRD4M']),
  ],
]));
$data = json_decode($response, true)['result'];
python
import requests

resp = requests.post('https://api.tronzap.com/v1/orders/cancel', json={
    'order_id': '01HZX5N6Q9TY3K2P0VWB7HRD4M',
})
print(resp.json()['result']['status'])  # "cancelled"

Antwort ​

json
{
  "code": 0,
  "request_id": "550e8400-e29b-41d4-a716-446655440000",
  "result": {
    "order_id": "01HZX5N6Q9TY3K2P0VWB7HRD4M",
    "status": "cancelled",
    "deposit_address": "TLa2f6VPqDgRE67v1736s7bJ8Ray5wYjU7",
    "amount": 2.69,
    "currency": "TRX",
    "expires_at": "2026-05-18T16:07:05+00:00",
    "ttl": 0
  }
}

Fehlerfälle ​

SituationErgebnis
Auftrag nicht im Status newFehler — ein bereits bezahlter, in Verarbeitung befindlicher oder terminaler Auftrag kann nicht storniert werden.
order_id nicht gefundenFehler — siehe Fehlercodes.

TronZap Partner Documentation