POST /v1/emergency
Resolve an order in EMERGENCY status — continue at the live rate.
/api/v1/emergencyAuth requiredResolves an order whose partner-facing status is EMERGENCY. Sending choice = "EXCHANGE" instructs us to resume processing at the current live rate. The order continues through its normal lifecycle and your integration takes no further action.
Orders that cannot be resolved through EXCHANGE (rate volatility, deposit anomaly, or any other manual-review trigger) are finalised by the operator. The terminal state surfaces through order.status_changed as status EXPIRED.
Request
idstring (UUID)requiredtokenstring (43-char base64url)requiredchoice"EXCHANGE"requiredResponse
{
"code": 0,
"msg": "",
"data": true
}databooleanErrors
| code | msg | HTTP | Description |
|---|---|---|---|
| 1 | INVALID_REQUEST | 400 | Body fails validation: unsupported asset, disabled pair, unparseable amount, invalid address, FLOAT without refundAddress, malformed Idempotency-Key. The same code + HTTP 409 fires on Idempotency-Key reuse with a different payload. |
| 2 | AUTH_REQUIRED | 401 | One of X-API-KEY / X-API-SIGN is missing on an endpoint that requires authentication. |
| 3 | AUTH_INVALID | 401 | Unknown key, malformed signature, signature mismatch, expired or replayed nonce, decrypt failure. Generic body — never an oracle for "which" of those it was. |
| 4 | AUTH_DISABLED | 401 | Partner record enabled = false. Reachable only with a valid signature, so the operator can distinguish a kill-switched partner from a stolen-and-revoked key. |
| 5 | RATE_LIMIT | 429 | Per-partner weight budget exhausted within the 60-second sliding window. Response includes Retry-After: <seconds>. |
| 6 | NOT_FOUND | 404 | Order does not exist OR exists but belongs to a different partner OR exists and the token is wrong. The three cases collapse to one envelope. |
| 12 | EMERGENCY_INVALID_CHOICE | 400 | POST /v1/emergency body has `choice` other than `EXCHANGE`. |
| 99 | INTERNAL | 500 | Unexpected server-side condition. Already logged on our side; safe to retry. |
Code examples
# Resolve an order in status = "EMERGENCY" by resuming at the live rate.
APIKEY="rWqZ...Rg"
APISECRET="G1JV...n4"
NONCE=$(openssl rand -hex 16)
BODY='{"id":"1f8c5e0b-9c92-4d6a-b0a8-3c5f8d6e7a4b","token":"v8k3-Po9...43-char-base64url","choice":"EXCHANGE"}'
SIGN=$(printf '%s' "$BODY" | openssl dgst -sha256 -hmac "$APISECRET" | sed 's/^.* //')
curl -sS -X POST "https://0trace.io/api/v1/emergency" \
-H "Content-Type: application/json" \
-H "X-API-KEY: $APIKEY" \
-H "X-API-SIGN: $SIGN" \
-H "X-API-NONCE: $NONCE" \
--data "$BODY"Rate limit
Weight 1 per call. Counts against the default 2500 weight-unit / minute sliding-window budget per partner.
Notes
Status guard. The order must currently be in EMERGENCY. A call against an order in any other state returns { code: 1, msg: "order not in emergency state" } with HTTP 400. No further detail is exposed via this endpoint. Poll /v1/order to resynchronise.