{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cspriceapi-com/json-schema/cspriceapi-com-youpin-float-buyorder-response-schema.json",
  "title": "YoupinFloatBuyorderResponse",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cspriceapi-com-buyorder-prices-api-openapi.yml#/components/schemas/YoupinFloatBuyorderResponse",
  "allOf": [
    {
      "$ref": "#/$defs/BaseWrapper"
    },
    {
      "type": "object",
      "properties": {
        "data": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/YoupinFloatBuyorderItem"
          }
        },
        "meta": {
          "type": "object",
          "properties": {
            "count": {
              "type": "integer"
            },
            "orders": {
              "type": "integer",
              "description": "Order entries returned in total (after merging and limit)."
            },
            "max_orders_per_item": {
              "type": [
                "integer",
                "null"
              ],
              "description": "The limit applied",
              "or": "null for all orders."
            },
            "currency": {
              "type": "string",
              "enum": [
                "CNY"
              ]
            },
            "filters": {
              "type": "object",
              "additionalProperties": true
            },
            "updated_at": {
              "type": [
                "string",
                "null"
              ],
              "format": "date-time",
              "description": "Most recent scan among the returned skins."
            }
          },
          "required": [
            "count",
            "orders",
            "max_orders_per_item",
            "currency"
          ]
        },
        "source": {
          "type": "string",
          "enum": [
            "YouPin"
          ]
        }
      },
      "required": [
        "data",
        "meta"
      ]
    }
  ],
  "$defs": {
    "BaseWrapper": {
      "type": "object",
      "description": "Envelope fields returned by every `GET /v1/prices/*` response.",
      "properties": {
        "source": {
          "type": "string",
          "description": "Human-readable marketplace identifier."
        },
        "requestor": {
          "type": "string",
          "format": "email",
          "description": "Email address associated with the API key making the call."
        },
        "plan": {
          "type": "string",
          "description": "Plan of the API key (e.g. `free`, `pro`, `enterprise`)."
        },
        "timestamp": {
          "allOf": [
            {
              "$ref": "#/$defs/UpdatedAt"
            }
          ],
          "description": "Server time when this response was produced."
        }
      },
      "required": [
        "source",
        "timestamp"
      ]
    },
    "DecimalString": {
      "type": "string",
      "description": "Fixed-point decimal value serialized as a string (preserves precision\nacross languages). Parse with an arbitrary-precision decimal library;\ndo **not** parse as a native float.\n",
      "pattern": "^-?\\d+(\\.\\d+)?$"
    },
    "UpdatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "ISO-8601 UTC timestamp (millisecond precision)."
    },
    "YoupinFloatBuyorderItem": {
      "type": "object",
      "description": "All matching YouPin buy orders for one skin.",
      "properties": {
        "template_id": {
          "type": "integer"
        },
        "market_hash_name": {
          "type": "string"
        },
        "best_price_rmb": {
          "allOf": [
            {
              "$ref": "#/$defs/DecimalString"
            }
          ],
          "nullable": true,
          "description": "Highest matching buy order (CNY); null when no order matches."
        },
        "best_quantity": {
          "type": "integer",
          "description": "Items wanted at the best price."
        },
        "total_quantity": {
          "type": "integer",
          "description": "Items wanted by all matching orders."
        },
        "order_count": {
          "type": "integer",
          "description": "Matching orders (before limit)."
        },
        "orders_on_youpin": {
          "type": [
            "integer",
            "null"
          ],
          "description": "All orders for this skin at the last scan."
        },
        "truncated": {
          "type": "boolean",
          "description": "The order list hit the scan limit and may be incomplete."
        },
        "scraped_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "orders": {
          "type": "array",
          "maxItems": 500,
          "items": {
            "$ref": "#/$defs/YoupinFloatBuyorderOrder"
          }
        }
      },
      "required": [
        "template_id",
        "market_hash_name",
        "best_price_rmb",
        "order_count",
        "orders"
      ]
    },
    "YoupinFloatBuyorderOrder": {
      "type": "object",
      "description": "One open YouPin buy order (or several identical ones merged) and the condition an item must meet to fill it.",
      "properties": {
        "price_rmb": {
          "allOf": [
            {
              "$ref": "#/$defs/DecimalString"
            }
          ]
        },
        "quantity": {
          "type": "integer",
          "description": "Items still wanted (summed over merged orders)."
        },
        "orders": {
          "type": "integer",
          "description": "How many identical buy orders (same price and condition) this entry merges."
        },
        "float_range": {
          "type": "string",
          "description": "Accepted float range, or \"any\"."
        },
        "min_float": {
          "type": "number"
        },
        "max_float": {
          "type": "number"
        },
        "kind": {
          "type": "string",
          "enum": [
            "doppler_phase",
            "fade",
            "case_hardened_tier"
          ],
          "description": "Extra condition of the order; absent for plain float-range orders."
        },
        "phase": {
          "type": "string",
          "description": "Only for kind doppler_phase."
        },
        "tier": {
          "type": "string",
          "description": "Only for kind case_hardened_tier."
        },
        "fade_range": {
          "type": "string",
          "description": "Only for kind fade."
        },
        "min_fade": {
          "type": [
            "number",
            "null"
          ]
        },
        "max_fade": {
          "type": [
            "number",
            "null"
          ]
        },
        "auto_accept": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "At least one of the merged orders accepts sales automatically."
        },
        "first_seen": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When we first saw this order (earliest of the merged ones)."
        },
        "updated_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "required": [
        "price_rmb",
        "quantity",
        "orders",
        "float_range",
        "min_float",
        "max_float"
      ]
    }
  }
}