# Orders

## Create Market Order

> Create a new market order

```json
{"openapi":"3.0.1","info":{"title":"WAWEX","version":"1.0"},"tags":[{"name":"Wawex","description":"Wawex"}],"servers":[{"url":"https://tvda-api.platform-test.tradevest.ai","description":"Test"},{"url":"https://tvda-api.platform-pretest.tradevest.ai","description":"Pretest"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"Bearer"}},"schemas":{"CreateMarketOrderRequest":{"type":"object","properties":{"symbol":{"type":"string","description":"Trading symbol"},"quantity":{"type":"number","format":"decimal","minimum":0,"exclusiveMinimum":true,"description":"Order quantity"},"quantityType":{"$ref":"#/components/schemas/QuantityTypeEnum"},"side":{"$ref":"#/components/schemas/TradeSideEnum"},"externalId":{"type":"string","description":"External Id in partner's system. This value has to be unique"},"walletCustomerProductId":{"type":"string","format":"uuid","description":"Wallet customer product used for the order."},"cashCustomerProductId":{"type":"string","format":"uuid","description":"Cash customer product used for the order."}},"required":["symbol","quantity","quantityType","side","externalId","walletCustomerProductId","cashCustomerProductId"]},"QuantityTypeEnum":{"type":"string","enum":["UNIT"]},"TradeSideEnum":{"type":"string","enum":["BUY","SELL"]},"CreateMarketOrder":{"title":"CreateOrderResult","type":"object","required":["orderId","createdOn"],"properties":{"orderId":{"type":"string","format":"uuid"},"createdOn":{"type":"string","format":"date-time","description":"The date denoting when the order's record was initially created."}}},"ErrorMessage":{"title":"ErrorMessage","type":"object","properties":{"message":{"type":"string"},"responseType":{"type":"string"},"validationString":{"minLength":1,"type":"string"},"requestId":{"type":"string"},"errorCode":{"type":"string","maxLength":255},"errorDetails":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"}}},"required":["message","responseType","requestId"]},"ErrorDetails":{"title":"ErrorDetails","type":"object","properties":{"field":{"type":"string","maxLength":255},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetailsExplanation"}}},"required":["field"]},"ErrorDetailsExplanation":{"title":"ErrorDetailsExplanation","type":"object","properties":{"code":{"type":"string","maxLength":255},"parameter":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"paths":{"/wawex/orders/market":{"post":{"summary":"Create Market Order","operationId":"create-market-order","description":"Create a new market order","tags":["Wawex"],"parameters":[{"schema":{"type":"string","format":"uuid"},"name":"Requestor-ID","in":"header","required":true,"description":"Unique requestor identification in UUID format"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMarketOrderRequest"}}},"description":"Market order data"},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMarketOrder"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}}}}}
```

## Get Order

> Get order details by ID

```json
{"openapi":"3.0.1","info":{"title":"WAWEX","version":"1.0"},"tags":[{"name":"Wawex","description":"Wawex"}],"servers":[{"url":"https://tvda-api.platform-test.tradevest.ai","description":"Test"},{"url":"https://tvda-api.platform-pretest.tradevest.ai","description":"Pretest"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"Bearer"}},"schemas":{"Order":{"type":"object","properties":{"orderId":{"type":"string","format":"uuid","description":"The identifier of the order."},"exAnteId":{"type":"string","format":"uuid","description":"The identifier of the ex-ante document."},"createdOn":{"type":"string","format":"date-time","description":"The timestamp when the order was received."},"modifiedOn":{"type":"string","format":"date-time","readOnly":true,"description":"The timestamp when the order has changed the status."},"status":{"$ref":"#/components/schemas/OrderStatusEnum"},"message":{"type":"string"},"externalId":{"type":"string","description":"External Id in partner's system. This value has to be unique"},"side":{"$ref":"#/components/schemas/TradeSideEnum"},"walletCustomerProductId":{"type":"string","format":"uuid","description":"The identifier of the wallet customer product."},"cashCustomerProductId":{"type":"string","format":"uuid","description":"Cash customer product used for the order."},"symbol":{"type":"string","description":"Trading symbol of the tokenized asset."},"quantity":{"type":"number","minimum":0,"exclusiveMinimum":true,"description":"Number of units ordered."},"quantityType":{"$ref":"#/components/schemas/QuantityTypeEnum"},"orderType":{"$ref":"#/components/schemas/WawexOrderTypeEnum"},"exchangeCode":{"$ref":"#/components/schemas/WawexExchangeCodeEnum"},"execution":{"$ref":"#/components/schemas/OrderExecution"},"partialExecutions":{"type":"array","description":"List of partial executions","items":{"$ref":"#/components/schemas/PartialExecution"}}},"required":["orderId","createdOn","modifiedOn","status","side","walletCustomerProductId","cashCustomerProductId","externalId","symbol","quantity","quantityType","orderType","exchangeCode"]},"OrderStatusEnum":{"title":"OrderStatusEnum","enum":["RECEIVED","INVALID","PENDING","CANCELED","REJECTED","FILLED","CORRECTED","SETTLED"]},"TradeSideEnum":{"type":"string","enum":["BUY","SELL"]},"QuantityTypeEnum":{"type":"string","enum":["UNIT"]},"WawexOrderTypeEnum":{"type":"string","enum":["MARKET"]},"WawexExchangeCodeEnum":{"type":"string","enum":["TVM"]},"OrderExecution":{"title":"OrderExecution","type":"object","properties":{"executionPrice":{"type":"number","description":"The average price per unit of the total execution"},"executionQuantity":{"type":"number"},"remainingQuantity":{"type":"number"},"valueDate":{"type":"string","format":"date"},"bookingDate":{"type":"string","format":"date"},"transactionTime":{"type":"string","format":"date-time"},"amount":{"type":"number","multipleOf":0.01,"description":"Total sum of all executions excluding fees."},"feeAmount":{"type":"number","multipleOf":0.01},"feeDescription":{"type":"string"},"germanCit":{"type":"number","format":"decimal","description":"Total sum of german capital income tax amount of the total execution"},"solidaritySurcharge":{"type":"number","format":"decimal","description":"Total sum of german solidarity surcharge tax amount of the total execution"},"churchTax":{"type":"number","format":"decimal","description":"Total sum of german church tax amount of the total execution"},"amountCurrency":{"$ref":"#/components/schemas/CurrencyEnum"}},"required":["executionPrice","executionQuantity","transactionTime","amount","amountCurrency","germanCit","solidaritySurcharge","churchTax"]},"CurrencyEnum":{"title":"CurrencyEnum","type":"string","description":"Currency code in ISO 4217","enum":["EUR"]},"PartialExecution":{"title":"PartialExecution","type":"object","properties":{"executionId":{"type":"string","format":"uuid"},"executionPrice":{"type":"number"},"executionQuantity":{"type":"number"},"amount":{"type":"number","multipleOf":0.01},"executionTime":{"type":"string","format":"date-time"},"valueDate":{"type":"string","format":"date"},"bookingDate":{"type":"string","format":"date"},"status":{"$ref":"#/components/schemas/OrderStatusEnum"},"taxData":{"type":"array","items":{"$ref":"#/components/schemas/TaxData"}},"feeAmount":{"type":"number","multipleOf":0.01},"feeDescription":{"type":"string"}},"required":["executionId","executionPrice","executionQuantity","executionTime","amount","valueDate","bookingDate","status"]},"TaxData":{"title":"TaxData","type":"object","properties":{"germanCit":{"type":"number","format":"decimal"},"solidaritySurcharge":{"type":"number","format":"decimal"},"churchTax":{"type":"number","format":"decimal"}},"required":["germanCit","solidaritySurcharge","churchTax"]},"ErrorMessage":{"title":"ErrorMessage","type":"object","properties":{"message":{"type":"string"},"responseType":{"type":"string"},"validationString":{"minLength":1,"type":"string"},"requestId":{"type":"string"},"errorCode":{"type":"string","maxLength":255},"errorDetails":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"}}},"required":["message","responseType","requestId"]},"ErrorDetails":{"title":"ErrorDetails","type":"object","properties":{"field":{"type":"string","maxLength":255},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetailsExplanation"}}},"required":["field"]},"ErrorDetailsExplanation":{"title":"ErrorDetailsExplanation","type":"object","properties":{"code":{"type":"string","maxLength":255},"parameter":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"paths":{"/wawex/orders/{orderId}":{"get":{"summary":"Get Order","operationId":"get-order","description":"Get order details by ID","tags":["Wawex"],"parameters":[{"schema":{"type":"string","format":"uuid"},"name":"orderId","in":"path","required":true,"description":"Order ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}}}}}
```

## Cancel order

> Cancel an existing order

```json
{"openapi":"3.0.1","info":{"title":"WAWEX","version":"1.0"},"tags":[{"name":"Wawex","description":"Wawex"}],"servers":[{"url":"https://tvda-api.platform-test.tradevest.ai","description":"Test"},{"url":"https://tvda-api.platform-pretest.tradevest.ai","description":"Pretest"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"Bearer"}},"schemas":{"CancelOrderResult":{"type":"object"},"ErrorMessage":{"title":"ErrorMessage","type":"object","properties":{"message":{"type":"string"},"responseType":{"type":"string"},"validationString":{"minLength":1,"type":"string"},"requestId":{"type":"string"},"errorCode":{"type":"string","maxLength":255},"errorDetails":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"}}},"required":["message","responseType","requestId"]},"ErrorDetails":{"title":"ErrorDetails","type":"object","properties":{"field":{"type":"string","maxLength":255},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetailsExplanation"}}},"required":["field"]},"ErrorDetailsExplanation":{"title":"ErrorDetailsExplanation","type":"object","properties":{"code":{"type":"string","maxLength":255},"parameter":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"paths":{"/wawex/orders/{orderId}":{"delete":{"summary":"Cancel order","operationId":"cancel-order","description":"Cancel an existing order","tags":["Wawex"],"parameters":[{"schema":{"type":"string","format":"uuid"},"name":"Requestor-ID","in":"header","required":true,"description":"Unique requestor identification in UUID format"},{"schema":{"type":"string","format":"uuid"},"name":"orderId","in":"path","required":true,"description":"Order ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelOrderResult"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}}}}}
```

## Get Orders

> Get list of orders with optional filtering

```json
{"openapi":"3.0.1","info":{"title":"WAWEX","version":"1.0"},"tags":[{"name":"Wawex","description":"Wawex"}],"servers":[{"url":"https://tvda-api.platform-test.tradevest.ai","description":"Test"},{"url":"https://tvda-api.platform-pretest.tradevest.ai","description":"Pretest"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"Bearer"}},"schemas":{"OrdersResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"pagination":{"$ref":"#/components/schemas/Pagination"}}},"Order":{"type":"object","properties":{"orderId":{"type":"string","format":"uuid","description":"The identifier of the order."},"exAnteId":{"type":"string","format":"uuid","description":"The identifier of the ex-ante document."},"createdOn":{"type":"string","format":"date-time","description":"The timestamp when the order was received."},"modifiedOn":{"type":"string","format":"date-time","readOnly":true,"description":"The timestamp when the order has changed the status."},"status":{"$ref":"#/components/schemas/OrderStatusEnum"},"message":{"type":"string"},"externalId":{"type":"string","description":"External Id in partner's system. This value has to be unique"},"side":{"$ref":"#/components/schemas/TradeSideEnum"},"walletCustomerProductId":{"type":"string","format":"uuid","description":"The identifier of the wallet customer product."},"cashCustomerProductId":{"type":"string","format":"uuid","description":"Cash customer product used for the order."},"symbol":{"type":"string","description":"Trading symbol of the tokenized asset."},"quantity":{"type":"number","minimum":0,"exclusiveMinimum":true,"description":"Number of units ordered."},"quantityType":{"$ref":"#/components/schemas/QuantityTypeEnum"},"orderType":{"$ref":"#/components/schemas/WawexOrderTypeEnum"},"exchangeCode":{"$ref":"#/components/schemas/WawexExchangeCodeEnum"},"execution":{"$ref":"#/components/schemas/OrderExecution"},"partialExecutions":{"type":"array","description":"List of partial executions","items":{"$ref":"#/components/schemas/PartialExecution"}}},"required":["orderId","createdOn","modifiedOn","status","side","walletCustomerProductId","cashCustomerProductId","externalId","symbol","quantity","quantityType","orderType","exchangeCode"]},"OrderStatusEnum":{"title":"OrderStatusEnum","enum":["RECEIVED","INVALID","PENDING","CANCELED","REJECTED","FILLED","CORRECTED","SETTLED"]},"TradeSideEnum":{"type":"string","enum":["BUY","SELL"]},"QuantityTypeEnum":{"type":"string","enum":["UNIT"]},"WawexOrderTypeEnum":{"type":"string","enum":["MARKET"]},"WawexExchangeCodeEnum":{"type":"string","enum":["TVM"]},"OrderExecution":{"title":"OrderExecution","type":"object","properties":{"executionPrice":{"type":"number","description":"The average price per unit of the total execution"},"executionQuantity":{"type":"number"},"remainingQuantity":{"type":"number"},"valueDate":{"type":"string","format":"date"},"bookingDate":{"type":"string","format":"date"},"transactionTime":{"type":"string","format":"date-time"},"amount":{"type":"number","multipleOf":0.01,"description":"Total sum of all executions excluding fees."},"feeAmount":{"type":"number","multipleOf":0.01},"feeDescription":{"type":"string"},"germanCit":{"type":"number","format":"decimal","description":"Total sum of german capital income tax amount of the total execution"},"solidaritySurcharge":{"type":"number","format":"decimal","description":"Total sum of german solidarity surcharge tax amount of the total execution"},"churchTax":{"type":"number","format":"decimal","description":"Total sum of german church tax amount of the total execution"},"amountCurrency":{"$ref":"#/components/schemas/CurrencyEnum"}},"required":["executionPrice","executionQuantity","transactionTime","amount","amountCurrency","germanCit","solidaritySurcharge","churchTax"]},"CurrencyEnum":{"title":"CurrencyEnum","type":"string","description":"Currency code in ISO 4217","enum":["EUR"]},"PartialExecution":{"title":"PartialExecution","type":"object","properties":{"executionId":{"type":"string","format":"uuid"},"executionPrice":{"type":"number"},"executionQuantity":{"type":"number"},"amount":{"type":"number","multipleOf":0.01},"executionTime":{"type":"string","format":"date-time"},"valueDate":{"type":"string","format":"date"},"bookingDate":{"type":"string","format":"date"},"status":{"$ref":"#/components/schemas/OrderStatusEnum"},"taxData":{"type":"array","items":{"$ref":"#/components/schemas/TaxData"}},"feeAmount":{"type":"number","multipleOf":0.01},"feeDescription":{"type":"string"}},"required":["executionId","executionPrice","executionQuantity","executionTime","amount","valueDate","bookingDate","status"]},"TaxData":{"title":"TaxData","type":"object","properties":{"germanCit":{"type":"number","format":"decimal"},"solidaritySurcharge":{"type":"number","format":"decimal"},"churchTax":{"type":"number","format":"decimal"}},"required":["germanCit","solidaritySurcharge","churchTax"]},"Pagination":{"title":"Pagination","type":"object","properties":{"cursor":{"type":"string","description":"String value used for pagination, which should be set in next page request."},"limit":{"type":"integer","description":"Maximum number of returned items"}},"required":["cursor","limit"]},"ErrorMessage":{"title":"ErrorMessage","type":"object","properties":{"message":{"type":"string"},"responseType":{"type":"string"},"validationString":{"minLength":1,"type":"string"},"requestId":{"type":"string"},"errorCode":{"type":"string","maxLength":255},"errorDetails":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"}}},"required":["message","responseType","requestId"]},"ErrorDetails":{"title":"ErrorDetails","type":"object","properties":{"field":{"type":"string","maxLength":255},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetailsExplanation"}}},"required":["field"]},"ErrorDetailsExplanation":{"title":"ErrorDetailsExplanation","type":"object","properties":{"code":{"type":"string","maxLength":255},"parameter":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"paths":{"/wawex/products/{customerProductId}/orders":{"get":{"summary":"Get Orders","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrdersResponse"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"operationId":"list-orders","description":"Get list of orders with optional filtering","tags":["Wawex"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"cursor","description":"String value used for pagination","required":false},{"schema":{"type":"integer","default":20,"minimum":1},"in":"query","name":"limit","description":"Maximum number of items to return","required":false},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"startCreatedOn","description":"Display orders created on or after this date","required":false},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"endCreatedOn","description":"Display orders created on or before this date","required":false},{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrderStatusEnum"}},"in":"query","name":"status","description":"Order statuses"}]}}}}
```

## Get Order Receipt

> Get trade receipt details

```json
{"openapi":"3.0.1","info":{"title":"WAWEX","version":"1.0"},"tags":[{"name":"Wawex","description":"Wawex"}],"servers":[{"url":"https://tvda-api.platform-test.tradevest.ai","description":"Test"},{"url":"https://tvda-api.platform-pretest.tradevest.ai","description":"Pretest"}],"security":[{"Bearer":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"Bearer"}},"schemas":{"ErrorMessage":{"title":"ErrorMessage","type":"object","properties":{"message":{"type":"string"},"responseType":{"type":"string"},"validationString":{"minLength":1,"type":"string"},"requestId":{"type":"string"},"errorCode":{"type":"string","maxLength":255},"errorDetails":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"}}},"required":["message","responseType","requestId"]},"ErrorDetails":{"title":"ErrorDetails","type":"object","properties":{"field":{"type":"string","maxLength":255},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetailsExplanation"}}},"required":["field"]},"ErrorDetailsExplanation":{"title":"ErrorDetailsExplanation","type":"object","properties":{"code":{"type":"string","maxLength":255},"parameter":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"paths":{"/wawex/orders/{orderId}/receipt":{"get":{"summary":"Get Order Receipt","operationId":"get-receipt","description":"Get trade receipt details","tags":["Wawex"],"parameters":[{"schema":{"type":"string","format":"uuid"},"in":"path","name":"orderId","description":"Order identifier","required":true}],"responses":{"200":{"description":"OK","content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}}}}}}
```
