> ## Documentation Index
> Fetch the complete documentation index at: https://docs.polymarket.us/llms.txt
> Use this file to discover all available pages before exploring further.

# Preview a Funded Order

> Quote the collateral, exchange fee reserve, vendor fee, and total prefund for a funded order.

<Warning>
  **BETA — SUBJECT TO CHANGE.** This API is in beta and may change without notice.
</Warning>

`PreviewFundedOrder` returns the prefund economics for a funded limit order without moving funds or placing an order. Use it to show a participant the cost of an order before they commit.

<Info>
  Preview responses are **informational**. Placement recomputes all economics from the `CreateFundedOrder` request — a preview is not a locked quote, and calling preview first is not required.
</Info>

## Service definition

**Service:** `polymarket.us.orderfunding.v1.OrderFundingService`
**RPC:** `PreviewFundedOrder`
**Type:** Unary (request/response)

```protobuf theme={null}
service OrderFundingService {
    rpc PreviewFundedOrder(PreviewFundedOrderRequest)
        returns (PreviewFundedOrderResponse);
}
```

## Request

### PreviewFundedOrderRequest

| Field                 | Type          | Required | Description                                                                                                                      |
| --------------------- | ------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------- |
| `order`               | `FundedOrder` | Yes      | The order to price. Same shape as placement — see [FundedOrder](#fundedorder).                                                   |
| `customer_account_id` | `string`      | Yes      | The participant trading account that would receive the prefund, in the same format returned by the account onboarding/list APIs. |
| `vendor_fee`          | `MoneyAmount` | Yes      | Your static USD vendor fee for this order. Must be well-formed, non-negative, and allowed for your firm.                         |

### FundedOrder

The supported order shape for on-demand funded placement. The initial rollout supports **limit orders** on **binary event markets**.

| Field                       | Type                   | Required    | Description                                                                                                               |
| --------------------------- | ---------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- |
| `market_slug`               | `string`               | Yes         | Market identifier (slug).                                                                                                 |
| `type`                      | `OrderType`            | Yes         | `ORDER_TYPE_LIMIT`. Limit orders only.                                                                                    |
| `price`                     | `MoneyAmount`          | Yes         | Limit price per share in USD, e.g. `{"value": "0.45", "currency": "USD"}`.                                                |
| `quantity`                  | `string`               | Yes         | Number of shares as a base-10 decimal string.                                                                             |
| `tif`                       | `TimeInForce`          | Yes         | `TIME_IN_FORCE_DAY`, `TIME_IN_FORCE_GOOD_TILL_CANCEL`, `TIME_IN_FORCE_GOOD_TILL_TIME`, or `TIME_IN_FORCE_FILL_OR_KILL`.   |
| `good_till_time`            | `Timestamp`            | Conditional | Expiration timestamp. Required when `tif` is `TIME_IN_FORCE_GOOD_TILL_TIME`.                                              |
| `participate_dont_initiate` | `bool`                 | No          | Post-only flag: the order may rest on the book but must not immediately match.                                            |
| `intent`                    | `OrderIntent`          | Yes         | `ORDER_INTENT_OPEN` or `ORDER_INTENT_CLOSE` — whether the order opens or closes exposure.                                 |
| `outcome_side`              | `OutcomeSide`          | Yes         | `OUTCOME_SIDE_YES` or `OUTCOME_SIDE_NO`.                                                                                  |
| `action`                    | `OrderAction`          | Yes         | `ORDER_ACTION_BUY` or `ORDER_ACTION_SELL`.                                                                                |
| `manual_order_indicator`    | `ManualOrderIndicator` | Yes         | `MANUAL_ORDER_INDICATOR_MANUAL` for human-entered orders, `MANUAL_ORDER_INDICATOR_AUTOMATED` for system-generated orders. |

### MoneyAmount

| Field      | Type     | Description                            |
| ---------- | -------- | -------------------------------------- |
| `value`    | `string` | Base-10 decimal string, e.g. `"0.45"`. |
| `currency` | `string` | ISO 4217 code. `USD`.                  |

## Response

### PreviewFundedOrderResponse

| Field            | Type            | Description                                |
| ---------------- | --------------- | ------------------------------------------ |
| `cost_breakdown` | `CostBreakdown` | The prefund cost components for the order. |

### CostBreakdown

| Field           | Type          | Description                                                                                                                                                                     |
| --------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `collateral`    | `MoneyAmount` | Worst-case collateral: `quantity × price` for buys, `quantity × (1 − price)` for sells.                                                                                         |
| `exchange_fee`  | `MoneyAmount` | Estimated **maximum** exchange fee reserve for a full fill. Actual collection happens per execution and can be lower — see [cost model](/partners/funding/overview#cost-model). |
| `vendor_fee`    | `MoneyAmount` | Your vendor fee, echoed after validation.                                                                                                                                       |
| `total_prefund` | `MoneyAmount` | `collateral + exchange_fee + vendor_fee` — the amount that placement would transfer.                                                                                            |

## Example

```python theme={null}
import grpc
from polymarket.us.orderfunding.v1 import order_funding_pb2, order_funding_pb2_grpc

credentials = grpc.ssl_channel_credentials()
channel = grpc.secure_channel("<grpc-endpoint>:443", credentials)
stub = order_funding_pb2_grpc.OrderFundingServiceStub(channel)
metadata = [("authorization", f"Bearer {access_token}")]

request = order_funding_pb2.PreviewFundedOrderRequest(
    order=order_funding_pb2.FundedOrder(
        market_slug="example-market-slug",
        type=order_funding_pb2.ORDER_TYPE_LIMIT,
        price=order_funding_pb2.MoneyAmount(value="0.45", currency="USD"),
        quantity="100",
        tif=order_funding_pb2.TIME_IN_FORCE_DAY,
        intent=order_funding_pb2.ORDER_INTENT_OPEN,
        outcome_side=order_funding_pb2.OUTCOME_SIDE_YES,
        action=order_funding_pb2.ORDER_ACTION_BUY,
        manual_order_indicator=order_funding_pb2.MANUAL_ORDER_INDICATOR_AUTOMATED,
    ),
    customer_account_id="<customer-account-id>",
    vendor_fee=order_funding_pb2.MoneyAmount(value="0.10", currency="USD"),
)

response = stub.PreviewFundedOrder(request, metadata=metadata)
print(response.cost_breakdown.total_prefund.value)
```

## Errors

| gRPC status         | Meaning                                                                                          |
| ------------------- | ------------------------------------------------------------------------------------------------ |
| `INVALID_ARGUMENT`  | Malformed or unsupported order parameters, unsupported TIF/order type, or an invalid vendor fee. |
| `UNAUTHENTICATED`   | Missing or invalid access token.                                                                 |
| `PERMISSION_DENIED` | Your firm has no enabled funding relationship, or the vendor fee is not allowed for your firm.   |
| `NOT_FOUND`         | Unknown market or customer account.                                                              |

## Next step

<Card title="CreateFundedOrder" icon="bolt" href="/partners/funding/create-funded-order" horizontal>
  Fund and place the order in one idempotent call.
</Card>
