majjha.developers
Open beta

Public beta: activity uses test Dots with no monetary value. There is no money in or out, and interfaces may change before launch.

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
POST/api/portfolio/orders/preview

Returns reserve requirements, the enforced fee-free V1 profile, and balance or position sufficiency for an order without placing it.

Body parameters

  • tickerstringbodyrequired

    Market ticker or id.

  • sidestringbodyrequired

    Outcome side. `bid` aliases YES and `ask` aliases NO.

    yesnobidask
  • actionstringbodyoptionaldefault: buy

    Buy or sell the selected outcome.

    buysell
  • countstringbodyrequired

    Number of contracts.

  • pricestringbodyrequired

    Outcome-frame price, 0.01–0.99.

  • builder_codestringbodyoptional

    Optional public bytes32 builder code for fee attribution.

Request

cURL
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"
  }'
Request body
{
  "ticker": "BTC-5MIN-25JUN04T0900-Y",
  "side": "yes",
  "action": "buy",
  "count": "100",
  "price": "0.54",
  "builder_code": "0x0000000000000000000000000000000000000000000000000000000000000042"
}

Response

200 OK
{
  "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
GET/api/portfolio/orders

Returns your orders, cursor-paginated and optionally filtered by `ticker`, `market`, and `status`.

Query parameters

  • tickerstringqueryoptional

    Filter by market ticker.

  • marketstringqueryoptional

    Filter by market id. Preferred when available.

  • statusstringqueryoptional

    Filter 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: 20

    Page size. Max 100.

  • cursorstringqueryoptional

    Opaque cursor from the previous page.

Request

cURL
curl "https://api.majjha.fun/api/portfolio/orders" \
  -H "Authorization: Bearer $MAJJ_TOKEN"

Response

200 OK
{
  "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
GET/api/portfolio/orders/{order_id}

Returns a single order you own by its id.

Path parameters

  • order_idstringpathrequired

    The order id.

Request

cURL
curl "https://api.majjha.fun/api/portfolio/orders/{order_id}" \
  -H "Authorization: Bearer $MAJJ_TOKEN"

Response

200 OK
{
  "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
DELETE/api/portfolio/orders/{order_id}

Cancels the remaining (unfilled) quantity of an order.

Path parameters

  • order_idstringpathrequired

    The order id to cancel.

Request

cURL
curl -X DELETE "https://api.majjha.fun/api/portfolio/orders/{order_id}" \
  -H "Authorization: Bearer $MAJJ_TOKEN"

Response

200 OK
{
  "status": "cancelled"
}

Cancel open orders

Requires auth
DELETE/api/portfolio/orders

Cancels all of your open orders, or all open orders scoped to one market/ticker.

Query parameters

  • marketstringqueryoptional

    Optional market id or ticker. If omitted, all open orders are cancelled.

  • tickerstringqueryoptional

    Optional market ticker. Use either `market` or `ticker`, not both.

Request

cURL
curl -X DELETE "https://api.majjha.fun/api/portfolio/orders" \
  -H "Authorization: Bearer $MAJJ_TOKEN"

Response

200 OK
{
  "status": "cancelled",
  "cancelled": 3,
  "market_id": "mkt_btc5m_a1"
}

Send order heartbeat

Requires auth
POST/api/portfolio/heartbeat

Maintains 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_idstringbodyoptional

    Previous heartbeat id. Omit or send an empty value to start/renew the current session.

Request

cURL
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"
  }'
Request body
{
  "heartbeat_id": "hb_abc123"
}

Response

200 OK
{
  "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
GET/api/portfolio/order-scoring/status

Returns heartbeat liveness plus counts of open and currently scorable orders for the authenticated user.

Request

cURL
curl "https://api.majjha.fun/api/portfolio/order-scoring/status" \
  -H "Authorization: Bearer $MAJJ_TOKEN"

Response

200 OK
{
  "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
GET/api/clob/order-scoring

Checks whether one authenticated order is currently scoring for maker rewards in the Polymarket CLOB response shape.

Query parameters

  • order_idstringqueryrequired

    Order id to check. Alias: `orderId` / `orderID`.

Request

cURL
curl "https://api.majjha.fun/api/clob/order-scoring" \
  -H "Authorization: Bearer $MAJJ_TOKEN"

Response

200 OK
{
  "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
GET/api/clob/orders-scoring

Checks whether multiple authenticated orders are currently scoring for maker rewards using the current Polymarket SDK query-parameter workflow.

Query parameters

  • order_idsstring[]queryrequired

    Repeated or comma-separated order ids to check. Max 1,000.

Request

cURL
curl "https://api.majjha.fun/api/clob/orders-scoring" \
  -H "Authorization: Bearer $MAJJ_TOKEN"

Response

200 OK
{
  "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
POST/api/clob/orders-scoring

Checks whether multiple authenticated orders are currently scoring for maker rewards, matching the current Polymarket SDK `/orders-scoring` workflow.

Body parameters

  • bodyarraybodyrequired

    Raw array of order ids to check. Max 1,000.

Request

cURL
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"]'
Request body
["ord_a1", "ord_a2"]

Response

200 OK
{
  "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
POST/api/portfolio/orders/{order_id}/decrease

Sets 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_idstringpathrequired

    The order id to decrease.

Body parameters

  • countnumberbodyrequired

    New remaining contract count; it must be smaller than the current remainder.

Request

cURL
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
  }'
Request body
{
  "count": 20
}

Response

200 OK
{
  "status": "decreased"
}

Batch cancel orders

Requires auth
DELETE/api/portfolio/orders/batched

Cancels 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_idsarraybodyrequired

    Array of order ids to cancel. Max 1,000.

Request

cURL
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"]
  }'
Request body
{
  "order_ids": ["ord_a1", "ord_a2", "ord_a3"]
}

Response

200 OK
{
  "results": [
    { "order_id": "ord_a1", "status": "cancelled" },
    { "order_id": "ord_a2", "status": "cancelled" },
    { "order_id": "ord_a3", "error": "not found" }
  ]
}