Sway Charts API Documentation
  • REST API Specification
    • Getting Started
      • Introduction
      • Errors
      • API Versioning
      • Conditional Requests & Updates
      • Entity Versioning
      • Data Types and Formats
      • Rate Limits & Throttling
    • Authentication & Authorization
      • HMAC Authentication
      • POST Create Session Token
      • POST Ping
      • POST Logout
    • Trading
      • POST Place Order
      • PUT Modify Order
      • DELETE Cancel Order
    • Reference Data
      • GET List Instruments
      • List Instrument Details
    • Users and Accounts
      • GET Get Users
      • GET List Account Portfolio
      • GET List Open Positions
      • GET List Open Orders
      • GET List Cash Transfers
      • GET POST List Orders
      • GET List Account Metrics
      • GET List Account Events
    • Market Data
      • POST Request Market Data
    • Conversion Rates
      • POST Get Conversion Rates
    • Cash Transaction
      • Single Order Request
      • Order Group Request
      • Order Response
      • Instrument
      • Instrument Details
      • Trading Session
      • Limit Value
      • Margin Rate
      • Margin Tier
      • User Details
      • Account Details
      • Account Portfolio
      • Balance
      • Position
      • Order
      • Order Leg
      • Execution
      • Cash Transfer
      • Historic Order List
      • Account Metrics
      • Position Metrics
      • Currency Metrics
      • Account Event
      • Market Data Request
      • Market Data Event Type
      • Market Data List
      • Quote
      • Candle
      • Conversion Rate
    • Revision History
Powered by GitBook
On this page
  1. REST API Specification
  2. Trading

DELETE Cancel Order

PreviousPUT Modify OrderNextReference Data

Last updated 1 year ago

DELETE https://api.swaycharts.io/dxsca-web/accounts/{account code}/orders/{order code}
DELETE https://api.swaycharts.io/dxsca-web/accounts/{account code}/orders/group

Cancel an existing order on an account

This API allows canceling order on an account. Users can always cancel orders on their own accounts, but can only cancel orders on behalf of other accounts if a special permission is set.

Only are accepted.

// Request

Empty request

Authorization header should be included in case of basic authentication
// Path Parameters

accountCode - unique code assigned to an account (URL-encoded, https://en.wikipedia.org/wiki/Percent-encoding). See account code
order code - either a client order id (assigned by the client during order placement) or an internal code assigned by the system ("action key" of the order chain). The code should be URL-encoded.
// Query Parameters

The following query arguments are supported for the /orders/group resource:

order-codes - comma-separated list of order codes. Note that the order in this list is important for groups with parent, first order in list is parent, next orders are children.
contingency-type - contingency type of order group to cancel.
// Response

Order Response for the cancelled order or a list of Order Responses for all orders in a group (if a group was submitted)

The ETag header is not sent in response.
// Errors

Common errors

API is not permitted for the user or account with the given id doesn't exist or account with the given id is not accessible for the user or an order with such an id is not found

Status code: 404 Not Found
Error code: 2
Description: Entity not found at server
An attempt is made to cancel order which cannot be cancelled (e.g. is already in a final state)

Status code: 409 Conflict
Error code: <various>
Description: <various>
User didn't submit the conditional request header (If-Match)

Status code: 403 Forbidden
Error code: 99
Description: Conditional request required
Conditional request header (If-Match) doesn't match the current order state

Status code: 412 Precondition Failed
Error code: N/A
Description: N/A
conditional requests