Reference
Error codes
Rejection codes in decisions and HTTP error codes from the services.
A2M reports failures in two places:
- In a signed decision. A rule that fails produces a
REJECTdecision whosecodeandmessagename the rule. This is a normal, attributable answer, not a transport error. Over MCP it is returned as a tool result the model can read. - As an HTTP error. Malformed requests, conflicts, executor refusals and outages return an HTTP status and a body:
{ "error": { "code": "A2M_BAD_SIGNATURE", "apex_code": null, "category": "validation", "message": "decision signature did not verify" } }category is validation or operational. apex_code is an optional secondary code aligned with the error classes of the draft APEX agent-venue specification, where one applies. A 4xx other than 408 and 429 will not succeed on retry.
Rule rejections (in decisions)
Section titled “Rule rejections (in decisions)”| Code | Secondary | Meaning |
|---|---|---|
A2M_AGENT_UNKNOWN |
APEX_4002 |
Agent is not registered |
A2M_AGENT_REVOKED |
APEX_4002 |
Agent is revoked |
A2M_MANDATE_INACTIVE |
APEX_4002 |
Mandate is missing, revoked or expired |
A2M_MANDATE_AMBIGUOUS |
APEX_4002 |
More than one live mandate; fail closed |
A2M_INSTRUMENT |
APEX_4010 |
Instrument not on the mandate allowlist |
A2M_VENUE |
APEX_4011 |
Venue not on the mandate allowlist |
A2M_INSTRUMENT_UNKNOWN |
APEX_4010 |
Instrument not listed on the venue |
A2M_INSTRUMENT_HALTED |
APEX_4030 |
Instrument is halted or not tradable |
A2M_UNSUPPORTED_PRODUCT |
APEX_4010 |
Product class has no risk treatment yet; fail closed |
A2M_UNIT_INACTIVE |
APEX_4011 |
No active protected unit for this venue and product |
A2M_ORDER_TYPE |
APEX_4011 |
Broker does not accept this order type |
A2M_TIME_IN_FORCE |
APEX_4011 |
Broker does not accept this time in force |
A2M_ORDER_CLASS |
APEX_4011 |
Venue does not declare this order class for the asset class |
A2M_NOTIONAL |
APEX_4011 |
A notional order is not accepted for this asset class or time in force |
A2M_OPTIONS_LEVEL |
APEX_4011 |
The order needs a higher options level than the rules allow |
A2M_UNCOVERED |
APEX_4011 |
A short call is not covered by free shares of the underlying |
A2M_UNDEFINED_RISK |
APEX_4011 |
A spread’s risk is undefined (for example a net short call) |
A2M_NO_POSITION |
APEX_4011 |
There is no long option position to exercise |
A2M_ASSET_CLASS |
APEX_4011 |
The venue does not declare this asset class |
A2M_ACCOUNT_UNKNOWN |
APEX_4002 |
User has no account at the venue |
A2M_ACCOUNT_INACTIVE |
APEX_4002 |
Account is not active |
A2M_MARKET_CLOSED |
APEX_4030 |
The instrument session is closed. With extended_hours true, this means both regular and extended sessions are closed |
A2M_EXTENDED_HOURS |
APEX_4011 |
extended_hours was requested on a market that has no extended sessions |
A2M_STALE_PRICE |
APEX_4024 |
Reference price missing, invalid, stale or in the future |
A2M_LOT_SIZE |
APEX_4011 |
Quantity is not a whole number of lots |
A2M_TICK_SIZE |
APEX_4011 |
Limit price is not on the tick |
A2M_PRICE_BAND |
APEX_4011 |
Limit is outside the market price band |
A2M_PRICE_COLLAR |
APEX_4011 |
Limit missing or outside the mandate price collar |
A2M_BROKER_NOTIONAL |
APEX_4011 |
Notional below the broker minimum or above the maximum |
A2M_FAT_FINGER_QTY |
APEX_4011 |
Quantity not positive or above the mandate cap |
A2M_FAT_FINGER_NOTIONAL |
APEX_4011 |
Notional above the mandate cap |
A2M_LIMIT_MISSING |
APEX_4011 |
No limits row for this venue and quote currency |
A2M_KILL_HALT |
APEX_4023 |
Kill switch is set to halt |
A2M_REDUCE_ONLY |
APEX_4023 |
Order would not reduce, or the account is reduce-only |
A2M_DAILY_LOSS |
APEX_4022 |
Daily loss limit reached; only reducing orders pass |
A2M_SHORT_DISABLED |
APEX_4021 |
Order would open or extend a short, or flip through flat |
A2M_POSITION_LIMIT |
APEX_4021 |
Projected position above the mandate limit |
A2M_MAX_OPEN |
APEX_4021 |
Too many open orders |
A2M_RATE_LIMIT |
APEX_4040 |
Order rate limit reached |
A2M_BUYING_POWER |
APEX_4020 |
Buying power below the required reservation |
A2M_BUDGET |
APEX_4020 |
The mandate’s budget cannot cover the reservation |
A2M_ACCOUNT_CASH |
APEX_4020 |
Broker cash unknown or insufficient, including the cash needed to exercise a call |
An approval that ends without an executable decision carries A2M_APPROVAL_DENIED (a human declined) or A2M_APPROVAL_EXPIRED (nobody answered in time).
HTTP errors
Section titled “HTTP errors”| Code | HTTP | Meaning |
|---|---|---|
APEX_4001 |
401 | Bearer token missing or invalid |
APEX_4011 |
400 | Intent is malformed (for example an unknown time_in_force, more than 9 decimal places, or a JSON number in a money field) |
A2M_IDEMPOTENCY |
409 | intent_id reused for a different order, or client_order_id reused with a different decision_id |
A2M_BAD_SIGNATURE |
422 | Decision signature did not verify |
A2M_BAD_DECISION |
422 | Decision payload is malformed or uses an unknown version or field |
A2M_NOT_AUTHORIZED |
422 / 404 / 409 | Decision is not executable, or unknown |
A2M_ENFORCEMENT |
422 | Enforcement mode not supported by this executor |
A2M_DECISION_EXPIRED |
422 | Decision expired before send |
A2M_DECISION_CONSUMED |
409 | Decision was already sent |
A2M_NO_ROUTE |
422 | Executor has no connection to the venue |
A2M_ORDER_TYPE, A2M_TIME_IN_FORCE, A2M_ORDER_CLASS, A2M_NOTIONAL, A2M_REPLACE, A2M_ACTION |
422 | Venue capabilities do not include this form for the instrument’s asset class. The combination is refused, never coerced |
A2M_REPLACE |
422 | The named order cannot be replaced (wrong agent, venue, instrument or side; not a simple order; or not in acked or partially_filled) |
A2M_EXTENDED_HOURS |
422 | The executor cannot pass extended_hours to this venue yet, or the venue does not accept extended-hours orders. The decision is voided rather than sent as a regular-hours order |
A2M_VENUE_DOWN |
503 | Venue unavailable, or capabilities unreadable; fail closed |
A2M_ORDER_STATE |
409 / 404 | Illegal state transition, or unknown order |
A2M_UNKNOWN |
409 | The order is in unknown; it must be reconciled before it can be cancelled |
A2M_CANCEL_PENDING |
409 | A cancel was sent but the venue has not yet confirmed it. The order is not cancelled. Reconciliation will settle it |
A2M_BLIND_RESEND |
409 | Refusing to resend after an unknown or in-flight submit |
A2M_APPROVAL |
404 / 409 | Unknown approval, or already decided |
A2M_RATE_LIMIT |
429 | Too many requests for this credential |
A2M_UPSTREAM |
503 | A service behind the gateway is unavailable |
A2M_INTERNAL |
500 | Internal error |
A2M_UNKNOWN and A2M_CANCEL_PENDING are operational. Retrying a cancel after A2M_CANCEL_PENDING is safe; the executor will confirm against a later snapshot. Retrying a cancel after A2M_UNKNOWN is not: wait for reconciliation.
Control-plane codes (A2M_TENANT, A2M_USER, A2M_ACCOUNT, A2M_OAUTH_BINDING, A2M_RESERVATION, A2M_EVIDENCE) are implementation-specific and not part of the specification.