{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/predictasiax-com/json-schema/predictasiax-com-order-intent-schema.json",
  "title": "OrderIntent",
  "x-generated": "2026-11-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/predictasiax-com-openapi.yml#/components/schemas/OrderIntent",
  "type": "object",
  "required": [
    "user_id",
    "market_id",
    "side",
    "price",
    "size",
    "client_order_id",
    "execution_builder_id",
    "app_id",
    "attribution_version"
  ],
  "properties": {
    "user_id": {
      "$ref": "#/$defs/Id"
    },
    "subaccount_id": {
      "$ref": "#/$defs/Id"
    },
    "market_id": {
      "$ref": "#/$defs/URN"
    },
    "side": {
      "type": "string",
      "enum": [
        "yes",
        "no",
        "buy",
        "sell"
      ],
      "description": "Trade side. `yes`/`no` picks the outcome; `buy`/`sell` picks the action against the current outcome. Both forms accepted for backward compatibility (see apps/api/src/index.ts validate)."
    },
    "price": {
      "$ref": "#/$defs/Money"
    },
    "size": {
      "$ref": "#/$defs/Money"
    },
    "client_order_id": {
      "type": "string"
    },
    "execution_builder_id": {
      "$ref": "#/$defs/Id"
    },
    "app_id": {
      "$ref": "#/$defs/Id"
    },
    "campaign_id": {
      "type": "string"
    },
    "attribution_version": {
      "type": "integer",
      "minimum": 1
    },
    "builder_fee_bps": {
      "type": "integer",
      "minimum": 0,
      "maximum": 10000
    },
    "expires_at_ms": {
      "type": "integer"
    }
  },
  "$defs": {
    "Id": {
      "type": "string",
      "pattern": "^[a-z]{2,4}_[0-9a-zA-Z]{12}$"
    },
    "Money": {
      "type": "string",
      "description": "Decimal string with up to 6 fractional digits"
    },
    "URN": {
      "type": "string",
      "pattern": "^pax:[a-z]+:[a-z0-9][a-z0-9:-]*$"
    }
  }
}