# Orders

## Get Orders

> Get orders

```json
{"openapi":"3.0.1","info":{"title":"DigitalAssets","version":"1.0"},"tags":[{"name":"Orders","description":"Orders"}],"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":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth2/token","refreshUrl":"","scopes":{}}}}},"schemas":{"DigitalAssetsOrders":{"title":"Orders","type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DigitalAssetsOrder"}},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]},"DigitalAssetsOrder":{"title":"DigitalAssetsOrder","type":"object","properties":{"status":{"$ref":"#/components/schemas/OrderStatusEnum"},"side":{"$ref":"#/components/schemas/TradeSideEnum"},"orderId":{"type":"string","format":"uuid","description":"The identifier of the order."},"walletCustomerProductId":{"type":"string","format":"uuid","description":"The identifier of the wallet customer product."},"message":{"type":"string"},"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."},"externalId":{"type":"string","description":"External Id in partner's system. This value has to be unique"},"orderType":{"$ref":"#/components/schemas/OrderTypeEnum"},"marketOrderData":{"$ref":"#/components/schemas/DigitalAssetsMarketOrderData"},"executionData":{"$ref":"#/components/schemas/DigitalAssetsOrderExecutionData"},"cashCustomerProductId":{"type":"string","format":"uuid","description":"Cash customer product used for the order."}},"required":["orderId","createdOn","modifiedOn","status","walletCustomerProductId","externalId","orderType","side","cashCustomerProductId"]},"OrderStatusEnum":{"title":"OrderStatusEnum","type":"string","enum":["RECEIVED","INVALID","PENDING","CANCELED","REJECTED","FILLED","CORRECTED","SETTLED"]},"TradeSideEnum":{"title":"TradeSideEnum","type":"string","enum":["BUY","SELL"]},"OrderTypeEnum":{"title":"OrderTypeEnum","type":"string","enum":["MARKET"]},"DigitalAssetsMarketOrderData":{"title":"DigitalAssetsMarketOrderData","type":"object","properties":{"symbol":{"type":"string"},"assetType":{"$ref":"#/components/schemas/DigitalAssetTypeEnum"},"quantityType":{"$ref":"#/components/schemas/QuantityType"},"quantity":{"type":"number","minimum":0,"exclusiveMinimum":true}},"required":["symbol","assetType","quantityType","quantity"]},"DigitalAssetTypeEnum":{"title":"DigitalAssetTypeEnum","type":"string","description":"Digital Asset Type","enum":["CRYPTOCURRENCY","SECURITYTOKEN"]},"QuantityType":{"type":"string","enum":["UNIT","AMOUNT"]},"DigitalAssetsOrderExecutionData":{"title":"DigitalAssetsOrderExecutionData","type":"object","properties":{"quantity":{"type":"number","minimum":0},"executionPrice":{"description":"The execution price refers to the actual price at which a trade or transaction was executed.","type":"number","minimum":0},"executionAmount":{"description":"The execution amount refers to the total cash amount of a trade. It represents for how much money a particular asset is bought or sold at the execution price when the order is fulfilled.","type":"number","minimum":0},"feeDescription":{"description":"A description of the fee associated with the order execution.","type":"string"},"feeAmount":{"description":"The fee amount charged for the order execution.","type":"number","minimum":0}},"required":["quantity","executionPrice","executionAmount"]},"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":{"/products/{customerProductId}/digital/orders":{"get":{"summary":"Get Orders","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigitalAssetsOrders"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"operationId":"get-digital-assets-orders","tags":["Orders"],"parameters":[{"schema":{"type":"string"},"in":"query","name":"cursor","description":"String value used for pagination"},{"schema":{"type":"integer","default":20,"minimum":1},"in":"query","name":"limit","description":"Maximum number of items to return"},{"schema":{"type":"string"},"in":"query","name":"externalId","description":"External Id in partner's system. This value has to be unique"},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"startCreatedOn","description":"Display orders created on or after this date"},{"schema":{"type":"string","format":"date-time"},"in":"query","name":"endCreatedOn","description":"Display orders created on or before this date"},{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrderStatusEnum"}},"in":"query","name":"status","description":"Order statuses"}],"description":"Get orders"}}}}
```

## Get Order

> Get order

```json
{"openapi":"3.0.1","info":{"title":"DigitalAssets","version":"1.0"},"tags":[{"name":"Orders","description":"Orders"}],"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":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth2/token","refreshUrl":"","scopes":{}}}}},"schemas":{"DigitalAssetsOrder":{"title":"DigitalAssetsOrder","type":"object","properties":{"status":{"$ref":"#/components/schemas/OrderStatusEnum"},"side":{"$ref":"#/components/schemas/TradeSideEnum"},"orderId":{"type":"string","format":"uuid","description":"The identifier of the order."},"walletCustomerProductId":{"type":"string","format":"uuid","description":"The identifier of the wallet customer product."},"message":{"type":"string"},"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."},"externalId":{"type":"string","description":"External Id in partner's system. This value has to be unique"},"orderType":{"$ref":"#/components/schemas/OrderTypeEnum"},"marketOrderData":{"$ref":"#/components/schemas/DigitalAssetsMarketOrderData"},"executionData":{"$ref":"#/components/schemas/DigitalAssetsOrderExecutionData"},"cashCustomerProductId":{"type":"string","format":"uuid","description":"Cash customer product used for the order."}},"required":["orderId","createdOn","modifiedOn","status","walletCustomerProductId","externalId","orderType","side","cashCustomerProductId"]},"OrderStatusEnum":{"title":"OrderStatusEnum","type":"string","enum":["RECEIVED","INVALID","PENDING","CANCELED","REJECTED","FILLED","CORRECTED","SETTLED"]},"TradeSideEnum":{"title":"TradeSideEnum","type":"string","enum":["BUY","SELL"]},"OrderTypeEnum":{"title":"OrderTypeEnum","type":"string","enum":["MARKET"]},"DigitalAssetsMarketOrderData":{"title":"DigitalAssetsMarketOrderData","type":"object","properties":{"symbol":{"type":"string"},"assetType":{"$ref":"#/components/schemas/DigitalAssetTypeEnum"},"quantityType":{"$ref":"#/components/schemas/QuantityType"},"quantity":{"type":"number","minimum":0,"exclusiveMinimum":true}},"required":["symbol","assetType","quantityType","quantity"]},"DigitalAssetTypeEnum":{"title":"DigitalAssetTypeEnum","type":"string","description":"Digital Asset Type","enum":["CRYPTOCURRENCY","SECURITYTOKEN"]},"QuantityType":{"type":"string","enum":["UNIT","AMOUNT"]},"DigitalAssetsOrderExecutionData":{"title":"DigitalAssetsOrderExecutionData","type":"object","properties":{"quantity":{"type":"number","minimum":0},"executionPrice":{"description":"The execution price refers to the actual price at which a trade or transaction was executed.","type":"number","minimum":0},"executionAmount":{"description":"The execution amount refers to the total cash amount of a trade. It represents for how much money a particular asset is bought or sold at the execution price when the order is fulfilled.","type":"number","minimum":0},"feeDescription":{"description":"A description of the fee associated with the order execution.","type":"string"},"feeAmount":{"description":"The fee amount charged for the order execution.","type":"number","minimum":0}},"required":["quantity","executionPrice","executionAmount"]},"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":{"/digital/orders/{orderId}":{"get":{"summary":"Get Order","tags":["Orders"],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DigitalAssetsOrder"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"operationId":"get-digital-asset-order","parameters":[{"schema":{"type":"string","format":"uuid"},"name":"orderId","in":"path","required":true,"description":"Id of order we're looking for"}],"description":"Get order"}}}}
```

## Get Order Receipt

> Get order receipt

```json
{"openapi":"3.0.1","info":{"title":"DigitalAssets","version":"1.0"},"tags":[{"name":"Documents","description":"Documents"}],"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":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth2/token","refreshUrl":"","scopes":{}}}}},"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":{"/digital/orders/{orderId}/receipt":{"get":{"summary":"Get Order Receipt","tags":["Documents"],"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"}}}}},"operationId":"get-digital-asset-order-receipt","parameters":[{"schema":{"type":"string","format":"uuid"},"name":"orderId","in":"path","required":true,"description":"Id of order we're looking for"}],"description":"Get order receipt"}}}}
```

## Create Market Order

> Create order.

```json
{"openapi":"3.0.1","info":{"title":"DigitalAssets","version":"1.0"},"tags":[{"name":"Orders","description":"Orders"}],"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":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth2/token","refreshUrl":"","scopes":{}}}}},"schemas":{"CreateOrderResult":{"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"]},"OrderData":{"title":"OrderData","type":"object","required":["cryptoSymbol","tradeSide","quantityType","quantity","externalId","walletCustomerProductId","cashCustomerProductId"],"properties":{"cryptoSymbol":{"type":"string"},"tradeSide":{"$ref":"#/components/schemas/TradeSideEnum"},"quantityType":{"$ref":"#/components/schemas/QuantityType"},"quantity":{"type":"number","minimum":0,"exclusiveMinimum":true},"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."}}},"TradeSideEnum":{"title":"TradeSideEnum","type":"string","enum":["BUY","SELL"]},"QuantityType":{"type":"string","enum":["UNIT","AMOUNT"]}}},"paths":{"/digital/orders/market":{"post":{"summary":"Create Market Order","tags":["Orders"],"parameters":[{"schema":{"type":"string","format":"uuid"},"name":"Requestor-ID","in":"header","required":true,"description":"Unique requestor identification in UUID format"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderResult"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorMessage"}}}}},"operationId":"create-order","description":"Create order.","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderData"}}}}}}}}
```
