This subscription feed publishes information about user open orders.
Authentication is required.
Feed |
Event Type |
API Keys | Original & Signed Challenge |
open_orders |
subscribe / unsubscribe
|
Any | Yes |
Sample Sent Message |
{ "event":"subscribe", "feed":"open_orders", "api_key":"CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+", "original_challenge":"226aee50-88fc-4618-a42a-34f7709570b2", "signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+ Z9DQILm7qxncswMmJyvP/2vgzqqh+g==" } |
Sample Return if Successful |
{ |
Field |
Type | Description |
event
|
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed | string | The requested subscription feed |
api_key | string | The user api key |
original_challenge | string | The message that is received from a challenge request |
signed_challenge | string | The signed challenge message with user api secret |
Sample Subscription Snapshot Data |
{ 'feed':'open_orders_snapshot', 'account':'0f9c23b8-63e2-40e4-9592-6d5aa57c12ba', 'orders':[ { 'instrument':'PI_XBTUSD', 'time':1567701230734, 'last_update_time':1567701230734, 'qty':10000.0, 'filled':0.0, 'limit_price':9400.0, 'stop_price':0.0, 'type':'limit', 'order_id':'179f9af8-e45e-469d-b3e9-2fd4675cb7d0', 'direction':0, 'reduce_only':False }, { 'instrument':'PI_XBTUSD', 'time':1567597548884, 'last_update_time':1567701700996, 'qty':1000.0, 'filled':0.0, 'limit_price':9400.0, 'stop_price':0.0, 'type':'limit', 'order_id':'9c2cbcc8-14f6-42fe-a020-6e395babafd1', 'direction':0, 'reduce_only':False }, { 'instrument':'PI_XBTUSD', 'time':1567701695173, 'last_update_time':1567702067519, 'qty':1501.0, 'filled':0.0, 'limit_price':7200.0, 'stop_price':0.0, 'type':'limit', 'order_id':'022774bc-2c4a-4f26-9317-436c8d85746d', 'direction':0, 'reduce_only':False }, { 'instrument':'PI_XBTUSD', 'time':1567428874347, 'last_update_time':1567428874347, 'qty':1501.0, 'filled':0.0, 'limit_price':7200.0, 'stop_price':0.0, 'type':'limit', 'order_id':'fcbb1459-6ed2-4b3c-a58c-67c4df7412cf', 'direction':0, 'reduce_only':False }, { 'instrument':'PI_XBTUSD', 'time':1567515137945, 'last_update_time':1567515137945, 'qty':102.0, 'filled':0.0, 'limit_price':8500.0, 'stop_price':0.0, 'type':'limit', 'order_id':'3deea5c8-0274-4d33-988c-9e5a3895ccf8', 'direction':0, 'reduce_only':False }, { 'instrument':'PI_XBTUSD', 'time':1567701523651, 'last_update_time':1567701523651, 'qty':10000.0, 'filled':0.0, 'limit_price':10640.0, 'stop_price':0.0, 'type':'limit', 'order_id':'d08021f7-58cb-4f2c-9c86-da4c60de46bb', 'direction':1, 'reduce_only':True } ] } |
Field |
Type | Description |
feed | string | The subscribed feed |
account | string | The user account |
orders |
list of structures | A list containing the user open orders |
instrument | string | The instrument (referred also as symbol or product_id) of the order |
time | positive integer | The UTC time in milliseconds |
last_update_time | positive integer | The UTC time in milliseconds that the order was last updated |
qty | positive float | The remaining quantity of the order |
filled | positive float | The amount of the order that has been filled |
limit_price | positive float | The limit price of the order |
stop_price | positive float | The stop price of the order |
type | string | The order type, limit or stop |
order_id | UUID | The order id |
cli_ord_id | UUID | The unique client order identifier. This field is returned only if the order has a client order id |
direction | integer | The direction of the order, either 0 for a buy order or 1 for a sell order |
Sample Subscription Delta Data |
{ 'feed':'open_orders', 'order':{ 'instrument':'PI_XBTUSD', 'time':1567702877410, 'last_update_time':1567702877410, 'qty':304.0, 'filled':0.0, 'limit_price':10640.0, 'stop_price':0.0, 'type':'limit', 'order_id':'59302619-41d2-4f0b-941f-7e7914760ad3', 'direction':1, 'reduce_only':True }, 'is_cancel':False, 'reason':'new_placed_order_by_user' } |
Field |
Type | Description |
feed | string | The subscribed feed |
order |
structure | The user new order |
instrument | string | The instrument (referred also as symbol or product_id) of the order |
time | positive integer | The UTC time in milliseconds |
last_update_time | positive integer | The UTC time in milliseconds that the order was last updated |
qty | positive float | The quantity or the order |
filled | positive float | The amount of the order that is filled |
limit_price | positive float | The limit price of the order |
stop_price | positive float | The stop price of the order |
type | string | The order type, limit or stop |
order_id | UUID | The order id |
cli_ord_id | UUID | The unique client order identifier. This field is returned only if the order has a client order id |
direction | integer | The direction of the order, either 0 for a buy order or 1 for a sell order |
is_cancel | boolean |
If false the open order has been either placed or partially filled and needs to be updated. If true the open order was either fully filled or cancelled and must be removed from open orders snapshot |
reason | string |
Reason behind the received delta.
|
Sample Return if Unsuccessful |
{ "event":"error", "message":"Invalid product id" } |
Field |
Type | Description |
event | string | Always error |
message | string |
An error message out of:
|