> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobula.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit Order

> Submit a signed prediction market order to the Polymarket CLOB for matching.

<Warning>**Alpha** — This endpoint is part of the Prediction Markets API, currently in early access. May change without notice.</Warning>

### Request Body

<ParamField body="order" type="object" required>
  The order object — re-use the `data.typedData.message` returned by [`/api/2/pm/order/build`](/endpoint/pm-order-build) verbatim. CLOB recomputes the EIP-712 hash from the same fields you signed, so altering any of them invalidates the signature.

  <Expandable title="Order Object (CLOB V2)">
    <ParamField body="salt" type="string" required>Random salt (decimal uint256 string).</ParamField>
    <ParamField body="maker" type="string" required>Maker address — the Safe.</ParamField>
    <ParamField body="signer" type="string" required>EOA owner of the Safe.</ParamField>
    <ParamField body="taker" type="string">Taker address. `0x0000…0000` (or omit) for a public order.</ParamField>
    <ParamField body="tokenId" type="string" required>Outcome token ID (uint256 decimal).</ParamField>
    <ParamField body="makerAmount" type="string" required>Maker leg amount (6-decimal fixed-point string).</ParamField>
    <ParamField body="takerAmount" type="string" required>Taker leg amount (6-decimal fixed-point string).</ParamField>
    <ParamField body="side" type="string | number" required>`0` / `"BUY"` for BUY, `1` / `"SELL"` for SELL.</ParamField>
    <ParamField body="signatureType" type="string | number" required>Signature scheme: `0` EOA, `1` PolyProxy, `2` PolyGnosisSafe (Mobula default).</ParamField>
    <ParamField body="timestamp" type="string" required>**V2 only** — Unix-ms string captured by `/order/build`. Must round-trip exactly or the hash diverges.</ParamField>
    <ParamField body="metadata" type="string" required>**V2 only** — bytes32 hex (default `0x000…000`).</ParamField>
    <ParamField body="builder" type="string" required>**V2 only** — bytes32 hex (default `0x000…000`).</ParamField>
    <ParamField body="expiration" type="string">Wire-only Unix-seconds string. `"0"` = no expiration. **Not** part of the signed struct.</ParamField>
  </Expandable>
</ParamField>

<ParamField body="signature" type="string" required>
  The EIP-712 signature of the order.
</ParamField>

<ParamField body="apiKey" type="string" required>
  CLOB API key (obtained from Auth Derive).
</ParamField>

<ParamField body="apiSecret" type="string" required>
  CLOB API secret (obtained from Auth Derive).
</ParamField>

<ParamField body="apiPassphrase" type="string" required>
  CLOB API passphrase (obtained from Auth Derive).
</ParamField>

<ParamField body="owner" type="string">
  Order owner address. Defaults to maker if not provided.
</ParamField>

<ParamField body="orderType" type="string" default="GTC">
  Order type: `GTC` (Good Til Cancelled), `GTD` (Good Til Date), or `FOK` (Fill Or Kill).
</ParamField>

### Response

<ResponseField name="data" type="object">
  CLOB order response.

  <Expandable title="Order Response">
    <ResponseField name="success" type="boolean">Whether the order was successfully submitted.</ResponseField>
    <ResponseField name="orderId" type="string">The CLOB order ID.</ResponseField>
    <ResponseField name="status" type="string">Order status: `live`, `matched`, or `delayed`.</ResponseField>
    <ResponseField name="transactionsHashes" type="string[]">On-chain transaction hashes (if order was matched immediately).</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="hostname" type="string">Server node identifier.</ResponseField>
<ResponseField name="took" type="number">Request processing time in milliseconds.</ResponseField>

### Usage Example

```bash theme={null}
curl -X POST "https://api.mobula.io/api/2/pm/order/submit" \
  -H "Content-Type: application/json" \
  -d '{
    "order": {
      "salt": "123456789",
      "maker": "0xYourSafeAddress",
      "signer": "0xYourWalletAddress",
      "taker": "0x0000000000000000000000000000000000000000",
      "tokenId": "71321...",
      "makerAmount": "35000000",
      "takerAmount": "100000000",
      "expiration": "0",
      "nonce": "0",
      "feeRateBps": "0",
      "side": "0",
      "signatureType": "0"
    },
    "signature": "0xabc123...",
    "apiKey": "your-clob-api-key",
    "apiSecret": "your-clob-api-secret",
    "apiPassphrase": "your-clob-passphrase",
    "orderType": "GTC"
  }'
```

### Complete Trading Flow

```typescript theme={null}
// Prerequisites: account deployed, tokens approved, CLOB credentials obtained

// 1. Build order
const buildRes = await fetch('https://api.mobula.io/api/2/pm/order/build', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    maker: walletAddress,
    tokenId: outcomeTokenId,
    side: 'BUY',
    price: 0.35,
    size: 100
  })
});
const { data: { typedData } } = await buildRes.json();

// 2. Sign the order
const signature = await walletClient.signTypedData(typedData);

// 3. Submit the order
const submitRes = await fetch('https://api.mobula.io/api/2/pm/order/submit', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    order: typedData.message,
    signature,
    apiKey: clobCredentials.apiKey,
    apiSecret: clobCredentials.apiSecret,
    apiPassphrase: clobCredentials.apiPassphrase,
    orderType: 'GTC'
  })
});
const result = await submitRes.json();
```


## OpenAPI

````yaml POST /2/pm/order/submit
openapi: 3.0.0
info:
  version: 1.0.0
  title: Mobula API
  description: >-
    Documentation of the Mobula API


    **Demo API**: The default server (demo-api.mobula.io) is a demo API with
    rate limits.

    For production use, please use api.mobula.io with an API key from
    https://admin.mobula.io
servers:
  - url: https://demo-api.mobula.io/api/
    description: Demo API (rate limited, for testing only)
  - url: https://api.mobula.io/api/
    description: Production API (requires API key)
security: []
tags:
  - name: V2 - Token
    description: Token details, price, security, ATH, and holder data
  - name: V2 - Market Data
    description: Market details, OHLCV history, and lighthouse metrics
  - name: V2 - Trades
    description: Token trades, enriched trades, and trade filters
  - name: V2 - Wallet
    description: Wallet positions, activity, trades, analysis, and labels
  - name: V2 - Assets
    description: Cross-chain asset details and price history
  - name: V2 - Swap
    description: Swap quoting and execution
  - name: V2 - Perps
    description: Perpetual futures quoting, execution, and positions
  - name: V2 - Bridge
    description: Cross-chain bridge quoting and intent status (Alpha Preview)
  - name: V2 - DeFi
    description: Bonding pools and pulse data
  - name: V2 - Search
    description: Universal fast search
  - name: V2 - Blockchains
    description: System metadata and chain listings
  - name: V1 - Market Data
    description: Market prices, history, sparklines, pairs, and multi-data
  - name: V1 - Wallet
    description: Wallet portfolio, transactions, history, and NFTs
  - name: V1 - Token
    description: First buyers
  - name: V1 - Trades
    description: Market trades by pair
  - name: V1 - Metadata
    description: Token metadata, categories, trendings, and news
  - name: V1 - Assets
    description: List all assets
  - name: V1 - Search
    description: Search for assets, tokens, and pairs
  - name: V1 - DeFi
    description: Bonding pool pulse data
  - name: V1 - Blockchains
    description: Blockchain listings, pairs, and stats
  - name: V1 - Webhooks
    description: Webhook management
  - name: V1 - Feed
    description: Custom feed creation
paths:
  /2/pm/order/submit:
    post:
      tags:
        - V2 - Prediction Markets
      summary: Submit a signed V2 order to the CLOB
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                order:
                  type: object
                  properties:
                    salt:
                      type: string
                    maker:
                      type: string
                    signer:
                      type: string
                    taker:
                      type: string
                    tokenId:
                      type: string
                    makerAmount:
                      type: string
                    takerAmount:
                      type: string
                    side:
                      anyOf:
                        - type: string
                        - type: number
                    signatureType:
                      anyOf:
                        - type: string
                        - type: number
                    timestamp:
                      type: string
                      minLength: 1
                    expiration:
                      type: string
                      default: '0'
                    metadata:
                      type: string
                      minLength: 1
                    builder:
                      type: string
                      minLength: 1
                  required:
                    - salt
                    - maker
                    - signer
                    - tokenId
                    - makerAmount
                    - takerAmount
                    - side
                    - signatureType
                    - timestamp
                    - metadata
                    - builder
                signature:
                  type: string
                  minLength: 1
                owner:
                  type: string
                orderType:
                  type: string
                  enum:
                    - GTC
                    - GTD
                    - FOK
                    - FAK
                  default: GTC
                apiKey:
                  type: string
                  minLength: 1
                apiSecret:
                  type: string
                  minLength: 1
                apiPassphrase:
                  type: string
                  minLength: 1
              required:
                - order
                - signature
                - apiKey
                - apiSecret
                - apiPassphrase
      responses:
        '201':
          description: Prediction Markets response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    nullable: true
                    description: >-
                      See the per-endpoint reference for the exact response
                      shape.
                  hostname:
                    type: string
                  took:
                    type: number
                required:
                  - hostname
                  - took

````