{
  "openapi": "3.0.3",
  "info": {
    "title": "Orbitum CEX Partner API (STUB)",
    "version": "0.0.0-stub",
    "description": "Placeholder OpenAPI document. Replaced later by the exported spec from the orbitum-be @nestjs/swagger app. See openapi/README.md."
  },
  "servers": [
    { "url": "https://sandbox.api.orbitum.io/api/v1/cex", "description": "Sandbox" },
    { "url": "https://api.orbitum.io/api/v1/cex", "description": "Production" }
  ],
  "tags": [{ "name": "orders", "description": "Order placement and lifecycle" }],
  "paths": {
    "/orders": {
      "post": {
        "tags": ["orders"],
        "summary": "Place an order (SUBSCRIBE or REDEEM)",
        "operationId": "placeOrder",
        "responses": {
          "200": {
            "description": "Order accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "requestId": { "type": "string", "example": "req_8f3c1a" },
                    "data": {
                      "type": "object",
                      "properties": {
                        "usdtNotional": { "type": "string", "example": "10000.00" }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Problem (RFC 9457)",
            "content": {
              "application/problem+json": {
                "schema": { "$ref": "#/components/schemas/Problem" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 application/problem+json body (exactly these fields).",
        "properties": {
          "type": { "type": "string", "example": "https://api.orbitum.io/problems/CEX_NO_STOCK" },
          "title": { "type": "string", "example": "Insufficient ORBIS stock to reserve" },
          "status": { "type": "integer", "example": 400 },
          "code": { "type": "string", "example": "CEX_NO_STOCK" },
          "detail": { "type": "string", "example": "No ORBIS available on the CEX stock Safe" },
          "instance": { "type": "string", "example": "/api/v1/cex/orders" },
          "requestId": { "type": "string", "example": "req_8f3c1a" }
        }
      }
    }
  }
}
