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

Places 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

  • tickerstringbodyrequired

    Market ticker to trade.

  • sidestringbodyrequired

    Contract side.

    yesno
  • actionstringbodyoptionaldefault: buy

    Open or close exposure.

    buysell
  • countnumberbodyrequired

    Number of contracts.

  • pricenumberbodyrequired

    Limit price in dollars (0.01–0.99).

  • time_in_forcestringbodyoptionaldefault: GTC

    Order lifetime.

    GTCFOKIOC
  • client_order_idstringbodyoptional

    Client-supplied idempotency key.

  • post_onlybooleanbodyoptionaldefault: false

    Reject if the order would immediately match (maker-only).

  • reduce_onlybooleanbodyoptionaldefault: false

    Only reduce an existing position; never increase it.

Request

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

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

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

Query parameters

  • tickerstringqueryoptional

    Filter by market ticker.

  • statusstringqueryoptional

    Filter by order status.

    OPENPARTIALFILLEDCANCELLED
  • limitintegerqueryoptionaldefault: 20

    Page size. Max 100.

  • cursorstringqueryoptional

    Opaque cursor from the previous page.

Request

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

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",
      "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.com/api/portfolio/orders/{order_id}" \
  -H "Authorization: Bearer $PMX_API_KEY"

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",
  "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.com/api/portfolio/orders/{order_id}" \
  -H "Authorization: Bearer $PMX_API_KEY"

Response

200 OK
{
  "status": "cancelled"
}

Amend order

Requires auth
POST/api/portfolio/orders/{order_id}/amend

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

    The order id to amend.

Body parameters

  • pricenumberbodyoptional

    New limit price (0.01–0.99).

  • countnumberbodyoptional

    New total contract count.

Request

cURL
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
  }'
Request body
{
  "price": 0.55,
  "count": 80
}

Response

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

Reduces an order's resting count without touching its price or time priority.

Path parameters

  • order_idstringpathrequired

    The order id to decrease.

Body parameters

  • countnumberbodyrequired

    Contracts to remove from the resting quantity.

Request

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

Response

200 OK
{
  "status": "decreased"
}

Batch create orders

Requires auth
POST/api/portfolio/orders/batched

Submits 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

  • ordersarraybodyrequired

    Array of order objects (same fields as Create order). Max 20.

Request

cURL
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 }
    ]
  }'
Request body
{
  "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

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

Cancels up to 20 orders by id in a single request.

Body parameters

  • order_idsarraybodyrequired

    Array of order ids to cancel.

Request

cURL
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"]
  }'
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" }
  ]
}