Skip to content

Create Order

Endpoint Information

Endpoint: POST /api/v1/orders

Description: Create a new order. Order creator must ensure sufficient balance and authorization

Authentication: Authorization header with JWT token

Request Parameters

FieldTypeRequiredDescription
orderobjectYesOrder information
order.makerstringYesOrder creator address (must match the user address in JWT token)
order.principalstringYesRecipient address
order.is_buyboolYesWhether it's a buy order
order.tickerstringYesStock symbol
order.exchangeintYesExchange code. See Exchange enum type description
order.assetstringYesAsset token address
order.pricestringYesPrice (in wei, 18 decimals precision). Since the platform only accepts stablecoins, the order price needs to consider exchange rate conversion. It's recommended to use the Estimate Order Fee API to get the exchange rate converted price
order.quantitystringYesQuantity
order.incentivestringYesIncentive amount (fee provided by Maker). This is the fee Maker offers for order execution. Only when order.incentive >= estimated fee will brokers lock and execute the order. Use Estimate Order Fee API to get the estimated fee
order.deadlinelongYesOrder signature validity deadline timestamp (Unix timestamp in seconds). Must be at least current time + 720 hours (30 days). For limit orders, it's recommended to set a longer validity period to ensure sufficient time for execution
order.noncelongYesAnti-replay nonce
signaturestringYesOrder signature

Response Parameters

FieldTypeDescription
iduuidOrder unique identifier
makerstringOrder creator address
principalstringRecipient address
is_buyboolWhether it's a buy order
tickerstringStock symbol
exchangeintExchange code. See Exchange enum type description
assetstringAsset token address
pricestringPrice
quantitystringQuantity
incentivestringIncentive amount
deadlinelongDeadline timestamp
noncelongAnti-replay nonce
signaturestringOrder signature
order_hashstringOrder hash
statusenumOrder status. See OrderStatus enum type description
filled_quantitystringFilled quantity
created_atstringCreation time
updated_atstringUpdate time

Request Example

bash
curl -X POST "/api/v1/orders" \
     -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
     -H "Content-Type: application/json" \
     -d '{
       "order": {
         "maker": "0x1234567890123456789012345678901234567890",
         "principal": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd",
         "is_buy": true,
         "ticker": "AAPL",
         "exchange": 0,
         "asset": "0x0000000000000000000000000000000000000001",
         "price": "150250000000000000000",
         "quantity": "100",
         "incentive": "1000000000000000000",
         "deadline": 1735689600,
         "nonce": 1
       },
       "signature": "0x..."
     }'

Response Example

json
{
    "code": 0,
    "data": {
        "id": "550e8400-e29b-41d4-a716-446655440000",
        "maker": "0x1234567890123456789012345678901234567890",
        "principal": "0xabcdefabcdefabcdefabcdefabcdefabcdefabcd",
        "is_buy": true,
        "ticker": "AAPL",
        "exchange": 0,
        "asset": "0x0000000000000000000000000000000000000001",
        "price": "150250000000000000000",
        "quantity": "100",
        "incentive": "1000000000000000000",
        "deadline": 1735689600,
        "nonce": 1,
        "signature": "0x...",
        "order_hash": "0x1234567890abcdef...",
        "status": "pending",
        "filled_quantity": "0",
        "created_at": "2025-01-17T03:00:24Z",
        "updated_at": "2025-01-17T03:00:24Z"
    }
}