Orders
Preview, read, reduce, and cancel orders against the central limit order book. Automated order entry is an approved beta surface; public order-management endpoints require an authenticated account.
Preview order fees
Requires auth/api/portfolio/orders/previewReturns reserve requirements, the enforced fee-free V1 profile, and balance or position sufficiency for an order without placing it.
Body parameters
tickerstringbodyrequiredMarket ticker or id.
sidestringbodyrequiredOutcome side. `bid` aliases YES and `ask` aliases NO.
yesnobidaskactionstringbodyoptionaldefault: buyBuy or sell the selected outcome.
buysellcountstringbodyrequiredNumber of contracts.
pricestringbodyrequiredOutcome-frame price, 0.01–0.99.
builder_codestringbodyoptionalOptional public bytes32 builder code for fee attribution.
Request
curl -X POST "https://api.majjha.fun/api/portfolio/orders/preview" \
-H "Authorization: Bearer $MAJJ_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"ticker": "BTC-5MIN-25JUN04T0900-Y",
"side": "yes",
"action": "buy",
"count": "100",
"price": "0.54",
"builder_code": "0x0000000000000000000000000000000000000000000000000000000000000042"
}'{
"ticker": "BTC-5MIN-25JUN04T0900-Y",
"side": "yes",
"action": "buy",
"count": "100",
"price": "0.54",
"builder_code": "0x0000000000000000000000000000000000000000000000000000000000000042"
}Response
{
"market_id": "mkt_btc_0900",
"ticker": "BTC-5MIN-25JUN04T0900-Y",
"side": "YES",
"action": "buy",
"price": "0.54",
"count": "100",
"notional": "54.00",
"reserve_required": "54.00",
"available_balance": "10000.00",
"sufficient_balance": true,
"position_available": null,
"sufficient_position": null,
"platform_taker_fee_bps": 0,
"platform_maker_fee_bps": 0,
"builder_code": "0x0000000000000000000000000000000000000000000000000000000000000042",
"builder_maker_fee_bps": 0,
"builder_taker_fee_bps": 0,
"maker": {
"role": "maker",
"platform_fee_bps": 0,
"builder_fee_bps": 0,
"platform_fee": "0",
"builder_fee": "0",
"total_fee": "0",
"cash_required": "54.00",
"net_proceeds": "0"
},
"taker": {
"role": "taker",
"platform_fee_bps": 0,
"builder_fee_bps": 0,
"platform_fee": "0",
"builder_fee": "0",
"total_fee": "0",
"cash_required": "54.00",
"net_proceeds": "0"
}
}- →For buys, `reserve_required` equals notional under the official fee-free V1 profile.
- →Platform, builder, and signed-order fees must all be zero. Non-zero fee configuration or payloads are rejected fail-closed.
- →Fee metadata remains in the response for wire compatibility; fee charging can return only after asset-specific contract accounting is implemented and independently audited.
- →For sells, `reserve_required` is zero and `position_available` / `sufficient_position` show whether the user has enough shares.
List orders
Requires auth/api/portfolio/ordersReturns your orders, cursor-paginated and optionally filtered by `ticker`, `market`, and `status`.
Query parameters
tickerstringqueryoptionalFilter by market ticker.
marketstringqueryoptionalFilter by market id. Preferred when available.
statusstringqueryoptionalFilter by order status: `OPEN`, `PARTIAL`, `FILLED`, or `CANCELLED`. Accepts one status or a comma-separated set, matched before pagination — `OPEN,PARTIAL` is the live-orders view.
limitintegerqueryoptionaldefault: 20Page size. Max 100.
cursorstringqueryoptionalOpaque cursor from the previous page.
Request
curl "https://api.majjha.fun/api/portfolio/orders" \
-H "Authorization: Bearer $MAJJ_TOKEN"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",
"builder_code": "0x0000000000000000000000000000000000000000000000000000000000000042",
"builder_maker_fee_bps": 0,
"builder_taker_fee_bps": 0,
"expiration_ts": null,
"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.fun/api/portfolio/orders/{order_id}" \
-H "Authorization: Bearer $MAJJ_TOKEN"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",
"expiration_ts": null,
"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.fun/api/portfolio/orders/{order_id}" \
-H "Authorization: Bearer $MAJJ_TOKEN"Response
{
"status": "cancelled"
}Cancel open orders
Requires auth/api/portfolio/ordersCancels all of your open orders, or all open orders scoped to one market/ticker.
Query parameters
marketstringqueryoptionalOptional market id or ticker. If omitted, all open orders are cancelled.
tickerstringqueryoptionalOptional market ticker. Use either `market` or `ticker`, not both.
Request
curl -X DELETE "https://api.majjha.fun/api/portfolio/orders" \
-H "Authorization: Bearer $MAJJ_TOKEN"Response
{
"status": "cancelled",
"cancelled": 3,
"market_id": "mkt_btc5m_a1"
}Send order heartbeat
Requires auth/api/portfolio/heartbeatMaintains order-session liveness for market makers. If the heartbeat expires, the engine cancels the user's resting orders through the normal cancel path.
Body parameters
heartbeat_idstringbodyoptionalPrevious heartbeat id. Omit or send an empty value to start/renew the current session.
Request
curl -X POST "https://api.majjha.fun/api/portfolio/heartbeat" \
-H "Authorization: Bearer $MAJJ_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"heartbeat_id": "hb_abc123"
}'{
"heartbeat_id": "hb_abc123"
}Response
{
"heartbeat_id": "hb_abc123",
"status": "active",
"timeout_seconds": 15,
"last_seen_at": "2026-06-04T09:03:05Z",
"expires_at": "2026-06-04T09:03:20Z"
}- →Default timeout is 15 seconds, matching the 10-second heartbeat plus buffer behavior makers expect from CLOB-style integrations.
- →Operators can tune `ORDER_HEARTBEAT_TIMEOUT_SECS` and disable the sweep with `ORDER_HEARTBEAT_SWEEP_INTERVAL_SECS=0` if needed.
- →Polymarket-compatible clients can call `/api/clob/heartbeats`, `/api/clob/v1/heartbeats`, `/api/heartbeats`, or `/v1/heartbeats`; those aliases return `{ "status": "ok" }`.
Get order scoring status
Requires auth/api/portfolio/order-scoring/statusReturns heartbeat liveness plus counts of open and currently scorable orders for the authenticated user.
Request
curl "https://api.majjha.fun/api/portfolio/order-scoring/status" \
-H "Authorization: Bearer $MAJJ_TOKEN"Response
{
"user_id": "usr_42",
"requires_heartbeat": true,
"order_scoring_enabled": true,
"heartbeat_active": true,
"open_orders": 12,
"scorable_orders": 10,
"markets": 3,
"open_notional": "842.50000000",
"heartbeat": {
"heartbeat_id": "hb_abc123",
"active": true,
"last_seen_at": "2026-06-04T09:03:05Z",
"expires_at": "2026-06-04T09:03:20Z",
"cancelled_at": null,
"cancelled_count": 0,
"seconds_until_expiry": 14
}
}- →Today a scorable order is a resting limit order on an active market. Reward epoch scoring can extend this response without changing the heartbeat contract.
- →Polymarket-compatible clients can call `/api/clob/order-scoring?order_id=...` or `/api/order-scoring?order_id=...` for the simple `{ "scoring": boolean }` shape, and `/api/clob/orders-scoring` or `/orders-scoring` for the current batch record shape.
Get CLOB order scoring status
Requires auth/api/clob/order-scoringChecks whether one authenticated order is currently scoring for maker rewards in the Polymarket CLOB response shape.
Query parameters
order_idstringqueryrequiredOrder id to check. Alias: `orderId` / `orderID`.
Request
curl "https://api.majjha.fun/api/clob/order-scoring" \
-H "Authorization: Bearer $MAJJ_TOKEN"Response
{
"scoring": true
}- →Compatibility alias: `/api/order-scoring`.
- →PredictMax returns `false` when the order is missing, not owned by the authenticated user, not resting, not on a reward-enabled market, below min size, or outside the live max-spread threshold.
- →The native `/api/portfolio/order-scoring/status` endpoint returns account-level heartbeat and aggregate scoring counts.
Batch CLOB order scoring status
Requires auth/api/clob/orders-scoringChecks whether multiple authenticated orders are currently scoring for maker rewards using the current Polymarket SDK query-parameter workflow.
Query parameters
order_idsstring[]queryrequiredRepeated or comma-separated order ids to check. Max 1,000.
Request
curl "https://api.majjha.fun/api/clob/orders-scoring" \
-H "Authorization: Bearer $MAJJ_TOKEN"Response
{
"ord_a1": true,
"ord_a2": false
}- →Exact root-path alias: `/orders-scoring`; `/api/orders-scoring` is also accepted.
Batch CLOB order scoring status (body)
Requires auth/api/clob/orders-scoringChecks whether multiple authenticated orders are currently scoring for maker rewards, matching the current Polymarket SDK `/orders-scoring` workflow.
Body parameters
bodyarraybodyrequiredRaw array of order ids to check. Max 1,000.
Request
curl -X POST "https://api.majjha.fun/api/clob/orders-scoring" \
-H "Authorization: Bearer $MAJJ_TOKEN" \
-H "Content-Type: application/json" \
-d '["ord_a1", "ord_a2"]'["ord_a1", "ord_a2"]Response
{
"ord_a1": true,
"ord_a2": false
}- →Exact root-path alias: `/orders-scoring`; `/api/orders-scoring` is also accepted.
- →The legacy wrapper aliases `/api/clob/order-scoring`, `/order-scoring`, and `/api/order-scoring` still accept `{ "order_ids": [...] }` and return `{ "results": [...], "scoring": { ... } }` for older PredictMax clients.
Decrease order
Requires auth/api/portfolio/orders/{order_id}/decreaseSets an order's smaller remaining count without touching its price or time priority. Live V1 remainders must stay on the 0.0001-share exact-fill quantum.
Path parameters
order_idstringpathrequiredThe order id to decrease.
Body parameters
countnumberbodyrequiredNew remaining contract count; it must be smaller than the current remainder.
Request
curl -X POST "https://api.majjha.fun/api/portfolio/orders/{order_id}/decrease" \
-H "Authorization: Bearer $MAJJ_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"count": 20
}'{
"count": 20
}Response
{
"status": "decreased"
}Batch cancel orders
Requires auth/api/portfolio/orders/batchedCancels up to 1,000 orders by id in a single request. The same body is also accepted by `POST /api/portfolio/orders/cancel` and CLOB-style `DELETE /api/clob/orders`.
Body parameters
order_idsarraybodyrequiredArray of order ids to cancel. Max 1,000.
Request
curl -X DELETE "https://api.majjha.fun/api/portfolio/orders/batched" \
-H "Authorization: Bearer $MAJJ_TOKEN" \
-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" }
]
}