pocketful logo light
pocketful logo light

Trade Book

Trade book API fetches record or log of all the trades executed by an account holder. It contains details such as the date and time of the trade, the security traded (e.g., stocks, options, futures), the quantity bought or sold, the price at which the trade was executed.

Endpoint: /api/v1/trades
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

{
    "client_id": "<client id>"
}

Example cURL Request

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

Response

{
  "data": {
    "orders": [
      {
        "mode": "NEW",
        "exchange": "NSE",
        "segment": "",
        "login_id": "<client id>",
        "deposit": 0,
        "order_status": "CONFIRMED",
        "product": "MIS",
        "order_type": "LIMIT",
        "rejection_reason": "NONE",
        "order_side": "BUY",
        "instrument_token": 14366,
        "exchange_time": 1710485885,
        "nnf_id": 111111111111100,
        "quantity": 1,
        "trading_symbol": "IDEA-EQ",
        "client_id": "<client id>",
        "average_trade_price": 0,
        "underlying_token": null,
        "oms_order_id": "202403152052",
        "lot_size": 1,
        "isin": "INE669E01016",
        "disclosed_quantity": 0,
        "execution_type": "REGULAR",
        "source": "",
        "device": "",
        "exchange_order_id": "1100000029886168",
        "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,
        "square_off": false,
        "order_status_info": "",
        "square_off_value": 0,
        "tags": null,
        "order_entry_time": 1710485885,
        "last_activity_reference": 1394972885476889600,
        "trigger_price": 0,
        "sl_order_price": 0,
        "stop_loss_value": 0,
        "rejection_code": 0,
        "average_price": 0,
        "trailing_stop_loss": 0,
        "price": 11.9,
        "user_order_id": "10002",
        "symbol": "IDEA",
        "is_trailing": false,
        "pro_cli": "CLIENT",
        "remaining_quantity": 1,
        "contract_description": {},
        "series": "EQ",
        "target_price_type": "absolute",
        "sl_order_quantity": 0
      },
    ]
  },
  "message": "",
  "status": "success"
}
KeyDescription
modeMode of the transaction, e.g., NEW for new orders
exchangeStock exchange identifier, e.g., NSE
segmentMarket segment, could be blank if not applicable
login_idUser login identifier
depositAmount of deposit, if applicable
order_statusCurrent status of the order, e.g., CONFIRMED
productType of product, e.g., MIS (Margin Intraday Square off)
order_typeType of order, e.g., LIMIT
rejection_reasonReason for order rejection, if any
order_sideSide of the order, e.g., BUY
instrument_tokenUnique identifier for the instrument
exchange_timeTimestamp for when the order was recorded on the exchange
nnf_idUnique identifier for the participant
quantityNumber of units in the order
trading_symbolTrading symbol of the security, e.g., IDEA-EQ
client_idClient identifier matching login_id
average_trade_priceAverage price at which trades were executed
underlying_tokenToken for the underlying asset, if applicable
oms_order_idOrder management system identifier
lot_sizeNumber of units in each lot
isinInternational Securities Identification Number
disclosed_quantityQuantity of the order disclosed to the market
execution_typeType of execution, e.g., REGULAR
sourceSource of the order, e.g., manual, automated
deviceDevice used to place the order, if specified
exchange_order_idOrder identifier given by the exchange
validityValidity of the order, e.g., DAY
leg_order_indicatorIndicator for leg of a complex order, if applicable
trade_pricePrice at which the trade was executed, if applicable
spread_tokenToken related to spread orders, if applicable
market_protection_percentagePercentage of market protection, if applicable
filled_quantityQuantity of the order that has been filled
order_tagTag associated with the order, for user categorization
sl_trigger_priceTrigger price for a stop-loss order
square_offIndicates if the position is to be squared off
order_status_infoAdditional info about the order status
square_off_valueValue at which to square off, if applicable
tagsTags associated with the order
order_entry_timeTimestamp when the order was entered
last_activity_referenceReference ID for the last activity on this order
trigger_pricePrice at which an order trigger is set
sl_order_pricePrice set for a stop-loss order
stop_loss_valueValue set for the stop-loss
rejection_codeCode representing the reason for rejection, if any
average_priceAverage price of the order
trailing_stop_lossIndicates if a trailing stop loss is set
pricePrice set for the order
user_order_idUser-defined identifier for the order
symbolSymbol of the traded security
is_trailingIndicates whether trailing is enabled
pro_cliProfile type, e.g., CLIENT
remaining_quantityQuantity remaining to be filled
contract_descriptionDescription of the contract, if applicable
seriesSeries of the traded security, e.g., EQ
target_price_typeType of target price, e.g., absolute
sl_order_quantityQuantity for a stop-loss order

Error Response

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