Skip to main content

Base URL

https://api.pmx.trade/v2

Authentication

All requests require an API key in the X-API-Key header.

Endpoints

Markets

MethodEndpointDescription
GET/marketsList all markets
GET/markets/searchSearch by keyword
GET/markets/:slugGet market details
POST/marketsCreate new market

Trading

MethodEndpointDescription
POST/markets/:slug/trade/buyBuy shares
POST/markets/:slug/trade/sellSell shares

Claims

MethodEndpointDescription
GET/markets/:slug/claimGet claim info
POST/markets/:slug/claimExecute claim

X.402 Payment Flow

Write operations (create, buy) use the X.402 protocol:
1

Request

Submit operation details
2

402 Response

Receive payment instructions with recipient address and amount
3

Pay

Execute USDC transfer on Solana
4

Confirm

Resubmit with transaction signature

HTTP Status Codes

CodeDescription
200Success
201Created
400Invalid request
401Unauthorized
402Payment required
404Not found
429Rate limited
500Server error

Error Format

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid market slug"
  }
}