pocketful logo light
pocketful logo light

Cancel Regular Order

The Cancel Order API provides user with the capability to cancel open or pending order. To cancel a pending order within the order book, user simply needs to provide the oms_order_id of the targeted order. Upon successful completion of the cancellation request, a success response status code will be returned, indicating the order’s successful cancellation. This API streamlines the process of order management, empowering users to swiftly retract orders as needed, thereby enhancing flexibility and responsiveness in trading activities.

Endpoint: /api/v1/orders/<oms_order_id>
Method-Type: DELETE

Headers

Header NameValueDescription
x-authorization-token<your_access_token>Valid JWT token for authentication
x-device-typeWEBThe device type (e.g., WEB, ANDROID, IOS)
Content-Typeapplication/jsonFormat of the request body

Request Packet

{
    "oms_order_id":"202403111778",
    "client_id": "clientId",
    "execution_type": "REGULAR"
}

Body Params

FieldNameDatatypeDescription
oms_order_idStringRepresents the unique id of order given by oms.
client_idStringThe unique ID of the user placing the order.
execution_typeStringThe execution type of the order, which is REGULAR for regular orders.

Example cURL Request

curl --location --request DELETE 'https://algo.pocketful.in/api/v1/orders/202403111778' \
--header 'Content-Type: application/json' \
--header 'x-authorization-token: <your_access_token>' \
--header 'x-device-type: WEB' \
--data '{
    "oms_order_id": "202403111778",
    "client_id": "clientId",
    "execution_type": "REGULAR"
}'

Response

{
    "data": {
        "oms_order_id": "202403111506"
    },
    "message": "Order cancellation request submitted for OMS Order: 202403111506",
    "status": "success"
}
KeyDescription
oms_order_idUnique identifier for the OMS order.
messageInformation message about the order cancellation request.
statusStatus of the order cancellation request (e.g., success).

Error Response

{
    "status": "error",
    "message": "Request Unauthorised",
    "error_code": 40000,
    "data":{
    }
}