# Order

## getWalletOrders

> Returns all open orders sent from the specified wallet, optionally restricted to one trading pair.\
> If only\_open is False, returns completed, cancelled and rejected orders instead.<br>

```json
{"openapi":"3.1.0","info":{"title":"EDX Public API Model","version":"1.0.0"},"tags":[{"name":"Order"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization"}},"parameters":{"cursor":{"name":"cursor","description":"Paginate through collections of data by setting the cursor parameter to a next_cursor attribute returned by a previous response.\n","in":"query","required":false,"schema":{"type":"string"}},"limit":{"name":"limit","description":"The maximum number of items to return.\n","in":"query","required":false,"schema":{"type":"integer","format":"int64"}},"count":{"name":"count","description":"Returns the total number of items in the collection.\n","in":"query","required":false,"schema":{"type":"boolean"}}},"schemas":{"OrderList":{"required":["items"],"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"next_cursor":{"type":"string","maxLength":255},"total_count":{"type":"integer","format":"int64","minimum":0}}},"Order":{"required":["id","tradingPairId","orderKind","orderType","initialQuantity","remainingQuantity","address"],"type":"object","properties":{"id":{"type":"string","readOnly":true,"maxLength":255},"creationDate":{"type":"string","format":"date-time","readOnly":true},"modificationDate":{"type":"string","format":"date-time","readOnly":true},"externalOrderId":{"description":"ID generated by the order book smart contract\n","type":"integer","format":"int64","readOnly":true,"minimum":0},"tradingPairId":{"description":"The trading pair that the order belongs to\n","type":"string","maxLength":255},"orderKind":{"description":"The kind of the order (buy/sell)\n","$ref":"#/components/schemas/OrderKindEnum"},"orderType":{"description":"The type of the order (currently only limit orders)\n","$ref":"#/components/schemas/OrderTypeEnum"},"initialQuantity":{"description":"Initial order size in financial instrument (base) tokens (as sent to the order book)\n","type":"string","pattern":"^(-)?[0-9][0-9]*(?:.[0-9]{1,18})?$","maxLength":255},"remainingQuantity":{"description":"Remaining order size in financial instrument (base) tokens (can be lower than the initial quantity in case of partial executions)\n","type":"string","pattern":"^(-)?[0-9][0-9]*(?:.[0-9]{1,18})?$","maxLength":255},"priceLimit":{"description":"The price limit is mandatory for limit orders\n","type":"string","pattern":"^(-)?[0-9][0-9]*(?:.[0-9]{1,18})?$","maxLength":255},"status":{"description":"The status of the order\n","$ref":"#/components/schemas/OrderStatusEnum"},"statusReason":{"description":"The reason why an order was cancelled or rejected\n","$ref":"#/components/schemas/OrderStatusReasonEnum"},"statusChangeTime":{"description":"The date and time when the order was fully executed, rejected or cancelled\n","type":"string","format":"date-time"},"finalityStatus":{"description":"Indicates whether the current state of the order is considered final by 21X\n","$ref":"#/components/schemas/FinalityStatusEnum","readOnly":true},"ownerReportingData":{"description":"The bit string that the creator passed as reportingData to the smart contract, encoded as a hexadecimal string\n","type":"string","maxLength":255},"crossIdentifier":{"description":"32-bit integer that can be used to distinguish between participants using the same wallet, disabling self-trade checks between different cross-IDs.\n","type":"integer","format":"int64","minimum":0},"validUntil":{"description":"The latest date at which the order is automatically cancelled\n","type":"string","format":"date-time"},"executionCondition":{"description":"Execution condition specified during order creation (if any)\n","$ref":"#/components/schemas/OrderExecutionConditionEnum"},"address":{"description":"The address of the wallet that the order was sent from\n","type":"string","pattern":"^(0x)?[0-9a-fA-F]+$","maxLength":255}}},"OrderKindEnum":{"type":"string","enum":["BUY","SELL"]},"OrderTypeEnum":{"type":"string","enum":["LIMIT","MARKET"]},"OrderStatusEnum":{"type":"string","enum":["OPEN","COMPLETED","CANCELLED","REJECTED","CANCELLED_PARTIAL","REJECTED_PARTIAL"]},"OrderStatusReasonEnum":{"type":"string","enum":["N_A","EXECUTED_SUCCESSFULLY","CREATOR_CANCEL","ADMIN_CANCEL","PARTICIPANT_REQUEST","MARKET_CLOSE","AUTHORITY_REQUEST","VENUE_REQUEST","OTHER","SELF_TRADE","TOO_MANY_MATCHES","TICK_SIZE_VIOLATION","MINIMUM_VOLUME","MAXIMUM_VOLUME","MINIMUM_VALUE","MAXIMUM_VALUE","PRICE_COLLAR","UPPER_STATIC_PRICE_RANGE","LOWER_STATIC_PRICE_RANGE","UPPER_DYNAMIC_PRICE_RANGE","LOWER_DYNAMIC_PRICE_RANGE","EXECUTION_CONDITION_FOK","EXECUTION_CONDITION_IOC","EXECUTION_CONDITION_BOC"]},"FinalityStatusEnum":{"type":"string","enum":["NON_FINAL","FINAL"]},"OrderExecutionConditionEnum":{"type":"string","enum":["NONE","FILL_OR_KILL","IMMEDIATE_OR_CANCEL","BOOK_OR_CANCEL"]},"AppError":{"required":["code","message"],"type":"object","properties":{"code":{"description":"A identifier that categorizes the error","type":"string"},"message":{"description":"A brief, human-readable message about the error","type":"string"},"status":{"description":"The HTTP response code","type":"integer","format":"int32"},"path":{"description":"A URI that identifies the specific occurrence of the error","type":"string"},"timestamp":{"type":"string","format":"date-time"},"details":{"description":"Detailed explanations of the error","type":"array","items":{"type":"string"}}}}},"responses":{"DefaultError":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppError"}}}}}},"paths":{"/wallets/{wallet_address}/orders":{"get":{"tags":["Order"],"summary":"getWalletOrders","description":"Returns all open orders sent from the specified wallet, optionally restricted to one trading pair.\nIf only_open is False, returns completed, cancelled and rejected orders instead.\n","operationId":"getWalletOrders","parameters":[{"name":"wallet_address","in":"path","required":true,"schema":{"type":"string"}},{"name":"trading_pair","in":"query","required":false,"schema":{"type":"string"}},{"name":"only_open","in":"query","required":false,"schema":{"type":"boolean"}},{"$ref":"#/components/parameters/cursor"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/count"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderList"}}}},"default":{"$ref":"#/components/responses/DefaultError"}}}}}}
```

## POST /wallets/{wallet\_address}/primarymarketorder

> createPrimaryMarketOrder

```json
{"openapi":"3.1.0","info":{"title":"EDX Public API Model","version":"1.0.0"},"tags":[{"name":"Order"}],"servers":[{"url":"/api/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"Authorization"}},"schemas":{"SignedPrimaryMarketOrderPayload":{"required":["payload","signature"],"type":"object","properties":{"payload":{"description":"The primary market order data\n","$ref":"#/components/schemas/PrimaryMarketOrderData"},"signature":{"description":"Digital signature of the payload data, created by the sending wallet\n","type":"string","maxLength":255}}},"PrimaryMarketOrderData":{"required":["orderKind","financialInstrumentId","quantity","quantityType","timestamp"],"type":"object","properties":{"orderKind":{"description":"The kind of the order (buy/sell)\n","$ref":"#/components/schemas/OrderKindEnum"},"financialInstrumentId":{"description":"The ID of the financial instrument that shall be traded\n","type":"string","maxLength":255},"quantity":{"description":"The number of financial instrument tokens that shall be traded\n","type":"string","pattern":"^(-)?[0-9][0-9]*(?:.[0-9]{1,18})?$","maxLength":255},"quantityType":{"description":"Specifies if the quantity is expressed in units or monetary amount\n","$ref":"#/components/schemas/OrderQuantityTypeEnum"},"priceLimit":{"description":"The price limit is optional since it is only applicable in some cases\n","type":"string","pattern":"^(-)?[0-9][0-9]*(?:.[0-9]{1,18})?$","maxLength":255},"settlementCurrency":{"description":"The currency used for the price limit, and in which the trade should be settled\n","type":"string","pattern":"^[A-Z]{3}$","maxLength":255},"timestamp":{"description":"Time of order creation (in UTC time zone)\n","type":"string","maxLength":255},"additionalData":{"description":"Arbitrary additional data to be added to the order information\n","type":"object"}}},"OrderKindEnum":{"type":"string","enum":["BUY","SELL"]},"OrderQuantityTypeEnum":{"type":"string","enum":["UNIT","MONEY"]},"AppError":{"required":["code","message"],"type":"object","properties":{"code":{"description":"A identifier that categorizes the error","type":"string"},"message":{"description":"A brief, human-readable message about the error","type":"string"},"status":{"description":"The HTTP response code","type":"integer","format":"int32"},"path":{"description":"A URI that identifies the specific occurrence of the error","type":"string"},"timestamp":{"type":"string","format":"date-time"},"details":{"description":"Detailed explanations of the error","type":"array","items":{"type":"string"}}}}},"responses":{"DefaultError":{"description":"Unexpected error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppError"}}}}}},"paths":{"/wallets/{wallet_address}/primarymarketorder":{"post":{"tags":["Order"],"summary":"createPrimaryMarketOrder","operationId":"createPrimaryMarketOrder","parameters":[{"name":"wallet_address","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignedPrimaryMarketOrderPayload"}}}},"responses":{"200":{"description":"OK"},"default":{"$ref":"#/components/responses/DefaultError"}}}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.21x.eu/api-reference-v1.0/order.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
