Phoenix Prediction Docs

Errors

Common public error codes and meanings

Wallet-Facing Errors

SituationRecommended response
Player does not have funds for reserve_cashHTTP 422 with code: "insufficient_funds"
Phoenix signature is invalidHTTP 401 or 403
Request body is malformedHTTP 400
Same idempotency key is still processingHTTP 409
Same idempotency key is reused with a different payloadHTTP 422
Temporary operator outageHTTP 503

Player-Facing Phoenix Reasons

When a player command is rejected, the command reply carries a structured reason:

{
  "kind": "command",
  "outcome": "rejected",
  "reason": { "code": "validation", "message": "insufficient funds" }
}

reason.code is a closed taxonomy. Branch on it in client code; never parse reason.message, which is a human-readable string for display and logs.

reason.codeMeaning
validationRequest was well-formed but invalid for the market or order (bad amount, price, or stake, or the wallet declined the reservation)
not_foundReferenced market does not exist or is out of the operator environment
forbiddenAction is not allowed (operator not active, currency not supported, not the order owner)
conflictRequest conflicts with current state (market closed, paused, resolved, not yet open, or idempotency key reused with different parameters)
rate_limitedClient is sending requests too quickly; may include retry_after_ms
idempotency_requiredMutation requires an idempotency key and none was provided
unknown_mutationThe requested mutation is not a recognized command
internalPhoenix hit an unexpected internal condition; retry later

The most common reason.message strings, by code:

reason.messagecodeWhen
insufficient fundsvalidationOperator wallet declined the cash reservation. Transient or unreachable-wallet failures are retried internally and never surface as a distinct reason
invalid ordervalidationOrder intent failed validation (quantity, price, or budget)
a market order cannot carry a limit pricevalidationA MARKET order included a limit price
insufficient position to sellvalidationSell exceeds the player's position
order is below the minimum order sizevalidationStake under the operator's minimum
order exceeds the maximum order sizevalidationStake over the operator's maximum
amount has more decimals than the currency allowsvalidationStake precision exceeds the currency
market not foundnot_foundMarket does not belong to this operator environment or does not exist
market not availablenot_foundMarket has no published definition in this environment
operator is not active for tradingforbiddenOperator is suspended or not enabled
currency not supported by this operatorforbiddenCurrency is not configured for the operator
not the order ownerforbiddenCancel targeted another player's order
market is closedconflictMarket is no longer accepting orders
trading is pausedconflictMarket is paused
market is not yet openconflictMarket definition is not yet published
market is closed for new positionsconflictMarket is resolved
idempotency key reused with different parametersconflictSame idempotency key sent with a different order payload

A retry under the same idempotency key with identical parameters is safely de-duplicated: it returns the original order with no error. Only a key reused with different parameters conflicts.

Show friendly copy to players. Keep reason.code and reason.message in logs for support.

Operator API Errors

HTTP statusMeaning
401Signature, timestamp, operator code, or key verification failed
404Resource not found within the authenticated operator scope
422Request was authenticated but invalid for the market state or schema