CreateFundedOrder executes the full on-demand funding flow in one call: it validates the request, transfers the total prefund (collateral + exchange fee reserve + vendor fee) from your partner funding account into the participant’s account, submits the limit order, and waits for the exchange’s durable outcome before returning.
Service definition
Service:polymarket.us.orderfunding.v1.OrderFundingService
RPC: CreateFundedOrder
Type: Unary (request/response)
Request
CreateFundedOrderRequest
Response
CreateFundedOrderResponse
FundedOrderStatus
ACCEPTED means durable acceptance. The service does not report an order as accepted based on submission alone — it waits for the exchange’s durable outcome. An order the exchange rejects asynchronously after submission is returned as REJECTED with the prefund reversed, not as a phantom accepted order.Idempotency and retries
Theidempotency_key identifies one funded-order request for your authenticated firm. The service guarantees at most one prefund transfer and at most one resting order per key:
- Retry on transport failure or timeout (deadline exceeded, connection loss,
UNAVAILABLE): call again with the same key. If the original attempt completed, you get its recorded terminal result; if it was interrupted, the service resumes or resolves it. - Retry on
PENDING: call again with the same key. The service re-checks the exchange outcome and either returns the terminal result or safely resumes the flow. - Never reuse a key for a different order. Use a fresh key for each new funded-order request.
Compensating reversal
When the prefund transfer succeeds but no order durably reaches the book — validation failure at the exchange, rejection, or permanent submission failure — the service automatically reverses exactly the total prefund amount from the participant account back to your partner funding account. The reversal is linked to the originalfunding_request_id and prefund_transfer_id, and both legs are visible on the balance ledger.
You do not need to trigger or manage reversals; a REJECTED response means the reversal path has been taken.
Cancelling a funded order
Example
Errors
An order-level rejection (for example, a price outside market limits) is not a gRPC error: the call returns
OK with status = FUNDED_ORDER_STATUS_REJECTED, and the prefund is reversed. Quote the correlation identifiers when you need the underlying rejection detail from support.