POST
/
api
/
v1
/
order
curl --request POST \
  --url https://mainnetapiserverwriter.logx.network/api/v1/order \
  --header 'Content-Type: application/json' \
  --data '{
  "marketId": 3,
  "isBuy": true,
  "orderType": "MARKET",
  "amount": "0.002094",
  "price": "0",
  "expiryTs": 1725711776768,
  "isReduce": false
}'
{
  "body": {
    "amountx18": "2094000000000000",
    "brokerId": 1,
    "createdAt": "2024-08-08T12:22:57.264915Z",
    "expiryTs": 1725711776768,
    "id": 2418249,
    "marketSymbol": "BTC-USD",
    "marketType": "PERPETUAL",
    "pricex18": "0",
    "side": "BUY",
    "status": "FILLED",
    "subaccountId": "1_0x4012AB6a68CD1B2Eb2d0B1DdcE846DBe5d0B4059_1",
    "totalFilledx18": "2094000000000000",
    "type": "MARKET",
    "updatedAt": "2024-08-08T12:22:57.440277977Z"
  },
  "message": "Order created successfully",
  "status": 200
}

Body

application/json
The order object containing the details of the order to be created.
marketId
integer

Unique identifier for the market. Obtainable via the Markets API.

Example:

3

isBuy
boolean

Indicates whether the order is a buy (true) or sell (false) order.

Example:

true

orderType
string

Specifies the type of order (MARKET or LIMIT).

Example:

"MARKET"

amount
string

Size of the position to be opened, denoted in the token's denomination. Precision details can be fetched via the Markets API.

Example:

"0.002094"

price
string

The price at which the order is to be executed. For MARKET orders, this value should be set to "0".

Example:

"0"

expiryTs
integer

The expiration timestamp of the order, in milliseconds since the epoch.

Example:

1725711776768

isReduce
boolean

Specifies whether the order is reducing an existing position (true) or opening a new one (false).

Example:

false

Response

200 - application/json
The order was created successfully.
body
object
message
string
Example:

"Order created successfully"

status
integer
Example:

200