Agara

Place an order

POST
/trade/v1/orders

Authorization

Authorization
Required
Bearer <token>

Personal access token issued from the web app's Settings → API tokens page. Send as Authorization: Bearer agt_….

In: header

Scope: orders:place

Request Body

application/jsonRequired

collateral_amount_microstring

Collateral amount to spend, in micro units. The size for a MARKET BUY. Exactly one of collateral_amount_micro and shares_micro may be set.

expiration_unix_secondsinteger | null

Expiration in Unix seconds. Required for GTD and must be at least 30 seconds in the future; omit it for every other time-in-force.

Format: "int64"

post_onlyboolean | null

Post-only flag. LIMIT only; the order is rejected instead of crossing the spread. Defaults to false.

price_microstring

Limit price in micro units. Required for LIMIT; rejected for MARKET.

shares_microstring

Shares amount in micro units. The size for a LIMIT order or a MARKET SELL. Exactly one of collateral_amount_micro and shares_micro may be set.

side
Required
string

Order side.

Value in: "BUY" | "SELL"

time_in_force
Required
string

Time in force.

Value in: "FAK" | "FOK" | "GTC" | "GTD"

token_id
Required
string

Outcome token id.

type
Required
string

Order type.

Value in: "LIMIT" | "MARKET"
curl -X POST "https://app.agara.xyz/trade/v1/orders" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "price_micro": "600000",
    "shares_micro": "1000000",
    "side": "BUY",
    "time_in_force": "GTC",
    "token_id": "21742633143463906290569050155826241533067272736897614950488156847949938836455",
    "type": "LIMIT"
  }'

Order accepted; engine match lands asynchronously.

{
  "as_of": "2019-08-24T14:15:22Z",
  "order_id": "93101167-9065-4b9c-b98b-5d789a3ed9fe",
  "pending_operation": "SUBMIT",
  "source": "AGARA",
  "status": "PENDING"
}