Skip to main content

Get Order

Retrieves detailed information about a specific order on Binance, including its status, filled quantity, and execution details.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Client Id - The unique identifier from the Connect node (optional if using direct credentials).
  • Order Id - The unique identifier of the order to retrieve.
  • Currency Pair - The trading pair symbol of the order (e.g., BTCUSDT, ETHUSDT).

Options

  • Api Key - (Optional) Binance API key credential. Use if not providing Client Id.
  • Secret Key - (Optional) Binance API secret key credential. Use if not providing Client Id.

Output

  • Result - An object containing complete order details including status, filled quantities, prices, and timestamps.

How It Works

The Get Order node queries Binance for detailed information about a specific order.

When executed, the node:

  1. Retrieves the Binance client (from Client Id or creates one from credentials)
  2. Validates the Order Id and Currency Pair inputs
  3. Queries Binance for the order details
  4. Returns comprehensive order information

Requirements

  • Either a Client Id from Connect node OR API credentials in options
  • Valid Order ID from a previously created order
  • Correct Currency Pair matching the order
  • Appropriate API permissions (reading enabled)

Error Handling

The node will return specific errors in the following cases:

  • ErrInternal - Failed to retrieve input values
  • ErrInvalidArg - Empty Currency Pair or invalid Order ID (zero or negative)
  • ErrGetOrderService - Failed to retrieve order (e.g., order doesn't exist, wrong pair)
  • ErrSetOrder - Failed to set the result

Usage Notes

  • The Order Id must match an existing order on your account
  • The Currency Pair must match the original order
  • You can query both open and historical (filled/canceled) orders
  • Order information includes execution details and timestamps
  • Use this node to monitor order status in automation workflows

Order Information

The result object includes:

{
"symbol": "BTCUSDT",
"orderId": 123456789,
"orderListId": -1,
"clientOrderId": "...",
"price": "50000.00",
"origQty": "0.001",
"executedQty": "0.001",
"cummulativeQuoteQty": "50.00",
"status": "FILLED",
"timeInForce": "GTC",
"type": "LIMIT",
"side": "BUY",
"stopPrice": "0.00",
"icebergQty": "0.00",
"time": 1640000000000,
"updateTime": 1640000100000,
"isWorking": true,
"origQuoteOrderQty": "0.00"
}

Order Status Values

  • NEW - Order has been accepted but not yet filled
  • PARTIALLY_FILLED - Order has been partially executed
  • FILLED - Order has been completely executed
  • CANCELED - Order has been canceled
  • PENDING_CANCEL - Cancellation is in progress
  • REJECTED - Order was rejected and not accepted
  • EXPIRED - Order has expired

Example: Monitor Order Until Filled

Scenario: Check if an order has been executed

Inputs:

  • Client Id: (from Connect node)
  • Order Id: 123456789
  • Currency Pair: BTCUSDT

Output: Complete order details showing current status and filled quantities.

Example: Wait for Order Execution

[Buy Order]
|
v
[Store: order_id from result]
|
v
[Loop Until Filled]
|
v
[Get Order: order_id]
|
v
[If: result.status == "FILLED"]
|
+---> [Exit Loop]
|
v
[Wait: 5 seconds]
|
v
[Continue Loop]

Example: Partial Fill Monitoring

[Create Large Order]
|
v
[Timer: Every 30 seconds]
|
v
[Get Order: order_id]
|
v
[Calculate: fill_percentage = executedQty / origQty * 100]
|
v
[If: fill_percentage < 50 AND time_elapsed > 5_minutes]
|
v
[Cancel Order]
|
v
[Create New Order: with adjusted price]

Example: Order Verification Flow

[Place Order]
|
v
[Wait: 2 seconds]
|
v
[Get Order: verify placement]
|
v
[If: result.status == "REJECTED"]
|
v
[Log Error: "Order rejected - " + result]
|
v
[Alert User]

Key Fields Explained

origQty - Original quantity ordered executedQty - Quantity that has been filled cummulativeQuoteQty - Total quote asset amount spent/received status - Current order status time - Order creation timestamp (milliseconds) updateTime - Last update timestamp (milliseconds) isWorking - Whether order is actively working

Calculating Fill Progress

const fillPercentage = (order.executedQty / order.origQty) * 100;
const remainingQty = order.origQty - order.executedQty;
const avgFillPrice = order.cummulativeQuoteQty / order.executedQty;

Use Cases

Order Tracking:

  • Monitor order status in real-time
  • Check if orders have been filled
  • Verify order placement was successful

Execution Analysis:

  • Calculate average fill price
  • Determine partial fill percentage
  • Track execution time

Conditional Logic:

  • Proceed with next steps only if order filled
  • Cancel orders that aren't filling fast enough
  • Alert on order rejection or unusual status

Audit and Logging:

  • Record order execution details
  • Track trading performance
  • Verify trade executions

Trading Tips

  • Polling: Check order status periodically rather than continuously
  • Timeouts: Set maximum wait times for order fills
  • Partial Fills: Check executedQty to detect partial fills
  • Price Impact: Use cummulativeQuoteQty to calculate actual average price
  • Error Handling: Orders might be filled or canceled between checks
  • Rate Limits: Avoid excessive polling to respect API rate limits

Best Practices

  • Store Order IDs when creating orders for later retrieval
  • Implement reasonable polling intervals (5-30 seconds)
  • Handle all possible order statuses in your logic
  • Use order status to determine next automation steps
  • Log order details for audit trails
  • Calculate actual execution prices from cummulativeQuoteQty
  • Set timeouts to avoid infinite loops waiting for fills
  • Check for partial fills before assuming order completion

Common Patterns

Wait Pattern:

While order.status != "FILLED":
Get Order
Wait

Timeout Pattern:

While order.status != "FILLED" AND elapsed < timeout:
Get Order
Wait
If timeout exceeded:
Cancel Order

Verification Pattern:

Place Order
Wait briefly
Get Order
Assert order.status == "NEW"