Skip to main content
POST
/
v1
/
pm
/
events
/
{eventId}
/
markets
/
{marketId}
/
orders
Place order
curl --request POST \
  --url https://relay.bayse.markets/v1/pm/events/{eventId}/markets/{marketId}/orders \
  --header 'Content-Type: application/json' \
  --data '
{
  "side": "<string>",
  "outcomeId": "<string>",
  "amount": 123,
  "type": "<string>",
  "currency": "<string>",
  "price": 123,
  "timeInForce": "<string>",
  "postOnly": true,
  "maxSlippage": 123,
  "expiresAt": "<string>"
}
'
{
  "engine": "AMM",
  "order": {
    "id": "e5f6a7b8-c9d0-1234-efab-567890123456",
    "outcome": "YES",
    "side": "BUY",
    "type": "MARKET",
    "status": "filled",
    "amount": 100,
    "price": 0.7235,
    "quantity": 138.21,
    "currency": "USD",
    "createdAt": "2026-02-17T12:00:00Z",
    "updatedAt": "2026-02-17T12:00:00Z"
  }
}

Authentication

Write authentication required — X-Public-Key, X-Timestamp, and X-Signature headers. See the Authentication guide.

Path parameters

eventId
string
required
UUID of the event.
marketId
string
required
UUID of the market.

Request body

side
string
required
BUY or SELL.
outcomeId
string
required
UUID of the outcome. Use the Get Event endpoint to find outcome IDs.
amount
number
required
Amount to spend (buy) or receive (sell), in the specified currency. Minimum: $1.00 USD / ₦100.00 NGN.
type
string
required
LIMIT or MARKET.
currency
string
USD (default) or NGN.
price
number
Limit price per share (0.01–0.99). Required for LIMIT orders.
timeInForce
string
GTC (good-til-cancelled, default for limit), GTD (good-til-date), FAK (fill-and-kill, default for market), or FOK (fill-or-kill).
postOnly
boolean
If true, the order is rejected instead of crossing the spread. Limit orders only. Default: false.
maxSlippage
number
Maximum acceptable slippage for market orders (0.00–1.00).
expiresAt
string
ISO 8601 expiration timestamp. Required for GTD orders.

Example request

PUBLIC_KEY="pk_live_abcdef123456"
SECRET_KEY="sk_live_secret789xyz"
TIMESTAMP=$(date +%s)
METHOD="POST"
URL_PATH="/v1/pm/events/a1b2c3d4-e5f6-7890-abcd-ef1234567890/markets/b2c3d4e5-f6a7-8901-bcde-f12345678901/orders"
BODY='{"side":"BUY","outcomeId":"c3d4e5f6-a7b8-9012-cdef-345678901234","amount":100,"type":"MARKET","currency":"USD"}'

BODY_HASH=$(printf '%s' "$BODY" | openssl dgst -sha256 -hex 2>/dev/null | sed 's/.*= //')
PAYLOAD="${TIMESTAMP}.${METHOD}.${URL_PATH}.${BODY_HASH}"
SIGNATURE=$(printf '%s' "$PAYLOAD" | openssl dgst -sha256 -hmac "$SECRET_KEY" -binary | base64)

curl -X POST "https://relay.bayse.markets${URL_PATH}" \
  -H "X-Public-Key: ${PUBLIC_KEY}" \
  -H "X-Timestamp: ${TIMESTAMP}" \
  -H "X-Signature: ${SIGNATURE}" \
  -H "Content-Type: application/json" \
  -d "$BODY"

Response

The response contains an engine field indicating the market type, and an order object with the order details.
engine
string
AMM or CLOB.
order
object
The placed order. Fields vary by engine type.
{
  "engine": "AMM",
  "order": {
    "id": "e5f6a7b8-c9d0-1234-efab-567890123456",
    "outcome": "YES",
    "side": "BUY",
    "type": "MARKET",
    "status": "filled",
    "amount": 100,
    "price": 0.7235,
    "quantity": 138.21,
    "currency": "USD",
    "createdAt": "2026-02-17T12:00:00Z",
    "updatedAt": "2026-02-17T12:00:00Z"
  }
}