Place Order
curl --request POST \
--url https://api-v2.swaps.xyz/api/workflows/polymarket/placeOrder \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"evmEoa": "0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f",
"orderRequest": {
"side": "BUY",
"tokenID": "90234889617199443673709150877675264662915727532354468551650133547723659310093",
"orderType": "FOK",
"tickSize": "0.01",
"negRisk": true,
"amount": 5,
"slippage": 100
},
"expiration": 1735689600,
"signatureByEvmEoa": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890001b"
}
'import requests
url = "https://api-v2.swaps.xyz/api/workflows/polymarket/placeOrder"
payload = {
"evmEoa": "0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f",
"orderRequest": {
"side": "BUY",
"tokenID": "90234889617199443673709150877675264662915727532354468551650133547723659310093",
"orderType": "FOK",
"tickSize": "0.01",
"negRisk": True,
"amount": 5,
"slippage": 100
},
"expiration": 1735689600,
"signatureByEvmEoa": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890001b"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
evmEoa: '0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f',
orderRequest: {
side: 'BUY',
tokenID: '90234889617199443673709150877675264662915727532354468551650133547723659310093',
orderType: 'FOK',
tickSize: '0.01',
negRisk: true,
amount: 5,
slippage: 100
},
expiration: 1735689600,
signatureByEvmEoa: '0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890001b'
})
};
fetch('https://api-v2.swaps.xyz/api/workflows/polymarket/placeOrder', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-v2.swaps.xyz/api/workflows/polymarket/placeOrder",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'evmEoa' => '0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f',
'orderRequest' => [
'side' => 'BUY',
'tokenID' => '90234889617199443673709150877675264662915727532354468551650133547723659310093',
'orderType' => 'FOK',
'tickSize' => '0.01',
'negRisk' => true,
'amount' => 5,
'slippage' => 100
],
'expiration' => 1735689600,
'signatureByEvmEoa' => '0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890001b'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-v2.swaps.xyz/api/workflows/polymarket/placeOrder"
payload := strings.NewReader("{\n \"evmEoa\": \"0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f\",\n \"orderRequest\": {\n \"side\": \"BUY\",\n \"tokenID\": \"90234889617199443673709150877675264662915727532354468551650133547723659310093\",\n \"orderType\": \"FOK\",\n \"tickSize\": \"0.01\",\n \"negRisk\": true,\n \"amount\": 5,\n \"slippage\": 100\n },\n \"expiration\": 1735689600,\n \"signatureByEvmEoa\": \"0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890001b\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-v2.swaps.xyz/api/workflows/polymarket/placeOrder")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"evmEoa\": \"0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f\",\n \"orderRequest\": {\n \"side\": \"BUY\",\n \"tokenID\": \"90234889617199443673709150877675264662915727532354468551650133547723659310093\",\n \"orderType\": \"FOK\",\n \"tickSize\": \"0.01\",\n \"negRisk\": true,\n \"amount\": 5,\n \"slippage\": 100\n },\n \"expiration\": 1735689600,\n \"signatureByEvmEoa\": \"0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890001b\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.swaps.xyz/api/workflows/polymarket/placeOrder")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"evmEoa\": \"0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f\",\n \"orderRequest\": {\n \"side\": \"BUY\",\n \"tokenID\": \"90234889617199443673709150877675264662915727532354468551650133547723659310093\",\n \"orderType\": \"FOK\",\n \"tickSize\": \"0.01\",\n \"negRisk\": true,\n \"amount\": 5,\n \"slippage\": 100\n },\n \"expiration\": 1735689600,\n \"signatureByEvmEoa\": \"0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890001b\"\n}"
response = http.request(request)
puts response.read_body{
"txId": "0xa66c86a47f4f81caae5d767e2d8a5a7def1a191d24eba5bd49f8767297cfe2e5",
"orderResponse": {
"success": true,
"errorMsg": "",
"orderID": "0xb9826fe87ddf21261eceaf513977cb5ea1ae31ac173210857c879cef936dfa2b",
"transactionsHashes": [
"0x39ac6726cf2cfb7814bdb2e04aeeea1d3bde2d1ce7e357f79a404cacb6984f35"
],
"status": "matched",
"takingAmount": "8.5",
"makingAmount": "5"
}
}{
"success": false,
"error": {
"code": "<string>",
"name": "<string>",
"message": "<string>",
"title": "<string>",
"statusCode": 123,
"timestamp": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"name": "<string>",
"message": "<string>",
"title": "<string>",
"statusCode": 123,
"timestamp": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"name": "<string>",
"message": "<string>",
"title": "<string>",
"statusCode": 123,
"timestamp": "<string>",
"details": {}
}
}Workflows | Polymarket
Place Order
Places a market order (BUY or SELL) directly against the Polymarket CLOB on behalf of the user, using their pre-funded proxy wallet.
This endpoint always requires an EIP-712 signatureByEvmEoa produced by the user’s EOA — see the Polymarket Signing Guide. The endpoint submits the order synchronously and returns { txId, orderResponse } so callers can poll workflow status.
POST
/
workflows
/
polymarket
/
placeOrder
Place Order
curl --request POST \
--url https://api-v2.swaps.xyz/api/workflows/polymarket/placeOrder \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"evmEoa": "0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f",
"orderRequest": {
"side": "BUY",
"tokenID": "90234889617199443673709150877675264662915727532354468551650133547723659310093",
"orderType": "FOK",
"tickSize": "0.01",
"negRisk": true,
"amount": 5,
"slippage": 100
},
"expiration": 1735689600,
"signatureByEvmEoa": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890001b"
}
'import requests
url = "https://api-v2.swaps.xyz/api/workflows/polymarket/placeOrder"
payload = {
"evmEoa": "0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f",
"orderRequest": {
"side": "BUY",
"tokenID": "90234889617199443673709150877675264662915727532354468551650133547723659310093",
"orderType": "FOK",
"tickSize": "0.01",
"negRisk": True,
"amount": 5,
"slippage": 100
},
"expiration": 1735689600,
"signatureByEvmEoa": "0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890001b"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
evmEoa: '0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f',
orderRequest: {
side: 'BUY',
tokenID: '90234889617199443673709150877675264662915727532354468551650133547723659310093',
orderType: 'FOK',
tickSize: '0.01',
negRisk: true,
amount: 5,
slippage: 100
},
expiration: 1735689600,
signatureByEvmEoa: '0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890001b'
})
};
fetch('https://api-v2.swaps.xyz/api/workflows/polymarket/placeOrder', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-v2.swaps.xyz/api/workflows/polymarket/placeOrder",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'evmEoa' => '0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f',
'orderRequest' => [
'side' => 'BUY',
'tokenID' => '90234889617199443673709150877675264662915727532354468551650133547723659310093',
'orderType' => 'FOK',
'tickSize' => '0.01',
'negRisk' => true,
'amount' => 5,
'slippage' => 100
],
'expiration' => 1735689600,
'signatureByEvmEoa' => '0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890001b'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-v2.swaps.xyz/api/workflows/polymarket/placeOrder"
payload := strings.NewReader("{\n \"evmEoa\": \"0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f\",\n \"orderRequest\": {\n \"side\": \"BUY\",\n \"tokenID\": \"90234889617199443673709150877675264662915727532354468551650133547723659310093\",\n \"orderType\": \"FOK\",\n \"tickSize\": \"0.01\",\n \"negRisk\": true,\n \"amount\": 5,\n \"slippage\": 100\n },\n \"expiration\": 1735689600,\n \"signatureByEvmEoa\": \"0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890001b\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-v2.swaps.xyz/api/workflows/polymarket/placeOrder")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"evmEoa\": \"0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f\",\n \"orderRequest\": {\n \"side\": \"BUY\",\n \"tokenID\": \"90234889617199443673709150877675264662915727532354468551650133547723659310093\",\n \"orderType\": \"FOK\",\n \"tickSize\": \"0.01\",\n \"negRisk\": true,\n \"amount\": 5,\n \"slippage\": 100\n },\n \"expiration\": 1735689600,\n \"signatureByEvmEoa\": \"0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890001b\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.swaps.xyz/api/workflows/polymarket/placeOrder")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"evmEoa\": \"0xB9519a08267d7B259eCA6DbD8F7286B1f176A41f\",\n \"orderRequest\": {\n \"side\": \"BUY\",\n \"tokenID\": \"90234889617199443673709150877675264662915727532354468551650133547723659310093\",\n \"orderType\": \"FOK\",\n \"tickSize\": \"0.01\",\n \"negRisk\": true,\n \"amount\": 5,\n \"slippage\": 100\n },\n \"expiration\": 1735689600,\n \"signatureByEvmEoa\": \"0xabcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890001b\"\n}"
response = http.request(request)
puts response.read_body{
"txId": "0xa66c86a47f4f81caae5d767e2d8a5a7def1a191d24eba5bd49f8767297cfe2e5",
"orderResponse": {
"success": true,
"errorMsg": "",
"orderID": "0xb9826fe87ddf21261eceaf513977cb5ea1ae31ac173210857c879cef936dfa2b",
"transactionsHashes": [
"0x39ac6726cf2cfb7814bdb2e04aeeea1d3bde2d1ce7e357f79a404cacb6984f35"
],
"status": "matched",
"takingAmount": "8.5",
"makingAmount": "5"
}
}{
"success": false,
"error": {
"code": "<string>",
"name": "<string>",
"message": "<string>",
"title": "<string>",
"statusCode": 123,
"timestamp": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"name": "<string>",
"message": "<string>",
"title": "<string>",
"statusCode": 123,
"timestamp": "<string>",
"details": {}
}
}{
"success": false,
"error": {
"code": "<string>",
"name": "<string>",
"message": "<string>",
"title": "<string>",
"statusCode": 123,
"timestamp": "<string>",
"details": {}
}
}Authorizations
Limited demo key for API Reference: 5c951bc81da566bbd030ba8e20724063.
Body
application/json
User's EVM wallet address
Pattern:
^0x[a-fA-F0-9]{40}$Show child attributes
Show child attributes
Unix timestamp (seconds) when signatureByEvmEoa expires. Must be in the future and ≤ 300s ahead.
EIP-712 signature by the EOA over the PlaceOrder typed data. See the Polymarket Signing Guide.
Pattern:
^0x[a-fA-F0-9]*$Proxy wallet address (optional)
Pattern:
^0x[a-fA-F0-9]{40}$⌘I