---
title: "Estimate an order"
method: POST
path: "/preview/v2/order_preview"
tags: ["Orders"]
---

# Estimate an order

`POST /preview/v2/order_preview`

Estimate a buy or sell order before placing it.

## Request body

- union
  - object
    - `requirements` SfcApiRequirements, required — Key/value filters on instance SKU properties. Valid keys and values are published at `GET /v2/instance_sku_property_catalog`. Empty map = no constraints.
    - `start_at` integer, required — Unix timestamp.
    - `duration_seconds` integer, required — Order duration in seconds. Must be a positive multiple of 60.
    - `node_count` integer, required — Number of nodes. Must be positive.
    - `capacity` string — A resource path like 'sfc:capacity:acme:prod:my-capacity' _or_ an ID. Resource paths are human-readable but not stable - they change when resources are renamed or moved. IDs are stable and permanent.
    - `side` 'buy', required
  - object
    - `capacity` string — A resource path like 'sfc:capacity:acme:prod:my-capacity' _or_ an ID. Resource paths are human-readable but not stable - they change when resources are renamed or moved. IDs are stable and permanent.
    - `start_at` integer, required — Unix timestamp.
    - `duration_seconds` integer, required — Order duration in seconds. Must be a positive multiple of 60.
    - `node_count` integer, required — Number of nodes. Must be positive.
    - `requirements` SfcApiRequirements, required — Key/value filters on instance SKU properties. Valid keys and values are published at `GET /v2/instance_sku_property_catalog`. Empty map = no constraints.
    - `side` 'sell', required

## Response `200`

Estimate result.

- union
  - object
    - `post_order_body` SfcApiV2CreateOrderRequest, required
      - `capacity` string, required — A resource path like 'sfc:capacity:acme:prod:my-capacity' _or_ an ID. Resource paths are human-readable but not stable - they change when resources are renamed or moved. IDs are stable and permanent.
      - `side` 'sell' | 'buy', required
      - `allow_standing` boolean — If true, the order rests on the order book until it fills, is cancelled, or its end time passes. If false, the order is cancelled immediately if it does not fill.
      - `instance_sku` string, required
      - `allocation_schedule_delta` SfcApiScheduleEntry[], required — Node count over time, as a list of `[start_at, end_at)` time ranges. Example: 5 nodes from t=0 to t=3600 is `[{"start_at": 0, "end_at": 3600, "node_count": 5}]`. `start_at` and `end_at` must be 60-second aligned, `node_count` must be non-negative. On non-final entries, `end_at` may be omitted (inferred from the next entry's `start_at`); gaps fill with `node_count: 0`.
        - `start_at` integer, required — Unix timestamp.
        - `end_at` integer — Unix timestamp.
        - `node_count` integer, required
      - `limit_price_dollars_per_node_hour` string, required — Price rate in dollars per node-hour.
    - `fee` SfcApiV2OrderPreviewFee, required — Fee charged on fills for the targeted instance SKU. Total fee = `flat_dollars_per_node_hour × node_count × duration_hours` + `percentage_bps / 10000 × execution_total_dollars`. Recomputed against the realized price at fill time.
      - `flat_dollars_per_node_hour` string, required — Price rate in dollars per node-hour.
      - `percentage_bps` integer, required — Percentage of execution total, in basis points (10000 = 100%).
    - `notices` SfcApiV2OrderPreviewNotice[] — Maintenance windows for the matched instance SKU overlapping the order's delivery window.
      - `start_at` integer, required — Unix timestamp.
      - `end_at` integer, required — Unix timestamp.
      - `maintenance_type` 'info' | 'degraded_performance' | 'marketplace_unavailable', required
      - `title` string, required
      - `description` string, required
      - `action_message` string, nullable
      - `type` 'maintenance_window', required
    - `type` 'quoted', required
  - object
    - `reason` 'no_matching_instance_skus' | 'no_availability', required
    - `fee` SfcApiV2OrderPreviewFee — Fee charged on fills for the targeted instance SKU. Total fee = `flat_dollars_per_node_hour × node_count × duration_hours` + `percentage_bps / 10000 × execution_total_dollars`. Recomputed against the realized price at fill time.
      - `flat_dollars_per_node_hour` string, required — Price rate in dollars per node-hour.
      - `percentage_bps` integer, required — Percentage of execution total, in basis points (10000 = 100%).
    - `notices` SfcApiV2OrderPreviewNotice[] — Maintenance windows for the targeted instance SKU overlapping the requested order window.
      - `start_at` integer, required — Unix timestamp.
      - `end_at` integer, required — Unix timestamp.
      - `maintenance_type` 'info' | 'degraded_performance' | 'marketplace_unavailable', required
      - `title` string, required
      - `description` string, required
      - `action_message` string, nullable
      - `type` 'maintenance_window', required
    - `type` 'unavailable', required

## Other responses

- `401` — Unauthorized.
- `422` — Validation failed.
- `500` — Internal server error.

---

[API](https://skmtc.net/sfcompute/apis/san-francisco-compute-documentation.md) · [All operations](https://skmtc.net/sfcompute/apis/san-francisco-compute-documentation/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/sfcompute/san-francisco-compute-documentation/revisions/93dd7661e9bb/schema)
