Documentation Index
Fetch the complete documentation index at: https://mintlify.com/markzuckerbergas/gbmplus-api-python/llms.txt
Use this file to discover all available pages before exploring further.
gbm.orders provides methods to create and submit buy/sell orders for Mexican market instruments traded on the IPC (Bolsa Mexicana de Valores) and SIC (Sistema Internacional de Cotizaciones) markets. Access it as gbm.orders on any GBMPlusAPI instance.
generateOrderObject(...)
submitOrder(). This method does not submit the order — it only constructs the payload including a computed hash. For limited (limit) orders, price is mandatory; omitting it raises an OrderFormatError.
The legacy contract identifier from the account object returned by
getAccounts(). Used to compute the order hash.The ticker or issuer string for the instrument, e.g.
'FUNO 11' or 'AMXL'. Spaces are stripped when generating the hash.Number of shares or units to buy or sell.
Direction of the order. Use
gbmplus.OrderTypes.Buy to purchase or gbmplus.OrderTypes.Sell to sell.Execution type. Use
gbmplus.TradingTypes.Market for a market order or gbmplus.TradingTypes.Limited for a limit order. When using TradingTypes.Limited, the price argument is required.Market segment for the instrument. Use
gbmplus.InstrumentTypes.IPC for BMV-listed equities or gbmplus.InstrumentTypes.SIC for internationally listed instruments traded through SIC.Limit price per share. Required when
trading_type is TradingTypes.Limited; raises OrderFormatError if omitted. Ignored for market orders.| Key | Description |
|---|---|
algoTradingTypeId | Numeric value of trading_type |
capitalOrderTypeId | Numeric value of order_type |
instrumentType | Numeric value of instrument_type |
issueId | The issuer string passed in |
quantity | Number of units |
hash | A timestamp-based unique hash for the order |
price | (Only present for limit orders) The specified limit price |
submitOrder(legacy_contract_id, duration, order)
POST https://homebroker-api.gbm.com/GBMP/api/Operation/RegisterCapitalOrder. The payload sent to the API includes the contract ID, duration, trading type, and the full order object as a single-element array.
The legacy contract identifier for the account placing the order. Must match the
legacy_contract_id used when generating the order object.The number of days the order should remain active. Use
1 for a day order (expires at end of trading session).The order dict returned by
generateOrderObject(). Do not construct this manually — always use generateOrderObject() to ensure the hash is correctly computed.RegisterCapitalOrder, typically including order confirmation details.
Example:
getOrders(legacy_contract_id)
POST https://homebroker-api.gbm.com/GBMP/api/Operation/GetBlotterOrders. The request is scoped to the current UTC date and includes both IPC (instrumentType=2) and SIC (instrumentType=0) instruments.
The legacy contract identifier for the account whose orders you want to retrieve.
For enum values used with
generateOrderObject(), see the Enums reference. For a complete worked example of placing an order, see Submit an Order.