Skip to main content
Audience: developers. This is a hands-on, copy-paste guide. For eligibility, agreements, and the business setup, see ISVs / IBs and Partner Onboarding.
This guide walks the core partner loop end to end — the same three moves your production integration will repeat for every participant: By the end you’ll have:
  1. Authenticated with the API as your Firm — your only credential; every action after this is on behalf of a participant
  2. Onboarded a Retail Participant via KYC and captured their trading account
  3. Previewed and placed an on-demand funded order on their behalf
  4. Seen where the money moves — and how settled funds sweep back
Prerequisites: Complete Partner Onboarding to receive your Client ID and register your public key, and have your funding relationship configured (On-Demand Funding is Beta, enabled per partner). This guide uses pre-production (api.preprod.polymarketexchange.com).

Step 1: Authenticate

Authentication uses Private Key JWT — you sign a JWT with your private key and exchange it for a short-lived access token. The full mechanism, claims, and key rotation are covered in the Authentication guide; the complete, runnable token code is in the full script at the bottom of this page. Once you have a token, set your auth header and confirm your identity with GET /v1/whoami:
Expected response:
Your Firm authenticates; it never trades. The Firm identity above is a permissions container — it holds no funds and places no orders of its own. Every trading action in this guide is performed on behalf of a Retail Participant: participant-scoped REST calls (positions, reports) identify them with the x-participant-id header — see Authentication → Acting on behalf of a participant — while funded orders carry the participant’s trading account (customer_account_id) in the request body. You’ll capture both identifiers in Step 2.

Step 2: Onboard a participant (KYC)

Before you can fund and place an order for a Retail Participant, they must pass KYC. Submit their identity data with POST /v1/kyc/start:
The outcome may be instant approval, document verification, or manual review — handle each per the decision matrix. Approval is asynchronous: the terminal outcome arrives on your registered webhook as a kyc.approved event, which carries the two identifiers you need:
  • provisioned_participant (e.g. firms/ISV-Participant-Acme/users/user-123) — the x-participant-id value for participant-scoped REST calls.
  • The participant’s provisioned trading account — the customer_account_id for funded orders. You can also list accounts under your Firm at any time:
No deposit step. The account is provisioned with a $0 balance and that’s fine — on-demand funding moves the exact cost of each order into the account at placement time. The participant can trade the moment KYC clears.

Step 3: Pick a market

Funded orders identify markets by slug. Discover markets with the Market API, then confirm the one you want:
Use orderPriceMinTickSize and minimumTradeQty from the response to validate prices and quantities before submitting.

Step 4: Preview the funded order

The funding API is gRPC-only (OrderFundingService). PreviewFundedOrder quotes the full prefund — collateral, exchange fee reserve, and your vendor fee — without moving funds, so you can show the participant the cost before they commit:
Preview is informational — placement recomputes all economics. See the cost model for how each component is calculated.

Step 5: Place the funded order

CreateFundedOrder transfers the total prefund from your partner funding account into the participant’s account and submits the order — one idempotent call:
Handle the three outcomes: On transport errors (UNAVAILABLE, timeouts), also retry with the same key — it can never double-fund or double-place. See idempotency and retries.

Step 6: Watch the money

Every cash movement is visible in real time — this is how your backend knows what happened and when funds become sweepable:
  • The prefund transfer (and any compensating reversal) appears on the Balance Ledger Stream for the participant account and your funding account.
  • Fills arrive on the Drop Copy Stream; per-execution fee collection and settlement credits land on the ledger.
  • Log the correlation identifiers (idempotency_key, funding_request_id, request_id) from every response — they tie ledger entries back to orders.

Step 7: Sweep settled funds back

After fills settle, cancels release collateral, or positions close, cash accumulates in the participant’s account — it does not move back automatically. Your backend watches the ledger, determines the sweepable amount per your agreements, and initiates a sweep back to the partner funding account. See settlement and sweeps for the lifecycle, and Settlement Sweeps for the planned sweep API contract.
Settlement sweeps are part of the beta rollout. The sweep API is not yet available — its planned contract is on Settlement Sweeps. Contact institutional@polymarket.us for availability.

Complete example

A single runnable script covering the funded-order path — including the full token exchange (see the Authentication guide for an explanation of each claim). KYC is omitted because its terminal outcome arrives on your webhook; run Step 2 once and plug in the resulting account:
Required packages:
The polymarket.us.orderfunding.v1 stubs are generated from the funding API protos provided during beta enablement — contact institutional@polymarket.us if you don’t have them.

Next steps

On-Demand Funding

The full model — parties, cost model, sweeps, and reconciliation.

KYC Verification

All four verification outcomes and webhook handling.

Balance Ledger Stream

Track every prefund, fill, and settlement credit in real time.

Authentication

Token refresh, key rotation, and scopes.