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

# Validate a perp order (execution unavailable)

> Validates scope, request, IP/venue policy, geo restrictions, execution bounds/notional caps and account throttle. Then returns 503 signer_unavailable. No request reaches a venue; this is not a dry-run fill. Capped keys require supported bounded buy-limit variants.



## OpenAPI

````yaml https://www.oceanx.trade/api/v1/openapi.json post /api/v1/perps/orders
openapi: 3.1.0
info:
  title: OceanX Developer API
  version: 1.0.0
  description: >-
    OceanX Developer API v1 (beta). Covers every public route and method: market
    data, charts, token/risk facts, wallet analytics, tracker, copy reads,
    alerts, owned account wallet/funding reads, spot quotes and perps. Scope and
    availability are operation-specific. Spot execution, copy execution, account
    withdrawals, developer webhooks and prediction trading are not public v1
    capabilities. Perps order submission and collateral rebalance remain
    unavailable; their error contracts are explicit. Documentation:
    https://docs.oceanx.trade/api/overview.
  contact:
    url: https://docs.oceanx.trade
  termsOfService: https://www.oceanx.trade/legal/terms
  license:
    name: Proprietary
    url: https://www.oceanx.trade/legal/terms
servers:
  - url: https://www.oceanx.trade
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Perps
    description: Cross-venue market data and explicit account-wallet execution limitations.
  - name: Router
    description: >-
      Read-only Raptor route quotes and public Solana transaction status. Build
      and execution remain separately gated.
  - name: Market Data
    description: Read-only OceanX market context sourced and cached by VM producers.
  - name: Spot
    description: >-
      Executable Solana swap quotes off OceanX's own router, and the exit
      checker that reports whether a whole position can be sold.
  - name: Callouts
    description: >-
      Public token callouts — user-posted token calls with live click/volume
      attribution stats. Read-only.
  - name: Copy Trading
    description: Key-owner follow, fill and PnL reads; no execution authority.
  - name: Price Alerts
    description: Key-owner alert management through the existing evaluator; no webhooks.
paths:
  /api/v1/perps/orders:
    post:
      tags:
        - Perps
      summary: Validate a perp order (execution unavailable)
      description: >-
        Validates scope, request, IP/venue policy, geo restrictions, execution
        bounds/notional caps and account throttle. Then returns 503
        signer_unavailable. No request reaches a venue; this is not a dry-run
        fill. Capped keys require supported bounded buy-limit variants.
      operationId: createPerpsOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PerpsOrderRequest'
      responses:
        '400':
          description: Failed validation before reaching the engine.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, malformed or revoked API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            The key is valid but lacks the required scope
            (`insufficient_scope`), or its account no longer has product access
            (`product_access_revoked`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limited. Honour `Retry-After`.
          headers:
            X-RateLimit-Limit:
              schema:
                type: integer
              description: Requests allowed per window.
            X-RateLimit-Remaining:
              schema:
                type: integer
              description: Requests left.
            X-RateLimit-Reset:
              schema:
                type: integer
              description: Unix seconds when the window resets.
            Retry-After:
              schema:
                type: integer
              description: Seconds to wait.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '451':
          description: 'perps_restricted_region: venue unavailable in caller region.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            signer_unavailable: account-wallet venue signing unavailable, or
            admission dependency unavailable. No order submitted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    PerpsOrderRequest:
      type: object
      required:
        - venue
        - venueSymbol
        - side
        - orderType
        - size
      properties:
        venue:
          type: string
          enum:
            - hl
            - pacifica
            - lighter
            - aster
            - dydx
            - gmx
            - ostium
        venueSymbol:
          type: string
          minLength: 1
          maxLength: 64
        side:
          type: string
          enum:
            - buy
            - sell
        orderType:
          type: string
          enum:
            - market
            - limit
            - stop_market
            - stop_limit
            - take_market
            - take_limit
            - trailing_stop
        size:
          type: number
          exclusiveMinimum: 0
          maximum: 1000000000000
        limitPx:
          type: number
          exclusiveMinimum: 0
          maximum: 1000000000000
        triggerPx:
          type: number
          exclusiveMinimum: 0
          maximum: 1000000000000
        trailPct:
          type: number
          exclusiveMinimum: 0
          maximum: 100
        leverage:
          anyOf:
            - type: number
              exclusiveMinimum: 0
              maximum: 1000
            - type: string
              pattern: ^\d+(\.\d+)?$
              description: Positive decimal string.
        marginMode:
          type: string
          enum:
            - cross
            - isolated
        tif:
          type: string
          minLength: 1
          maxLength: 16
        reduceOnly:
          type: boolean
        postOnly:
          type: boolean
        clientOrderId:
          type: string
          minLength: 1
          maxLength: 128
        notionalCapUsd:
          type: number
          exclusiveMinimum: 0
          maximum: 1000000000000
        holdHintHours:
          type: number
          minimum: 0
          maximum: 8760
        slippageBps:
          type: integer
          minimum: 1
          maximum: 10000
        perpLeg:
          type: object
          additionalProperties: false
          description: Only an empty object is accepted; execution overrides are rejected.
      allOf:
        - if:
            properties:
              orderType:
                enum:
                  - limit
                  - stop_limit
                  - take_limit
          then:
            required:
              - limitPx
        - if:
            properties:
              orderType:
                enum:
                  - stop_market
                  - take_market
          then:
            required:
              - triggerPx
        - if:
            properties:
              orderType:
                const: trailing_stop
          then:
            required:
              - trailPct
    Error:
      type: object
      required:
        - error
      properties:
        requestId:
          type: string
          description: Request identifier on new token endpoints.
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: Stable machine-readable code. Branch on this, not the message.
              example: no_route
            message:
              type: string
              description: Human-readable detail. May change.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An OceanX API key, created in the app under Settings → Developer API.
        Send it as `Authorization: Bearer ox_live_…`. Required scopes are
        operation-specific: market reads use md.read, tracker uses tracker.read,
        copy reads use copy.read, alert operations use alerts.read or
        alerts.write, and owned wallet/funding reads require explicit
        account.read. New scopes require explicit selection and grant no trading
        authority. Existing perps operations retain their documented scopes.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.