Orders
Websocket
https://api.sandbox.x.architect.co/orders
Order JSON Schema
o
string
Order ID
u
string
Username
s
string
Symbol
p
string
Price
q
int
Quantity
xq
int
Filled Quantity
rq
int
Remaining Quantity
o
string
Order State
d
string
Side B
or S
tif
string
Time in force GTC
or IOC
liq
bool
Liquidation indicator
ts
int
Timestamp in seconds since epoch (Unix time)
tn
int
Nanosecond component of timestamp
{
"oid": "1N5MKATSYFC4E",
"u": "taker-01",
"s": "EURUSD-PERP",
"p": "1.23",
"q": 98,
"xq": 0,
"rq": 98,
"o": "NEW",
"d": "B",
"tif": "GTC",
"ts": 1746280679,
"tn": 818959000
}
Error Responses
{
"rid": 105,
"err": {
"code": 400,
"msg": "Symbol XRPUSD-PERP not found"
}
}
Fields Common to all Requests
rid
int
Request ID
t
string
Request Type
Fields Common to all Responses
rid
int
Request ID
res
dict
Results
Authentication
Once connected to the websocket, the client must first login. The login message contains a username
and token
pair which must be present in the auth_gateway
.
Login
Authenticate with the websocket server. For authentication and authorization purposes, one must get a valid user token from the auth_gateway. Also, retrieve all open orders for the user.
u
string
Username
k
string
Token from auth_gateway
{
"rid": 101,
"t": "a",
"u": "ABC",
"k": "token-from-auth-gateway"
}
li
string
Logged in username
o
List(Orders)
All open orders for this username
{
"rid": 101,
"res": {
"li": "ABC",
"o": [ <ORDER>, <ORDER>, ... ]
}
}
Logout
Terminate the current session.
{
"rid": 104,
"t": "z"
}
{
"rid": 104,
"res": {
"lo": "ABC"
}
}
Place Order
Place a new order.
s
string
Symbol
d
string
Side B
or S
q
int
Quantity
p
string
Price
tif
string
Time in force GTC
or IOC
po
bool
Post only
{
"rid": 102,
"t": "p",
"s": "EURUSD-PERP",
"d": "B",
"q": 3,
"p": "1.10",
"tif": "GTC",
"po": true
}
oid
string
Order ID
{
"rid": 102,
"res": {
"oid": "1M09KBDE1147X"
}
}
Cancel Order
Cancel an order. Note: Unless cancelation fails early validation checks, all cancels will be acknowledged as received. The result and success of the cancel will be reported subsequently via the Cancel Order Feed.
oid
string
Order ID to cancel
{
"rid": 103,
"t": "x",
"oid": "1M09KBDE1147X"
}
cxl_rx
bool
The cancel has been received to be processed
{
"rid": 103,
"res": {
"cxl_rx": true
}
}
Get Open Orders
Gets all open orders.
{
"rid": 104,
"t": "o"
}
o
List(Orders)
The open orders for this user
{
"rid": 104,
"o": [ <ORDER>, <ORDER>, ... ]
}
Order Gateway Feeds
Common Fields
All feed messages include these common fields.
t
string
Message type (h
=heartbeat, s
=stats, 1
=level 1, 2
=level 2, 3
=level 3)
ts
integer
Timestamp in seconds since epoch (Unix time)
tn
integer
Nanosecond component of timestamp
Heartbeat
{
"t": "h",
"ts": 1746431612,
"tn": 86465000
}
Cancel Reject Feed
A Cancel Order Request has been rejected by the exchange.
oid
int
Order ID that was given in the Order Cancel Request
r
string
Reject Reason
txt
string
Reject reason additional text
{
"t": "e",
"ts": 1746648079,
"tn": 931070000,
"oid": "BAD_ORDER_ID",
"r": "UNKNOWN_ORDER",
"txt": "Unknown order"
}
New Order Feed
A New Order is active on the exchange.
eid
int
Execution ID
o
Order
The order details of the new order
{
"t": "n",
"ts": 1746646090,
"tn": 594778000,
"eid": "1N5MK845SRRC0",
"o": <ORDER>
}
Cancel Order Feed
An order has been canceled on the exchange. This could be the result of an Order Cancel Request or by the exchange, for example, if an ADX administrator cancels the order directly.
eid
int
Execution ID
o
Order
The order details of the canceled order
xr
string
The cancelation reason
txt
string
Cancelation reason additional details
{
"t": "c",
"ts": 1746645996,
"tn": 645823000,
"eid": "1N5MK845SRRBZ",
"o": <ORDER>,
"xr": "EXCHANGE_OPTION",
"txt": "Administrator-initiated cancellation"
}
Replaced Order Feed
An order has been replaced/amended.
eid
int
Execution ID
o
Order
The order details of the replaced order
{
"t": "r",
"ts": 1746646139,
"tn": 21676000,
"eid": "1N5MK845SRRC1",
"o": <ORDER>
}
Rejected Order Feed
A New Order Request has been Rejected by the exchange.
eid
int
Execution ID
o
Order
The order details of the rejected order
r
string
The rejection reason
txt
string
Rejection reason additional details
{
"t": "j",
"ts": 1746646441,
"tn": 583066000,
"eid": "1N5MK845SRRCA",
"o": <ORDER>,
"r": "EXCHANGE_CLOSED",
"txt": "Book is CLOSED"
}
Expired Order Feed
An order has expired, such as an Immediate or Cancel IOC
order.
eid
int
Execution ID
o
Order
The order details of the expired order
{
"t": "x",
"ts": 1746646355,
"tn": 8745000,
"eid": "1N5MK845SRRC8",
"o": <ORDER>
}
Done for Day Feed
A Good for Day order has expired at the end of the trading day.
eid
int
Execution ID
o
Order
The order details of the expired order
{
"t": "d",
"ts": 1746646394,
"tn": 774916000,
"eid": "1N5MK845SRRC9",
"o": <ORDER>
}
Partial Fill Feed
An order has partially filled and is still on the exchange.
eid
int
Execution ID
o
Order
The order details of the partially filled order
xs
Dict
Details about the partial fill
tid
int
The Trade ID
s
string
The symbol
q
int
The quantity traded
p
string
The traded price
d
string
The side of the trade B
or S
agg
bool
Whether or not the trade took liquidity
{
"t": "p",
"ts": 1746646169,
"tn": 723563000,
"eid": "1N5MK845SRRC5",
"o": <ORDER>,
"xs": {
"tid": "1N5MK845SRRC3",
"s": "GBPUSD-PERP",
"q": 3,
"p": "2.69",
"d": "B",
"agg": false
}
}
Fill Feed
An order has fully filled and is no longer on the exchange.
eid
int
Execution ID
o
Order
The order details of the filled order
xs
Dict
Details about the fill
tid
int
The Trade ID
s
string
The symbol
q
int
The quantity traded
p
string
The traded price
d
string
The side of the trade B
or S
agg
bool
Whether or not the trade took liquidity
{
"t": "f",
"ts": 1746646169,
"tn": 723563000,
"eid": "1N5MK845SRRC4",
"o": <ORDER>,
"xs": {
"tid": "1N5MK845SRRC3",
"s": "GBPUSD-PERP",
"q": 3,
"p": "2.69",
"d": "S",
"agg": true
}
}
REST
https://api.sandbox.x.architect.co
ADX Username
^[-A-Za-z0-9_@.+]+$
Symbol to buy or sell
^[-A-Z0-9]+$
Price of shares to buy or sell
^\d+\.?\d*$
Quantity of shares to buy or sell
Buy or Sell
Post Only
Successful Response
Validation Error
POST /orders/insert_order HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 113
{
"username": "text",
"symbol": "text",
"price": "text",
"quantity": 1,
"side": "B",
"time_in_force": "GTC",
"post_only": true
}
{
"order_id": "text"
}
ADX Username
^[-A-Za-z0-9_@.+]+$
Order ID to cancel
Successful Response
Validation Error
POST /orders/cancel_order HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 37
{
"username": "text",
"order_id": "text"
}
{}
ADX Username
^[-A-Za-z0-9_@.+]+$
Successful Response
Validation Error
POST /orders/get_open_orders HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 19
{
"username": "text"
}
{
"orders": [
{
"order_id": "text",
"username": "text",
"symbol": "text",
"price": "text",
"quantity": 1,
"traded_quantity": 1,
"average_traded_price": "text",
"remaining_quantity": 1,
"state": "NEW",
"side": "B",
"time_in_force": "UNDEFINED",
"is_liquidation": true,
"insert_time": "2025-09-27T20:56:54.955Z",
"insert_epoch_seconds": 1,
"insert_epoch_nanos": 1
}
]
}
ADX Username
^[-A-Za-z0-9_@.+]+$
Successful Response
Validation Error
POST /orders/cancel_all HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 19
{
"username": "text"
}
{
"successful_cancellations": [
"text"
],
"failed_cancellations": [
"text"
]
}
Last updated