Orders API Reference
Authenticated methods for submitting, inspecting, and canceling orders.
OrdersMixin
Authenticated order management endpoints.
This mixin is not meant to be used directly. It is mixed into
:class:~revolut_x.client.RevolutXClient.
calculate_maker_price
calculate_maker_price(symbol: str, side: OrderSide | str, *, offset: Any = Decimal('0.10'), tick_size: Any = Decimal('0.01')) -> Decimal
Fetch current ticker for symbol and calculate the optimal Maker price.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Trading pair (e.g. |
required |
side
|
OrderSide | str
|
:attr: |
required |
offset
|
Any
|
Offset in quote currency (default: |
Decimal('0.10')
|
tick_size
|
Any
|
Price tick size for quantisation (default: |
Decimal('0.01')
|
Returns:
| Name | Type | Description |
|---|---|---|
Decimal |
Decimal
|
The optimal limit price for a zero-fee Maker order. |
Source code in src/revolut_x/orders.py
cancel_all_orders
Cancel all open orders, optionally filtered by trading pair.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str | None
|
If provided, only cancel orders for this pair
(e.g. |
None
|
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
The API response confirming cancellation. |
Raises:
| Type | Description |
|---|---|
AuthenticationError
|
If the client is not authenticated. |
Example::
>>> client.cancel_all_orders("BTC-EUR")
Source code in src/revolut_x/orders.py
cancel_order
Cancel a specific open order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order_id
|
str
|
The exchange-assigned order ID ( |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
The API response confirming cancellation. |
Raises:
| Type | Description |
|---|---|
AuthenticationError
|
If the client is not authenticated. |
ApiError
|
If the order cannot be canceled (e.g. already filled, not found). |
Example::
>>> client.cancel_order("7a52e92e-8639-4fe1-abaa-68d3a2d5234b")
Source code in src/revolut_x/orders.py
get_active_orders
Retrieve all currently open (active) orders.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str | None
|
Optional filter by trading pair (e.g. |
None
|
Returns:
| Type | Description |
|---|---|
list[OrderDetail]
|
A list of :class: |
Raises:
| Type | Description |
|---|---|
AuthenticationError
|
If the client is not authenticated. |
Source code in src/revolut_x/orders.py
get_historical_orders
get_historical_orders(symbol: str | None = None, *, limit: int = 50, cursor: str | None = None) -> tuple[list[OrderDetail], str | None]
Retrieve historical (completed/canceled) orders with pagination.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str | None
|
Optional filter by trading pair. |
None
|
limit
|
int
|
Number of orders per page (default: 50). |
50
|
cursor
|
str | None
|
Pagination cursor from a previous response. |
None
|
Returns:
| Type | Description |
|---|---|
list[OrderDetail]
|
A tuple of |
str | None
|
if there are no more pages. |
Raises:
| Type | Description |
|---|---|
AuthenticationError
|
If the client is not authenticated. |
Source code in src/revolut_x/orders.py
get_order
Retrieve detailed information about a specific order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order_id
|
str
|
The exchange-assigned order ID ( |
required |
Returns:
| Name | Type | Description |
|---|---|---|
An |
OrderDetail
|
class: |
OrderDetail
|
quantity, average fill price, total fee, and timestamps. |
Raises:
| Type | Description |
|---|---|
AuthenticationError
|
If the client is not authenticated. |
ApiError
|
If the order is not found (HTTP 404) or other error. |
Example::
>>> detail = client.get_order("7a52e92e-8639-4fe1-abaa-68d3a2d5234b")
>>> print(f"Status: {detail['status']}, Fee: {detail['total_fee']} EUR")
Source code in src/revolut_x/orders.py
get_order_fills
Retrieve individual fills (partial executions) for an order.
Each fill includes the execution price, quantity, and whether it
was a maker or taker trade (im field).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
order_id
|
str
|
The exchange-assigned order ID ( |
required |
Returns:
| Type | Description |
|---|---|
list[Fill]
|
A list of :class: |
list[Fill]
|
The |
list[Fill]
|
|
Raises:
| Type | Description |
|---|---|
AuthenticationError
|
If the client is not authenticated. |
ApiError
|
If the order is not found or other error. |
Example::
>>> fills = client.get_order_fills("7a52e92e-...")
>>> for fill in fills:
... fee_type = "maker (0%)" if fill["im"] else "taker (0.09%)"
... print(f"{fill['q']} BTC @ {fill['p']} EUR [{fee_type}]")
Source code in src/revolut_x/orders.py
place_limit_order
place_limit_order(symbol: str, side: OrderSide | str, price: str, *, base_size: str | None = None, quote_size: str | None = None, post_only: bool = False, time_in_force: TimeInForce | str = TimeInForce.GTC, client_order_id: str | None = None) -> OrderResponse
Place a limit order at a specific price.
Convenience wrapper around :meth:place_order with order_type=OrderType.LIMIT.
Exactly one of base_size or quote_size must be provided.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Trading pair (e.g. |
required |
side
|
OrderSide | str
|
:attr: |
required |
price
|
str
|
Limit price in the quote currency (e.g. |
required |
base_size
|
str | None
|
Amount in the base currency. Mutually exclusive
with |
None
|
quote_size
|
str | None
|
Amount in the quote currency. Mutually exclusive
with |
None
|
post_only
|
bool
|
If |
False
|
time_in_force
|
TimeInForce | str
|
:attr: |
GTC
|
client_order_id
|
str | None
|
Optional UUID for idempotency. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
An |
OrderResponse
|
class: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither or both of |
AuthenticationError
|
If the client is not authenticated. |
ApiError
|
If the exchange rejects the order. |
Example::
>>> order = client.place_limit_order(
... "BTC-EUR", OrderSide.BUY, price="80000.00",
... quote_size="50.00", post_only=True,
... )
>>> print(f"Limit order placed: {order['venue_order_id']}")
Source code in src/revolut_x/orders.py
place_maker_order
place_maker_order(symbol: str, side: OrderSide | str, *, price: str | None = None, offset: Any = Decimal('0.10'), tick_size: Any = Decimal('0.01'), base_size: str | None = None, quote_size: str | None = None, time_in_force: TimeInForce | str = TimeInForce.GTC, client_order_id: str | None = None) -> OrderResponse
Place a guaranteed zero-fee Maker limit order (0.00% fee).
If price is not explicitly provided, this method automatically fetches
the latest market ticker and computes an optimal Maker price with the given
offset:
- For BUY: best_bid - offset
- For SELL: best_ask + offset
The order is submitted with post_only=True, ensuring the exchange will
accept it as a Maker (0% fee) or reject it if it would match immediately.
Exactly one of base_size or quote_size must be provided.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Trading pair (e.g. |
required |
side
|
OrderSide | str
|
:attr: |
required |
price
|
str | None
|
Optional fixed limit price. If omitted, calculated dynamically. |
None
|
offset
|
Any
|
Offset in quote currency from best bid/ask (default: |
Decimal('0.10')
|
tick_size
|
Any
|
Minimum price increment for quantisation (default: |
Decimal('0.01')
|
base_size
|
str | None
|
Amount in the base currency (e.g. |
None
|
quote_size
|
str | None
|
Amount in the quote currency (e.g. |
None
|
time_in_force
|
TimeInForce | str
|
:attr: |
GTC
|
client_order_id
|
str | None
|
Optional UUID for idempotency. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
An |
OrderResponse
|
class: |
Raises:
| Type | Description |
|---|---|
ValueError / OrderValidationError
|
If sizes or side are invalid. |
AuthenticationError
|
If the client is not authenticated. |
ApiError
|
If the exchange rejects the order. |
Example::
>>> # Buy BTC for 50 EUR with zero fee at optimal Maker price:
>>> order = client.place_maker_order("BTC-EUR", OrderSide.BUY, quote_size="50.00")
>>> print(f"Maker order placed: {order['venue_order_id']}")
Source code in src/revolut_x/orders.py
place_market_order
place_market_order(symbol: str, side: OrderSide | str, *, base_size: str | None = None, quote_size: str | None = None, client_order_id: str | None = None) -> OrderResponse
Place a market order (immediate execution, 0.09% taker fee).
Convenience wrapper around :meth:place_order with order_type=OrderType.MARKET.
Exactly one of base_size or quote_size must be provided.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol
|
str
|
Trading pair (e.g. |
required |
side
|
OrderSide | str
|
:attr: |
required |
base_size
|
str | None
|
Amount in the base currency (e.g. |
None
|
quote_size
|
str | None
|
Amount in the quote currency (e.g. |
None
|
client_order_id
|
str | None
|
Optional UUID for idempotency. Auto-generated if not provided. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
An |
OrderResponse
|
class: |
OrderResponse
|
order ID. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither or both of |
AuthenticationError
|
If the client is not authenticated. |
ApiError
|
If the exchange rejects the order. |
Example::
>>> order = client.place_market_order(
... "BTC-EUR", OrderSide.BUY, quote_size="50.00"
... )
>>> print(f"Bought BTC, order ID: {order['venue_order_id']}")
Source code in src/revolut_x/orders.py
place_order
place_order(symbol_or_payload: str | dict[str, Any], side: OrderSide | str | None = None, *, order_type: OrderType | str = OrderType.MARKET, price: str | None = None, base_size: str | None = None, quote_size: str | None = None, post_only: bool = False, time_in_force: TimeInForce | str = TimeInForce.GTC, client_order_id: str | None = None) -> OrderResponse
Submit an order to the exchange.
This method supports two calling styles:
-
Unified high-level placement (recommended)::
Market order
order = client.place_order("BTC-EUR", OrderSide.BUY, order_type="market", quote_size="50.00")
Limit order
order = client.place_order("BTC-EUR", OrderSide.BUY, order_type="limit", price="80000.00", quote_size="50.00")
-
Low-level raw payload dictionary (backward compatible)::
payload = OrderPayloadBuilder.build_market_order("BTC-EUR", OrderSide.BUY, quote_size="50.00") order = client.place_order(payload)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol_or_payload
|
str | dict[str, Any]
|
Trading pair (e.g. |
required |
side
|
OrderSide | str | None
|
:attr: |
None
|
order_type
|
OrderType | str
|
:attr: |
MARKET
|
price
|
str | None
|
Limit price in quote currency (required for limit orders, omitted for market orders). |
None
|
base_size
|
str | None
|
Amount in the base currency (e.g. |
None
|
quote_size
|
str | None
|
Amount in the quote currency (e.g. |
None
|
post_only
|
bool
|
If |
False
|
time_in_force
|
TimeInForce | str
|
:attr: |
GTC
|
client_order_id
|
str | None
|
Optional client UUID for idempotency. Auto-generated if not provided. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
An |
OrderResponse
|
class: |
OrderResponse
|
|
Raises:
| Type | Description |
|---|---|
ValueError / OrderValidationError
|
If order parameters are invalid or missing. |
AuthenticationError
|
If the client is not authenticated. |
ApiError
|
If the exchange rejects the order. |
Example::
>>> order = client.place_order(
... "BTC-EUR", OrderSide.BUY, order_type="market", quote_size="50.00"
... )
>>> print(f"Order ID: {order['venue_order_id']}")