Orders
Submit and manage orders against the central limit order book. Orders are keyed by `ticker` and a `side` (`yes` / `no`) with an `action` (`buy` / `sell`). Prices are dollars per contract (`0.01`–`0.99`) and `count` is the number of contracts. All endpoints require a Bearer token.
Create order
Requires auth/api/portfolio/ordersPlaces a single order. Returns the resulting order with any immediate fills. Use `time_in_force` to control resting behaviour and `client_order_id` for idempotent client-side tracking.
Body parameters
tickerstringbodyrequiredMarket ticker to trade.
sidestringbodyrequiredContract side.
yesnoactionstringbodyoptionaldefault: buyOpen or close exposure.
buysellcountnumberbodyrequiredNumber of contracts.
pricenumberbodyrequiredLimit price in dollars (0.01–0.99).
time_in_forcestringbodyoptionaldefault: GTCOrder lifetime.
GTCFOKIOCclient_order_idstringbodyoptionalClient-supplied idempotency key.
post_onlybooleanbodyoptionaldefault: falseReject if the order would immediately match (maker-only).
reduce_onlybooleanbodyoptionaldefault: falseOnly reduce an existing position; never increase it.
Request
curl -X POST "https://api.majjha.com/api/portfolio/orders" \
-H "Authorization: Bearer $PMX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"ticker": "BTC-5MIN-25JUN04T0900-Y",
"side": "yes",
"action": "buy",
"count": 100,
"price": 0.54,
"time_in_force": "GTC",
"client_order_id": "my-order-001"
}'{
"ticker": "BTC-5MIN-25JUN04T0900-Y",
"side": "yes",
"action": "buy",
"count": 100,
"price": 0.54,
"time_in_force": "GTC",
"client_order_id": "my-order-001"
}Response
{
"order_id": "ord_a1b2c3",
"client_order_id": "my-order-001",
"ticker": "BTC-5MIN-25JUN04T0900-Y",
"side": "yes",
"price": "0.54",
"count": "100",
"fill_count": "40",
"remaining_count": "60",
"average_fill_price": "0.54",
"status": "PARTIAL"
}List orders
Requires auth/api/portfolio/ordersReturns your orders, cursor-paginated and optionally filtered by `ticker` and `status`.
Query parameters
tickerstringqueryoptionalFilter by market ticker.
statusstringqueryoptionalFilter by order status.
OPENPARTIALFILLEDCANCELLEDlimitintegerqueryoptionaldefault: 20Page size. Max 100.
cursorstringqueryoptionalOpaque cursor from the previous page.
Request
curl "https://api.majjha.com/api/portfolio/orders" \
-H "Authorization: Bearer $PMX_API_KEY"Response
{
"cursor": null,
"orders": [
{
"order_id": "ord_a1b2c3",
"ticker": "BTC-5MIN-25JUN04T0900-Y",
"side": "yes",
"type": "LIMIT",
"time_in_force": "GTC",
"price": "0.54",
"count": "100",
"fill_count": "40",
"remaining_count": "60",
"status": "PARTIAL",
"client_order_id": "my-order-001",
"post_only": false,
"reduce_only": false,
"created_at": "2026-06-04T09:03:00Z",
"updated_at": "2026-06-04T09:03:05Z"
}
]
}Get order
Requires auth/api/portfolio/orders/{order_id}Returns a single order you own by its id.
Path parameters
order_idstringpathrequiredThe order id.
Request
curl "https://api.majjha.com/api/portfolio/orders/{order_id}" \
-H "Authorization: Bearer $PMX_API_KEY"Response
{
"order_id": "ord_a1b2c3",
"ticker": "BTC-5MIN-25JUN04T0900-Y",
"side": "yes",
"type": "LIMIT",
"time_in_force": "GTC",
"price": "0.54",
"count": "100",
"fill_count": "40",
"remaining_count": "60",
"status": "PARTIAL",
"client_order_id": "my-order-001",
"post_only": false,
"reduce_only": false,
"created_at": "2026-06-04T09:03:00Z",
"updated_at": "2026-06-04T09:03:05Z"
}Cancel order
Requires auth/api/portfolio/orders/{order_id}Cancels the remaining (unfilled) quantity of an order.
Path parameters
order_idstringpathrequiredThe order id to cancel.
Request
curl -X DELETE "https://api.majjha.com/api/portfolio/orders/{order_id}" \
-H "Authorization: Bearer $PMX_API_KEY"Response
{
"status": "cancelled"
}Amend order
Requires auth/api/portfolio/orders/{order_id}/amendAtomically replaces an order's price and/or remaining count, preserving the order id. Re-queues at the new price (loses time priority if price changes).
Path parameters
order_idstringpathrequiredThe order id to amend.
Body parameters
pricenumberbodyoptionalNew limit price (0.01–0.99).
countnumberbodyoptionalNew total contract count.
Request
curl -X POST "https://api.majjha.com/api/portfolio/orders/{order_id}/amend" \
-H "Authorization: Bearer $PMX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"price": 0.55,
"count": 80
}'{
"price": 0.55,
"count": 80
}Response
{
"order_id": "ord_a1b2c3",
"client_order_id": "my-order-001",
"ticker": "BTC-5MIN-25JUN04T0900-Y",
"side": "yes",
"price": "0.55",
"count": "80",
"fill_count": "40",
"remaining_count": "40",
"average_fill_price": "0.54",
"status": "PARTIAL"
}Decrease order
Requires auth/api/portfolio/orders/{order_id}/decreaseReduces an order's resting count without touching its price or time priority.
Path parameters
order_idstringpathrequiredThe order id to decrease.
Body parameters
countnumberbodyrequiredContracts to remove from the resting quantity.
Request
curl -X POST "https://api.majjha.com/api/portfolio/orders/{order_id}/decrease" \
-H "Authorization: Bearer $PMX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"count": 20
}'{
"count": 20
}Response
{
"status": "decreased"
}Batch create orders
Requires auth/api/portfolio/orders/batchedSubmits up to 20 orders in a single request. Each result is returned independently — a failure on one order does not roll back the others.
Body parameters
ordersarraybodyrequiredArray of order objects (same fields as Create order). Max 20.
Request
curl -X POST "https://api.majjha.com/api/portfolio/orders/batched" \
-H "Authorization: Bearer $PMX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"orders": [
{ "ticker": "BTC-5MIN-25JUN04T0900-Y", "side": "yes", "action": "buy", "count": 50, "price": 0.53 },
{ "ticker": "BTC-5MIN-25JUN04T0900-Y", "side": "no", "action": "buy", "count": 50, "price": 0.46 }
]
}'{
"orders": [
{ "ticker": "BTC-5MIN-25JUN04T0900-Y", "side": "yes", "action": "buy", "count": 50, "price": 0.53 },
{ "ticker": "BTC-5MIN-25JUN04T0900-Y", "side": "no", "action": "buy", "count": 50, "price": 0.46 }
]
}Response
{
"results": [
{ "order": { "order_id": "ord_a1", "ticker": "BTC-5MIN-25JUN04T0900-Y", "side": "yes", "price": "0.53", "count": "50", "fill_count": "0", "remaining_count": "50", "status": "OPEN" } },
{ "error": "insufficient balance" }
]
}Batch cancel orders
Requires auth/api/portfolio/orders/batchedCancels up to 20 orders by id in a single request.
Body parameters
order_idsarraybodyrequiredArray of order ids to cancel.
Request
curl -X DELETE "https://api.majjha.com/api/portfolio/orders/batched" \
-H "Authorization: Bearer $PMX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"order_ids": ["ord_a1", "ord_a2", "ord_a3"]
}'{
"order_ids": ["ord_a1", "ord_a2", "ord_a3"]
}Response
{
"results": [
{ "order_id": "ord_a1", "status": "cancelled" },
{ "order_id": "ord_a2", "status": "cancelled" },
{ "order_id": "ord_a3", "error": "not found" }
]
}