Orders

Websocket

https://api.sandbox.x.architect.co/orders

Order JSON Schema

Field
Type
Description

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

You can convert epoch timestamps to human-readable dates using EpochConverter.

{
    "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

Field
Type
Description

rid

int

Request ID

t

string

Request Type

Fields Common to all Responses

Field
Type
Description

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.

Field
Type
Description

u

string

Username

k

string

Token from auth_gateway

Request
{
    "rid": 101,
    "t": "a",
    "u": "ABC",
    "k": "token-from-auth-gateway"
}
Field
Type
Description

li

string

Logged in username

o

List(Orders)

All open orders for this username

Response
{
    "rid": 101,
    "res": {
        "li": "ABC",
        "o": [ <ORDER>, <ORDER>, ... ]
    }
}

Logout

Terminate the current session.

Request
{
    "rid": 104,
    "t": "z"
}
Response
{
    "rid": 104,
    "res": {
        "lo": "ABC"
    }
}

Place Order

Place a new order.

Field
Type
Description

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

Request
{
    "rid": 102,
    "t": "p",
    "s": "EURUSD-PERP",
    "d": "B",
    "q": 3,
    "p": "1.10",
    "tif": "GTC",
    "po": true
}
Field
Type
Description

oid

string

Order ID

Response
{
    "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.

Field
Type
Description

oid

string

Order ID to cancel

Request
{
    "rid": 103,
    "t": "x",
    "oid": "1M09KBDE1147X"
}
Field
Type
Description

cxl_rx

bool

The cancel has been received to be processed

Response
{
    "rid": 103,
    "res": {
        "cxl_rx": true
    }
}

Get Open Orders

Gets all open orders.

Request
{
    "rid": 104,
    "t": "o"
}
Field
Type
Description

o

List(Orders)

The open orders for this user

Response
{
    "rid": 104,
    "o": [ <ORDER>, <ORDER>, ... ]
}

Order Gateway Feeds

Common Fields

All feed messages include these common fields.

Field
Type
Description

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

You can convert epoch timestamps to human-readable dates using EpochConverter.

Heartbeat

{
    "t": "h",
    "ts": 1746431612,
    "tn": 86465000
}

Cancel Reject Feed

A Cancel Order Request has been rejected by the exchange.

Field
Type
Description

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.

Field
Type
Description

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.

Field
Type
Description

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.

Field
Type
Description

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.

Field
Type
Description

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.

Field
Type
Description

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.

Field
Type
Description

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.

Field
Type
Description

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.

Field
Type
Description

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

Insert Order

post
Authorizations
Body
usernamestring · min: 1 · max: 50Required

ADX Username

Pattern: ^[-A-Za-z0-9_@.+]+$
symbolstring · min: 1 · max: 20Required

Symbol to buy or sell

Pattern: ^[-A-Z0-9]+$
pricestring · min: 1 · max: 10Required

Price of shares to buy or sell

Pattern: ^\d+\.?\d*$
quantityintegerRequired

Quantity of shares to buy or sell

sidestring · enumRequired

Buy or Sell

Possible values:
time_in_forcestring · enumRequiredPossible values:
post_onlybooleanRequired

Post Only

Responses
200

Successful Response

application/json
post
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"
}

Cancel Order

post
Authorizations
Body
usernamestring · min: 1 · max: 50Required

ADX Username

Pattern: ^[-A-Za-z0-9_@.+]+$
order_idstringRequired

Order ID to cancel

Responses
200

Successful Response

application/json
Responseobject · CancelOrderResponse
post
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"
}
{}

Get Open Orders

post
Authorizations
Body
usernamestring · min: 1 · max: 50Required

ADX Username

Pattern: ^[-A-Za-z0-9_@.+]+$
Responses
200

Successful Response

application/json
post
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
    }
  ]
}

Cancel All

post
Authorizations
Body
usernamestring · min: 1 · max: 50Required

ADX Username

Pattern: ^[-A-Za-z0-9_@.+]+$
Responses
200

Successful Response

application/json
post
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