pocketful logo light
pocketful logo light

Fetch Completed Orders

The Completed Orders API retrieves information about orders that have been successfully executed and completed from the order book. By accessing this API, users can obtain detailed data on their past transactions, including the order ID, type of order, price, quantity, timestamp, and any associated fees. This API provides valuable insights into trading activity, allowing users to analyze their performance, track order history, and reconcile transactions efficiently.

Endpoint: /api/v1/orders
Method-Type: GET

Headers

Header NameValueDescription
x-authorization-token<your_access_token>Valid JWT token for authentication
x-device-typeWEBThe device type (e.g., WEB, ANDROID, IOS)

Query Params

{
    "type": "completed",
    "client_id": "<client id>"
}

Example cURL Request

curl --location 'https://algo.pocketful.in/api/v1/orders?type=completed&client_id=<client_id>' \
--header 'x-authorization-token: <your_access_token>' \
--header 'x-device-type: WEB'

Response

{
    "data": {
        "orders": [
            {
                "mode": "NEW",
                "exchange": "BSE",
                "segment": "",
                "login_id": "<client id>",
                "deposit": 0,
                "order_status": "AMO_CANCEL_CONFIRMED",
                "product": "CNC",
                "order_type": "LIMIT",
                "rejection_reason": "",
                "order_side": "BUY",
                "instrument_token": 532461,
                "exchange_time": 0,
                "nnf_id": 333333333333100,
                "quantity": 1,
                "trading_symbol": "PNB-A",
                "client_id": "<client id>",
                "average_trade_price": 0,
                "underlying_token": null,
                "oms_order_id": "2024030935",
                "lot_size": 1,
                "isin": "INE160A01022",
                "disclosed_quantity": 0,
                "execution_type": "AMO",
                "source": "pacetrader.pacefin.in",
                "device": "android",
                "exchange_order_id": "",
                "validity": "DAY",
                "leg_order_indicator": null,
                "trade_price": 0,
                "spread_token": null,
                "market_protection_percentage": 0,
                "filled_quantity": 0,
                "order_tag": "",
                "sl_trigger_price": 0.0,
                "square_off": false,
                "order_status_info": "",
                "square_off_value": 0.0,
                "tags": null,
                "order_entry_time": 1709992420,
                "last_activity_reference": 0,
                "trigger_price": 0,
                "sl_order_price": 0.0,
                "stop_loss_value": 0.0,
                "rejection_code": 0,
                "average_price": 0,
                "trailing_stop_loss": 0.0,
                "price": 125.0,
                "user_order_id": "12776",
                "symbol": "PNB",
                "is_trailing": false,
                "pro_cli": "CLIENT",
                "remaining_quantity": 0,
                "contract_description": {},
                "series": "A",
                "target_price_type": "absolute",
                "sl_order_quantity": 0
            },

        ]
    },
    "message": "",
    "status": "success"
}
KeyDescription
ordersAn array containing individual order objects.
modeIndicates the status of the order, e.g., “NEW.”
exchangeThe stock exchange where the order is placed, e.g., “BSE” or “NSE.”
segmentThe trading segment.
login_idUnique identifier for the client.
depositThe deposit amount associated with the order.
order_statusThe current status of the order, e.g., “REJECTED” or “COMPLETE.”
productThe product type, such as “MIS,” “CNC,” etc.
order_typeThe type of order, e.g., “LIMIT,” “SLM,” etc.
rejection_reasonThe reason for order rejection, if applicable.
order_sideThe side of the order, e.g., “BUY” or “SELL.”
instrument_tokenToken representing the financial instrument.
exchange_timeThe timestamp from the exchange.
nnf_idUnique identifier for the order in the NNF system.
quantityThe quantity of the order.
trading_symbolThe trading symbol associated with the order.
client_idUnique identifier for the client.
average_trade_priceThe average trade price, if applicable.
underlying_tokenToken representing the underlying asset.
oms_order_idOrder ID in the Order Management System.
lot_sizeThe lot size associated with the order.
isinISIN (International Securities Identification Number) of the instrument.
disclosed_quantityThe disclosed quantity, if applicable.
execution_typeThe type of execution, e.g., “BO,” “AMO,” etc.
sourceThe source of the order, e.g., “pacetrader.pacefin.in.”
deviceThe device through which the order is placed, e.g., “android” or “WEB.”
exchange_order_idOrder ID assigned by the exchange.
validityThe validity period of the order, e.g., “DAY.”
leg_order_indicatorIndicator for leg orders.
trade_priceThe trade price associated with the order.
spread_tokenToken representing spread orders.
market_protection_percentageMarket protection percentage, if applicable.
filled_quantityThe quantity of the order that has been filled.
order_tagAdditional tag or label for the order.
sl_trigger_priceTrigger price for stop-loss orders.
square_offIndicates if the order is a square-off order.
order_status_infoAdditional information about the order status.
square_off_valueValue associated with square-off orders.
tagsAdditional tags associated with the order.
order_entry_timeThe timestamp when the order was entered.
last_activity_referenceReference to the last activity related to the order.
trigger_priceTrigger price for the order.
sl_order_pricePrice for stop-loss orders.
stop_loss_valueValue associated with stop-loss orders.
rejection_codeCode indicating the reason for order rejection.
average_priceThe average price associated with the order.
trailing_stop_lossValue for trailing stop-loss orders.
priceThe price specified in the order.
user_order_idUser-specific order identifier.
symbolThe symbol or ticker of the financial instrument.
is_trailingIndicates if the order has trailing stop-loss.
pro_cliProfessional client designation.
remaining_quantityThe remaining quantity of the order to be filled.
contract_descriptionDescription of the contract, if applicable.
seriesThe series of the instrument, if applicable.
target_price_typeType of target price, e.g., “absolute.”
sl_order_quantityQuantity specified for stop-loss orders.

Error Response

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