---
title: "DELETE /v4/user/accounts/{server}/{accountId}/execution/orders/{id}"
method: DELETE
path: "/v4/user/accounts/{server}/{accountId}/execution/orders/{id}"
tags: ["Trading (v4)"]
---

# DELETE /v4/user/accounts/{server}/{accountId}/execution/orders/{id}

`DELETE /v4/user/accounts/{server}/{accountId}/execution/orders/{id}`

## Request

- Base URL: `https://trading-api.oanda.com` (the document declares no server; this is the origin it was published from)
- URL: `https://trading-api.oanda.com/v4/user/accounts/{server}/{accountId}/execution/orders/{id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/oanda/apis/up-gateway-v1/docs/v4/user/accounts/:server/:accountId/execution/orders/:id/delete.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `server` 'oanda' | 'oanda-demo' | 'otms' | 'v20' | 'v20-demo' | 'oj' | 'oj-demo' | 'opt' | 'ftmo-1', required
- `accountId` string, required
- `id` string, required

## Request body

- object
  - `instrument` string, required
  - `orderType` 'MARKET' | 'STOP' | 'LIMIT' | 'TAKE_PROFIT' | 'STOP_LOSS' | 'TRAILING_STOP_LOSS' | 'GUARANTEED_STOP_LOSS' | 'MARKET_IF_TOUCHED', required
  - `direction` 'LONG' | 'SHORT', required
  - `trackingData` object
    - `instrumentCategory` string
    - `instrumentCategoryCountry` string
    - `isCFD` boolean

## Response `200`

OK

- object
  - `data` object, required
    - `id` string, required
    - `transactionId` string, required
  - `metadata` object, required
    - `transactionId` string, required
    - `engineExecutionEndTime` number, required: UTC timestamp in milliseconds when the engine finished executing the order
    - `engineExecutionStartTime` number, required: UTC timestamp in milliseconds when the engine started executing the order
    - `apiExecutionStartTime` number, required: UTC timestamp in milliseconds when the API started executing the order
    - `apiExecutionEndTime` number, required: UTC timestamp in milliseconds when the API finished executing the order
    - `engineExecutionTime` number, required: UTC timestamp in milliseconds when the engine executed the order
    - `orderType` 'MARKET' | 'MARKET_IF_TOUCHED' | 'STOP' | 'LIMIT'
    - `instrument` string
    - `server` 'oanda' | 'oanda-demo' | 'otms' | 'v20' | 'v20-demo' | 'oj' | 'oj-demo' | 'opt' | 'ftmo-1', required
    - `event` 'SubmittedOrder' | 'ModifyOrder' | 'CancelOrder' | 'ClosePosition' | 'CloseNetPosition' | 'ReducePosition' | 'ReduceNetPosition' | 'PushToFavourites' | 'RemoveFromFavourites' | 'SaveChartLayout' | 'CreateChartLayout' | 'CloseOrder' | 'ReduceOrder', required
    - `direction` 'LONG' | 'SHORT'
    - `orderId` string, required
    - `accountId` string, required
    - `takeProfit` number
    - `stopLoss` number
    - `price` number, required
    - `expiryDate` number: UTC timestamp in milliseconds
    - `size` number

## Other responses

- `400`: FAIL

---

[API](https://skmtc.dev/oanda/apis/up-gateway-v1.md) - [All operations](https://skmtc.dev/oanda/apis/up-gateway-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/oanda/apis/up-gateway-v1/revisions/395d645513bf?raw)
