What you’ll learn
Prerequisites
Before you begin, make sure you have:- A Synthesis project with your
X-PROJECT-API-KEY - Basic familiarity with REST APIs and HTTP requests
Step 1: Create a user account
The first step is to create a user account for your end user. This is done from your backend using your project secret API key. Each account represents a unique user in your application and can have multiple wallets, sessions, and API keys. Themetadata field is optional and can store any JSON data you want to associate with the account, such as your internal user ID, email, or other identifiers.
Step 2: Create a session or API key
Now you need to authenticate the user. There are two approaches depending on your use case:Option A: Session token
Best for frontend applications. Create a session and store the token in the user’s browser. Sessions expire after a period of inactivity but can be refreshed.
Option B: Account API key
Best for backend services. Create a long-lived API key that your server can use to make requests on behalf of the user. API keys don’t expire unless revoked.
Option A: Create a session
Create a session for the account. The session token should be stored securely in the user’s browser (e.g., in an HTTP-only cookie or secure storage) and sent with each request.Authorization header for all subsequent account requests:
Option B: Create an account API key
Create a long-lived API key for the account. Store this securely on your backend server. Never expose account API keys to the frontend.X-API-KEY header for all subsequent account requests:
Step 3: Get or create a wallet
Each account can have multiple wallets for trading. The easiest way to get started is to call theGET /api/v1/wallets endpoint, which will automatically create a Polygon wallet if one doesn’t exist.
Step 4: Get wallet deposit address
Before placing orders, the wallet needs USDC. There are two ways to get deposit addresses.Option A: Native Polygon deposit
The wallet’s Polygon address can receive USDC directly on the Polygon network:address to your user so they can deposit USDC (on Polygon) to fund their trading wallet.
Option B: Cross-chain deposit
Users can also deposit from other chains (Ethereum, Base, Arbitrum, Solana, etc.) using the cross-chain deposit endpoint. This generates a unique deposit address that automatically bridges funds to the Polygon wallet:EVM (Ethereum, Arbitrum, Base, Optimism, Binance), SOL, TRON.
Check wallet balance
You can check the wallet balance at any time:Step 5: Place a Polymarket order
Now you’re ready to place your first order. You’ll need thetoken_id of the market outcome you want to trade. You can get this from the market endpoints.
First, find a market and get its token IDs:
Order types
| Type | Description |
|---|---|
MARKET | Execute immediately at best available price |
LIMIT | Execute only at specified price or better |
STOPLOSS | Trigger a market sell when price drops to threshold |
Order parameters
| Parameter | Description |
|---|---|
token_id | The Polymarket token ID for the outcome you want to trade |
side | BUY or SELL |
type | MARKET, LIMIT, or STOPLOSS |
amount | Order amount as a string |
units | USDC (dollar amount) or SHARES (number of shares) |
price | Required for LIMIT and STOPLOSS orders (0.001 to 0.999) |
Step 6: View orders and positions
After placing orders, you can track their status and view your positions. Orders can be in various states:OPEN (active on the orderbook), PARTIAL (partially filled), FILLED (fully filled), CANCELED, or FAILED.
Get orders
Retrieve all orders for a wallet, including historical and active orders:Get positions
View all positions (shares) held by the wallet. Positions represent ownership of outcome tokens in prediction markets:Step 7: Redeem and withdraw
When a market resolves, you can redeem your winning positions for USDC.e. After redemption, you can withdraw funds to any external wallet.Redeem a position
After a market resolves, redeem your winning shares for USDC.e. You need thecondition_id from your position:
Withdraw funds
Withdraw USDC.e from your Synthesis wallet to any external Polygon address:Next steps
Polygon wallet endpoints
Explore all Polygon wallet API endpoints.
Polymarket data endpoints
Browse Polymarket data endpoints.
Real-time WebSockets
Set up real-time data streaming.
Authentication
Learn more about authentication methods.