{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bitnob/json-schema/bitnob-trading-submit-order-request-schema.json",
  "title": "TradingSubmitOrderRequest",
  "x-generated": "2026-11-16",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bitnob-openapi.json#/components/schemas/TradingSubmitOrderRequest",
  "properties": {
    "base_currency": {
      "description": "Base currency of the pair, for example BTC.",
      "maxLength": 10,
      "pattern": "^[A-Za-z]+$",
      "type": "string"
    },
    "price": {
      "description": "Optional positive plain decimal price, quote currency per unit of base. Ignored for NGN pairs.",
      "pattern": "^[-+]?[0-9]+(\\.[0-9]+)?$",
      "type": "string"
    },
    "quantity": {
      "description": "Positive plain decimal amount of the base currency (no exponent, and digits on both sides of the point), in major units unless quantity_in_base_units is true. Zero and negative values pass the field check and are left to the service behind it to refuse.",
      "pattern": "^[-+]?[0-9]+(\\.[0-9]+)?$",
      "type": "string"
    },
    "quantity_in_base_units": {
      "default": false,
      "description": "When true, quantity is in the base currency's smallest unit (for example satoshis)",
      "type": "boolean"
    },
    "quote_currency": {
      "description": "Quote currency of the pair, for example NGN.",
      "maxLength": 10,
      "pattern": "^[A-Za-z]+$",
      "type": "string"
    },
    "quote_id": {
      "description": "Quote from POST /api/trading/quotes to fill against",
      "maxLength": 100,
      "pattern": "^[^<>]*$",
      "type": "string"
    },
    "reference": {
      "description": "Your reference. Required for NGN pairs when quote_id is omitted, where it is the idempotency key.",
      "maxLength": 100,
      "pattern": "^[^<>]*$",
      "type": "string"
    },
    "side": {
      "description": "Relative to the base currency. Upper-cased before validation, so any letter case is accepted.",
      "enum": [
        "BUY",
        "SELL",
        "buy",
        "sell"
      ],
      "type": "string"
    }
  },
  "required": [
    "base_currency",
    "quote_currency",
    "side",
    "quantity"
  ],
  "type": "object"
}