Z Zise Developers 简体中文

Exchange order details by ID

GET /v1/exchange/orders/{id} scope: exchange:read
On behalf of a member · x-on-behalf-of required

This endpoint exists to confirm whether execution occurred after a timeout. You have an ID: with a locked quote, quote_id is the order ID; without one, retrying with the same idempotency key retrieves the original order with duplicated: true. Previously, finding a specific exchange required paging backward from the newest list page.

⚠ Amounts are fixed-point decimal strings, such as "500.000000", matching POST /v1/exchange/orders and POST /v1/exchange/quotes. The list, GET /v1/exchange/orders, instead uses integer strings in minor units. The list is the only exception in this flow; do not reuse a parser between these two endpoints. Three ledger_scale_* values are supplied, so no side’s precision needs guessing.

⚠ Store unknown status values unchanged and alert; never default to “processing”. This flow has no intermediate state: quoted is an unexecuted lock that expires unused, executed is terminal, and reversed is an administrative reversal.

⚠ No fields expose our cost or upstream price, following the same rule as remittance and QR payment details. The rate and fee_amount shown are those applied to your member for this order.

Path Parameters

FieldTypeRequiredDescription
id string Required Order ID, with or without exc_; the server strips the prefix. A locked quote’s quote_id is the same ID.
FieldTypeRequiredDescription
x-on-behalf-of string Required Member to query. Accepts your external_member_id or our public mem_<uuid>.

Response

200OK. quote_expires_at matters only for status = quoted; after execution it is historical. Empty means the order was not created through price locking. executed_at is empty before execution; do not infer state from it, use status.
{
  "id": "exc_7a1e5c30-2b44-4c11-9f8e-31d0a7b62c45",
  "status": "executed",
  "from_asset": "USDT",
  "to_asset": "USD",
  "from_amount": "500.000000",
  "to_amount": "498.750000",
  "rate": "1.0000",
  "fee_asset": "USD",
  "fee_amount": "1.250000",
  "ledger_scale_from": 6,
  "ledger_scale_to": 6,
  "ledger_scale_fee": 6,
  "quote_expires_at": "2026-08-13T09:31:30Z",
  "created_at": "2026-08-13T09:30:00Z",
  "executed_at": "2026-08-13T09:30:12Z"
}
400member_context_required: missing x-on-behalf-of. · member_not_found: member nonexistent, not yours, or suspended; all three share one response.
403insufficient_scope: this key lacks exchange:read
404not_found: order not associated with this member or nonexistent. Both use the same response, avoiding an order-ID discovery endpoint.
Request
curl -X GET 'https://api.zinfra.vip/v1/exchange/orders/{id}' \
  -H 'x-auth-token: Bearer $TOKEN' \
  -H 'x-on-behalf-of: $MEMBER_ID'
const res = await fetch("https://api.zinfra.vip/v1/exchange/orders/{id}", {
  method: "GET",
  headers: {
    "x-auth-token": "Bearer $TOKEN",
    "x-on-behalf-of": "$MEMBER_ID",
  },
});
// Keep monetary amounts as strings, never numbers.
const data = await res.json();
import requests

res = requests.get(
    "https://api.zinfra.vip/v1/exchange/orders/{id}",
    headers={
        "x-auth-token": "Bearer $TOKEN",
        "x-on-behalf-of": "$MEMBER_ID",
    },
)
# Use Decimal(str(...)) for amounts, not float.
data = res.json()
req, _ := http.NewRequest("GET", "https://api.zinfra.vip/v1/exchange/orders/{id}",
    nil)
req.Header.Set("x-auth-token", "Bearer $TOKEN")
req.Header.Set("x-on-behalf-of", "$MEMBER_ID")
res, err := http.DefaultClient.Do(req)
// Decode amount fields as string, not float64.
HttpRequest req = HttpRequest.newBuilder()
    .uri(URI.create("https://api.zinfra.vip/v1/exchange/orders/{id}"))
    .header("x-auth-token", "Bearer $TOKEN")
    .header("x-on-behalf-of", "$MEMBER_ID")
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
// Use String / BigDecimal for amounts, not double.
$ch = curl_init('https://api.zinfra.vip/v1/exchange/orders/{id}');
curl_setopt_array($ch, [
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => [
    'x-auth-token: Bearer $TOKEN',
    'x-on-behalf-of: $MEMBER_ID',
  ],
]);
$res = curl_exec($ch);
// Use bcmath / strings for amounts, not floatval.
200
{
  "id": "exc_7a1e5c30-2b44-4c11-9f8e-31d0a7b62c45",
  "status": "executed",
  "from_asset": "USDT",
  "to_asset": "USD",
  "from_amount": "500.000000",
  "to_amount": "498.750000",
  "rate": "1.0000",
  "fee_asset": "USD",
  "fee_amount": "1.250000",
  "ledger_scale_from": 6,
  "ledger_scale_to": 6,
  "ledger_scale_fee": 6,
  "quote_expires_at": "2026-08-13T09:31:30Z",
  "created_at": "2026-08-13T09:30:00Z",
  "executed_at": "2026-08-13T09:30:12Z"
}