{
  "openapi": "3.1.0",
  "info": {
    "title": "SF 开放采购 API",
    "version": "1.1.0",
    "description": "静态住宅采购、交付、续费，动态流量购买、通道用量和接入信息，以及 USD 钱包。现有同一 Key 按权限调用两类商品。HTTP 202 仅表示受理，通过轮询查单。动态暂不设固定到期时间。"
  },
  "servers": [
    {
      "url": "https://sf.vip/api/open/v1"
    }
  ],
  "paths": {
    "/catalog": {
      "get": {
        "summary": "读取商品、池、期限及地区售价",
        "description": "所需权限：catalog:read",
        "operationId": "get__catalog",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Catalog"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "权限拒绝",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "业务冲突，请查询原订单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流，请按 Retry-After 重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "等待秒数"
              }
            }
          },
          "503": {
            "description": "状态可能不确定，请先查单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/inventory": {
      "get": {
        "summary": "读取库存观测，不预留库存",
        "description": "所需权限：catalog:read",
        "operationId": "get__inventory",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "poolId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "regionId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Inventory"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "权限拒绝",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "业务冲突，请查询原订单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流，请按 Retry-After 重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "等待秒数"
              }
            }
          },
          "503": {
            "description": "状态可能不确定，请先查单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/quotes": {
      "post": {
        "summary": "创建5分钟报价",
        "description": "purchase:write；静态传地区 lines，动态仅传 poolId/planId。报价 expiresAt 为5分钟有效期，与动态流量期限无关。",
        "operationId": "post__quotes",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Quote"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "权限拒绝",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "业务冲突，请查询原订单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流，请按 Retry-After 重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "等待秒数"
              }
            }
          },
          "503": {
            "description": "状态可能不确定，请先查单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/renewal-quotes": {
      "post": {
        "summary": "创建续费报价，全部资产需合格",
        "description": "所需权限：renewal:write",
        "operationId": "post__renewal_quotes",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenewalInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/RenewalQuote"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "权限拒绝",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "业务冲突，请查询原订单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流，请按 Retry-After 重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "等待秒数"
              }
            }
          },
          "503": {
            "description": "状态可能不确定，请先查单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/orders": {
      "post": {
        "summary": "提交报价并从 USD 余额扣款",
        "description": "所需权限：purchase:write（采购）或 renewal:write（续费）",
        "operationId": "post__orders",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "原订单未付款状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        }
                      },
                      "required": [
                        "order"
                      ],
                      "additionalProperties": false
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "202": {
            "description": "已受理，尚不表示交付成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        }
                      },
                      "required": [
                        "order"
                      ],
                      "additionalProperties": false
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "权限拒绝",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "业务冲突，请查询原订单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流，请按 Retry-After 重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "等待秒数"
              }
            }
          },
          "503": {
            "description": "状态可能不确定，请先查单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "summary": "分页查询本会员 API 订单",
        "description": "所需权限：orders:read",
        "operationId": "get__orders",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000,
              "default": 1
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 20,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "list": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Order"
                          }
                        },
                        "page": {
                          "type": "integer"
                        },
                        "pageSize": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "list",
                        "page",
                        "pageSize",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "权限拒绝",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "业务冲突，请查询原订单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流，请按 Retry-After 重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "等待秒数"
              }
            }
          },
          "503": {
            "description": "状态可能不确定，请先查单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/orders/{id}": {
      "get": {
        "summary": "查询 API 订单",
        "description": "所需权限：orders:read",
        "operationId": "get__orders_id_",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        }
                      },
                      "required": [
                        "order"
                      ],
                      "additionalProperties": false
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "权限拒绝",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "业务冲突，请查询原订单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流，请按 Retry-After 重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "等待秒数"
              }
            }
          },
          "503": {
            "description": "状态可能不确定，请先查单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/orders/by-client/{clientOrderNo}": {
      "get": {
        "summary": "按客户订单号查询，适合请求超时后对账",
        "description": "所需权限：orders:read",
        "operationId": "get__orders_by_client_clientOrderNo_",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "clientOrderNo",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,79}$",
              "description": "会员维度永久唯一，同号同报价重试不重复扣款"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "order": {
                          "$ref": "#/components/schemas/Order"
                        }
                      },
                      "required": [
                        "order"
                      ],
                      "additionalProperties": false
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "权限拒绝",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "业务冲突，请查询原订单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流，请按 Retry-After 重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "等待秒数"
              }
            }
          },
          "503": {
            "description": "状态可能不确定，请先查单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/orders/{id}/delivery": {
      "get": {
        "summary": "读取静态或动态订单交付凭据",
        "description": "所需权限：delivery:read",
        "operationId": "get__orders_id_delivery",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000,
              "default": 1
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "list": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/Delivery"
                              }
                            },
                            "page": {
                              "type": "integer"
                            },
                            "pageSize": {
                              "type": "integer"
                            },
                            "total": {
                              "type": "integer"
                            }
                          },
                          "required": [
                            "list",
                            "page",
                            "pageSize",
                            "total"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "list": {
                              "type": "array",
                              "items": {
                                "$ref": "#/components/schemas/DynamicDelivery"
                              }
                            },
                            "page": {
                              "type": "integer"
                            },
                            "pageSize": {
                              "type": "integer"
                            },
                            "total": {
                              "type": "integer"
                            },
                            "productCode": {
                              "const": "dynamic-residential"
                            },
                            "deliveryType": {
                              "const": "DYNAMIC_CHANNEL"
                            }
                          },
                          "required": [
                            "list",
                            "page",
                            "pageSize",
                            "total",
                            "productCode",
                            "deliveryType"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "权限拒绝",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "业务冲突，请查询原订单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流，请按 Retry-After 重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "等待秒数"
              }
            }
          },
          "503": {
            "description": "状态可能不确定，请先查单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/assets": {
      "get": {
        "summary": "读取会员资产，不含凭据",
        "description": "所需权限：orders:read",
        "operationId": "get__assets",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000,
              "default": 1
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "list": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Asset"
                          }
                        },
                        "page": {
                          "type": "integer"
                        },
                        "pageSize": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "list",
                        "page",
                        "pageSize",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "权限拒绝",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "业务冲突，请查询原订单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流，请按 Retry-After 重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "等待秒数"
              }
            }
          },
          "503": {
            "description": "状态可能不确定，请先查单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wallet": {
      "get": {
        "summary": "查询 USD 余额",
        "description": "所需权限：wallet:read",
        "operationId": "get__wallet",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Wallet"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "权限拒绝",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "业务冲突，请查询原订单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流，请按 Retry-After 重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "等待秒数"
              }
            }
          },
          "503": {
            "description": "状态可能不确定，请先查单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/wallet/transactions": {
      "get": {
        "summary": "查询钱包流水",
        "description": "所需权限：wallet:read",
        "operationId": "get__wallet_transactions",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000,
              "default": 1
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "list": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Transaction"
                          }
                        },
                        "page": {
                          "type": "integer"
                        },
                        "pageSize": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "list",
                        "page",
                        "pageSize",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "权限拒绝",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "业务冲突，请查询原订单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流，请按 Retry-After 重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "等待秒数"
              }
            }
          },
          "503": {
            "description": "状态可能不确定，请先查单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/dynamic/channels": {
      "get": {
        "summary": "查询本会员动态通道与用量（包含网页购买）",
        "description": "orders:read；读取同步快照，不含凭据。",
        "operationId": "listDynamicChannels",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100000,
              "default": 1
            }
          },
          {
            "in": "query",
            "name": "pageSize",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "list": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/DynamicChannel"
                          }
                        },
                        "page": {
                          "type": "integer"
                        },
                        "pageSize": {
                          "type": "integer"
                        },
                        "total": {
                          "type": "integer"
                        }
                      },
                      "required": [
                        "list",
                        "page",
                        "pageSize",
                        "total"
                      ],
                      "additionalProperties": false
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "权限拒绝",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "业务冲突，请查询原订单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流，请按 Retry-After 重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "等待秒数"
              }
            }
          },
          "503": {
            "description": "状态可能不确定，请先查单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/dynamic/channels/{id}": {
      "get": {
        "summary": "读取动态通道状态和用量",
        "description": "orders:read；1 GB=1000000000 字节，按 syncedAt/syncStatus 判断快照新鲜度。",
        "operationId": "getDynamicChannel",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DynamicChannel"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "权限拒绝",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "业务冲突，请查询原订单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流，请按 Retry-After 重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "等待秒数"
              }
            }
          },
          "503": {
            "description": "状态可能不确定，请先查单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/dynamic/channels/{id}/connection": {
      "post": {
        "summary": "生成动态接入信息",
        "description": "delivery:read；不创建通道或扣款。非 ACTIVE 返回409 CHANNEL_UNAVAILABLE。历史交付接口仍可读取凭据。陈旧快照返回 warning。",
        "operationId": "generateDynamicConnection",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DynamicConnectionInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/DynamicConnectionResponse"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "required": [
                    "data",
                    "requestId"
                  ],
                  "additionalProperties": false
                }
              }
            }
          },
          "400": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "权限拒绝",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "业务冲突，请查询原订单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "请求失败",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流，请按 Retry-After 重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "等待秒数"
              }
            }
          },
          "503": {
            "description": "状态可能不确定，请先查单",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "会员 API 管理创建的 sf_live_ 密钥，仅请求头传递"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          },
          "orderId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "code",
          "message",
          "requestId"
        ],
        "additionalProperties": false
      },
      "LineInput": {
        "type": "object",
        "properties": {
          "regionId": {
            "type": "string",
            "description": "原样使用目录返回的地区 ID"
          },
          "ipSegment": {
            "type": "string",
            "default": "",
            "description": "留空随机，或 IPv4 /24 网段"
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          }
        },
        "required": [
          "regionId",
          "quantity"
        ],
        "additionalProperties": false
      },
      "QuoteInput": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/StaticQuoteInput"
          },
          {
            "$ref": "#/components/schemas/DynamicQuoteInput"
          }
        ]
      },
      "RenewalInput": {
        "type": "object",
        "properties": {
          "assetIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "minItems": 1,
            "maxItems": 1000,
            "uniqueItems": true
          }
        },
        "required": [
          "assetIds"
        ],
        "additionalProperties": false
      },
      "SubmitInput": {
        "type": "object",
        "properties": {
          "clientOrderNo": {
            "type": "string",
            "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,79}$",
            "description": "会员维度永久唯一，同号同报价重试不重复扣款"
          },
          "quoteId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "required": [
          "clientOrderNo",
          "quoteId"
        ],
        "additionalProperties": false
      },
      "Catalog": {
        "type": "object",
        "properties": {
          "currency": {
            "const": "USD"
          },
          "pools": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "planIds": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "productCode": {
                  "enum": [
                    "pure-dedicated",
                    "dynamic-residential"
                  ]
                },
                "planPrices": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "object",
                    "properties": {
                      "available": {
                        "type": "boolean"
                      },
                      "trafficUnitPrice": {
                        "type": "string",
                        "pattern": "^\\d+\\.\\d{6}$"
                      },
                      "saleTotal": {
                        "type": "string",
                        "pattern": "^\\d+\\.\\d{6}$"
                      }
                    },
                    "required": [
                      "available"
                    ],
                    "additionalProperties": false
                  }
                },
                "capabilities": {
                  "type": "object",
                  "properties": {
                    "purchase": {
                      "type": "boolean"
                    },
                    "usage": {
                      "type": "boolean"
                    },
                    "connection": {
                      "type": "boolean"
                    },
                    "renewal": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "purchase",
                    "usage",
                    "connection",
                    "renewal"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "id",
                "name",
                "description",
                "planIds"
              ],
              "additionalProperties": false
            }
          },
          "plans": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "durationDays": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "productCode": {
                  "enum": [
                    "pure-dedicated",
                    "dynamic-residential"
                  ]
                },
                "billingType": {
                  "type": "string"
                },
                "quantity": {
                  "type": "string"
                },
                "quantityUnit": {
                  "type": "string"
                },
                "expiryPolicy": {
                  "const": "NO_FIXED_EXPIRY"
                }
              },
              "required": [
                "id",
                "durationDays"
              ],
              "additionalProperties": false
            }
          },
          "regions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "poolId": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "continent": {
                  "type": "string"
                },
                "planPrices": {
                  "type": "object",
                  "additionalProperties": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "pricingError": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "id",
                "poolId",
                "name",
                "continent",
                "planPrices"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "currency",
          "pools",
          "plans",
          "regions"
        ],
        "additionalProperties": false
      },
      "Inventory": {
        "type": "object",
        "properties": {
          "poolId": {
            "type": "string"
          },
          "regionId": {
            "type": "string"
          },
          "total": {
            "type": "integer"
          },
          "segmentsKnown": {
            "type": "boolean"
          },
          "segments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ipSegment": {
                  "type": "string"
                },
                "available": {
                  "type": "integer"
                }
              },
              "required": [
                "ipSegment",
                "available"
              ],
              "additionalProperties": false
            }
          },
          "available": {
            "type": "boolean"
          },
          "observedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "poolId",
          "regionId",
          "total",
          "segmentsKnown",
          "segments",
          "available",
          "observedAt"
        ],
        "additionalProperties": false
      },
      "Quote": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/StaticQuote"
          },
          {
            "$ref": "#/components/schemas/DynamicQuote"
          }
        ]
      },
      "RenewalItem": {
        "type": "object",
        "properties": {
          "assetId": {
            "type": "string",
            "format": "uuid"
          },
          "actualOutboundIp": {
            "type": "string"
          },
          "poolName": {
            "type": "string"
          },
          "areaName": {
            "type": "string"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "durationDays": {
            "type": "integer"
          },
          "salePrice": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{6}$"
          }
        },
        "required": [
          "assetId",
          "actualOutboundIp",
          "poolName",
          "areaName",
          "expiresAt",
          "durationDays",
          "salePrice"
        ],
        "additionalProperties": false
      },
      "RenewalQuote": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "const": "RENEWAL"
          },
          "currency": {
            "const": "USD"
          },
          "poolIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RenewalItem"
            }
          },
          "saleTotal": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{6}$"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "kind",
          "currency",
          "poolIds",
          "items",
          "saleTotal",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "Order": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "clientOrderNo": {
            "type": "string"
          },
          "orderNo": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "PURCHASE",
              "RENEWAL"
            ]
          },
          "status": {
            "enum": [
              "PENDING_PAYMENT",
              "PAID",
              "OPENING",
              "DELIVERED",
              "PARTIALLY_DELIVERED",
              "FAILED_REFUNDED",
              "MANUAL_REVIEW"
            ]
          },
          "currency": {
            "const": "USD"
          },
          "poolId": {
            "type": "string"
          },
          "quantity": {
            "type": "number"
          },
          "saleTotal": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{6}$"
          },
          "refundedAmount": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{6}$"
          },
          "refundDestination": {
            "type": [
              "string",
              "null"
            ]
          },
          "deliveredQuantity": {
            "type": "integer",
            "description": "静态为交付 IP 数量；动态为交付通道数量，购买 GB 见 quantity。"
          },
          "progress": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "total": {
                "type": "integer"
              },
              "queued": {
                "type": "integer"
              },
              "processing": {
                "type": "integer"
              },
              "delivered": {
                "type": "integer"
              },
              "failed": {
                "type": "integer"
              },
              "refunded": {
                "type": "integer"
              }
            },
            "additionalProperties": true
          },
          "paidAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "deliveredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "regionId": {
                  "type": "string"
                },
                "regionName": {
                  "type": "string"
                },
                "ipSegment": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                },
                "unitPrice": {
                  "type": "string",
                  "pattern": "^\\d+\\.\\d{6}$"
                },
                "saleTotal": {
                  "type": "string",
                  "pattern": "^\\d+\\.\\d{6}$"
                }
              },
              "required": [
                "regionId",
                "regionName",
                "ipSegment",
                "quantity",
                "unitPrice",
                "saleTotal"
              ],
              "additionalProperties": false
            }
          },
          "settlements": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "deliveredQuantity": {
                  "type": "integer"
                },
                "refundedQuantity": {
                  "type": "integer"
                },
                "refundedAmount": {
                  "type": "string",
                  "pattern": "^\\d+\\.\\d{6}$"
                },
                "state": {
                  "type": "string"
                }
              },
              "required": [
                "deliveredQuantity",
                "refundedQuantity",
                "refundedAmount",
                "state"
              ],
              "additionalProperties": false
            }
          },
          "renewalItems": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "assetId": {
                  "type": "string",
                  "format": "uuid"
                },
                "state": {
                  "type": "string"
                },
                "expiresAt": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "newExpiresAt": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "format": "date-time"
                },
                "salePrice": {
                  "type": "string",
                  "pattern": "^\\d+\\.\\d{6}$"
                },
                "durationDays": {
                  "type": "integer"
                }
              },
              "required": [
                "assetId",
                "state",
                "expiresAt",
                "newExpiresAt",
                "salePrice",
                "durationDays"
              ],
              "additionalProperties": false
            }
          },
          "productCode": {
            "enum": [
              "pure-dedicated",
              "dynamic-residential"
            ]
          },
          "quantityUnit": {
            "enum": [
              "IP",
              "GB"
            ]
          },
          "billingType": {
            "type": "string"
          },
          "expiryPolicy": {
            "const": "NO_FIXED_EXPIRY"
          },
          "deliveredChannelCount": {
            "type": "integer"
          },
          "dynamicChannelId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          }
        },
        "required": [
          "id",
          "clientOrderNo",
          "status",
          "currency",
          "saleTotal",
          "refundedAmount",
          "quantity",
          "lines"
        ],
        "additionalProperties": false
      },
      "Asset": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orderId": {
            "type": "string",
            "format": "uuid"
          },
          "poolId": {
            "type": "string"
          },
          "regionId": {
            "type": "string"
          },
          "regionName": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "actualOutboundIp": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "orderId",
          "poolId",
          "regionId",
          "regionName",
          "status",
          "expiresAt",
          "actualOutboundIp"
        ],
        "additionalProperties": false
      },
      "Delivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orderId": {
            "type": "string",
            "format": "uuid"
          },
          "poolId": {
            "type": "string"
          },
          "regionId": {
            "type": "string"
          },
          "regionName": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "actualOutboundIp": {
            "type": "string"
          },
          "accessHost": {
            "type": "string"
          },
          "accessPort": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string",
            "description": "敏感凭据，请勿记录到日志"
          }
        },
        "required": [
          "id",
          "orderId",
          "poolId",
          "regionId",
          "regionName",
          "status",
          "expiresAt",
          "actualOutboundIp",
          "accessHost",
          "accessPort",
          "username",
          "password"
        ],
        "additionalProperties": false
      },
      "Wallet": {
        "type": "object",
        "properties": {
          "currency": {
            "const": "USD"
          },
          "balance": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{6}$"
          },
          "held": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{6}$"
          },
          "available": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{6}$"
          }
        },
        "required": [
          "currency",
          "balance",
          "held",
          "available"
        ],
        "additionalProperties": false
      },
      "Transaction": {
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "string",
              "number"
            ]
          },
          "orderId": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "type": {
            "type": "string"
          },
          "amount": {
            "type": "string"
          },
          "balanceAfter": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{6}$"
          },
          "currency": {
            "const": "USD"
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "orderId",
          "type",
          "amount",
          "balanceAfter",
          "currency",
          "createdAt"
        ],
        "additionalProperties": false
      },
      "StaticQuoteInput": {
        "type": "object",
        "properties": {
          "poolId": {
            "type": "string"
          },
          "planId": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LineInput"
            },
            "minItems": 1,
            "maxItems": 100
          }
        },
        "required": [
          "poolId",
          "planId",
          "lines"
        ],
        "additionalProperties": false
      },
      "DynamicQuoteInput": {
        "type": "object",
        "properties": {
          "poolId": {
            "type": "string",
            "maxLength": 100
          },
          "planId": {
            "type": "string",
            "maxLength": 100
          }
        },
        "required": [
          "poolId",
          "planId"
        ],
        "additionalProperties": false
      },
      "StaticQuote": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "enum": [
              "PURCHASE"
            ]
          },
          "poolId": {
            "type": "string"
          },
          "planId": {
            "type": "string"
          },
          "durationDays": {
            "type": "integer"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "regionId": {
                  "type": "string"
                },
                "regionName": {
                  "type": "string"
                },
                "ipSegment": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                },
                "unitPrice": {
                  "type": "string",
                  "pattern": "^\\d+\\.\\d{6}$"
                },
                "saleTotal": {
                  "type": "string",
                  "pattern": "^\\d+\\.\\d{6}$"
                }
              },
              "required": [
                "regionId",
                "regionName",
                "ipSegment",
                "quantity",
                "unitPrice",
                "saleTotal"
              ],
              "additionalProperties": false
            }
          },
          "saleTotal": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{6}$"
          },
          "currency": {
            "const": "USD"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "productCode": {
            "const": "pure-dedicated"
          }
        },
        "required": [
          "id",
          "kind",
          "poolId",
          "planId",
          "durationDays",
          "lines",
          "saleTotal",
          "currency",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "DynamicQuote": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "const": "PURCHASE"
          },
          "poolId": {
            "type": "string"
          },
          "planId": {
            "type": "string"
          },
          "productCode": {
            "const": "dynamic-residential"
          },
          "billingType": {
            "const": "traffic"
          },
          "quantity": {
            "type": "string",
            "pattern": "^\\d+(\\.\\d+)?$"
          },
          "quantityUnit": {
            "const": "GB"
          },
          "durationDays": {
            "type": "null"
          },
          "expiryPolicy": {
            "const": "NO_FIXED_EXPIRY"
          },
          "trafficUnitPrice": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{6}$"
          },
          "saleTotal": {
            "type": "string",
            "pattern": "^\\d+\\.\\d{6}$"
          },
          "currency": {
            "const": "USD"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "kind",
          "poolId",
          "planId",
          "productCode",
          "billingType",
          "quantity",
          "quantityUnit",
          "durationDays",
          "expiryPolicy",
          "trafficUnitPrice",
          "saleTotal",
          "currency",
          "expiresAt"
        ],
        "additionalProperties": false
      },
      "DynamicChannel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orderId": {
            "type": "string",
            "format": "uuid"
          },
          "poolId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "billingType": {
            "enum": [
              "traffic",
              "ip"
            ]
          },
          "usedAmount": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "limitAmount": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "todayUsedAmount": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d+$"
          },
          "remainingAmount": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expireDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "enabled": {
            "type": "boolean"
          },
          "usageStatus": {
            "enum": [
              "ACTIVE",
              "EXHAUSTED",
              "DISABLED",
              "PAUSED",
              "EXPIRED",
              "UNKNOWN"
            ]
          },
          "syncedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastSyncAttemptAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "syncStatus": {
            "enum": [
              "CURRENT",
              "STALE",
              "FAILED"
            ]
          },
          "poolName": {
            "type": "string"
          },
          "productCode": {
            "const": "dynamic-residential"
          },
          "expiryPolicy": {
            "enum": [
              "NO_FIXED_EXPIRY",
              "UPSTREAM_EXPIRY"
            ]
          },
          "usageUnit": {
            "enum": [
              "BYTE",
              "IP"
            ]
          },
          "bytesPerGB": {
            "enum": [
              "1000000000",
              null
            ]
          },
          "deliveryType": {
            "const": "DYNAMIC_CHANNEL"
          }
        },
        "required": [
          "id",
          "orderId",
          "poolId",
          "name",
          "billingType",
          "usedAmount",
          "limitAmount",
          "todayUsedAmount",
          "remainingAmount",
          "expiresAt",
          "expireDate",
          "enabled",
          "usageStatus",
          "syncedAt",
          "lastSyncAttemptAt",
          "syncStatus",
          "poolName",
          "productCode",
          "expiryPolicy",
          "usageUnit",
          "bytesPerGB",
          "deliveryType"
        ],
        "additionalProperties": false
      },
      "DynamicConnectionInput": {
        "type": "object",
        "properties": {
          "country": {
            "enum": [
              "any",
              "us",
              "jp",
              "sg",
              "gb",
              "de",
              "br",
              "nl",
              "za"
            ],
            "default": "any"
          },
          "protocol": {
            "enum": [
              "http",
              "socks5"
            ],
            "default": "socks5"
          },
          "mode": {
            "enum": [
              "rotating",
              "sticky"
            ],
            "default": "rotating"
          },
          "sessionId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9]{1,32}$",
            "description": "仅 sticky；省略则生成新编号"
          },
          "ttl": {
            "enum": [
              5,
              30,
              60,
              120
            ],
            "description": "分钟，仅 sticky；默认30"
          }
        },
        "required": [],
        "additionalProperties": false,
        "allOf": [
          {
            "if": {
              "properties": {
                "mode": {
                  "const": "rotating"
                }
              }
            },
            "then": {
              "not": {
                "anyOf": [
                  {
                    "required": [
                      "sessionId"
                    ]
                  },
                  {
                    "required": [
                      "ttl"
                    ]
                  }
                ]
              }
            }
          }
        ]
      },
      "DynamicConnection": {
        "type": "object",
        "properties": {
          "protocol": {
            "enum": [
              "http",
              "socks5"
            ]
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "proxyUrl": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "mode": {
            "enum": [
              "rotating",
              "sticky"
            ]
          },
          "sessionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "ttl": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "required": [
          "protocol",
          "host",
          "port",
          "username",
          "password",
          "proxyUrl",
          "country",
          "mode",
          "sessionId",
          "ttl"
        ],
        "additionalProperties": false
      },
      "DynamicConnectionResponse": {
        "type": "object",
        "properties": {
          "protocol": {
            "enum": [
              "http",
              "socks5"
            ]
          },
          "host": {
            "type": "string"
          },
          "port": {
            "type": "integer"
          },
          "username": {
            "type": "string"
          },
          "password": {
            "type": "string"
          },
          "proxyUrl": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "mode": {
            "enum": [
              "rotating",
              "sticky"
            ]
          },
          "sessionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "ttl": {
            "type": [
              "integer",
              "null"
            ]
          },
          "channelId": {
            "type": "string",
            "format": "uuid"
          },
          "usageStatus": {
            "type": "string"
          },
          "syncStatus": {
            "enum": [
              "CURRENT",
              "STALE",
              "FAILED"
            ]
          },
          "syncedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "warning": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "protocol",
          "host",
          "port",
          "username",
          "password",
          "proxyUrl",
          "country",
          "mode",
          "sessionId",
          "ttl",
          "channelId",
          "usageStatus",
          "syncStatus",
          "syncedAt",
          "warning"
        ],
        "additionalProperties": false
      },
      "DynamicDelivery": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "orderId": {
            "type": "string",
            "format": "uuid"
          },
          "poolId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "billingType": {
            "enum": [
              "traffic",
              "ip"
            ]
          },
          "usedAmount": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "limitAmount": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "todayUsedAmount": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^\\d+$"
          },
          "remainingAmount": {
            "type": "string",
            "pattern": "^\\d+$"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expireDate": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "enabled": {
            "type": "boolean"
          },
          "usageStatus": {
            "enum": [
              "ACTIVE",
              "EXHAUSTED",
              "DISABLED",
              "PAUSED",
              "EXPIRED",
              "UNKNOWN"
            ]
          },
          "syncedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastSyncAttemptAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "syncStatus": {
            "enum": [
              "CURRENT",
              "STALE",
              "FAILED"
            ]
          },
          "poolName": {
            "type": "string"
          },
          "productCode": {
            "const": "dynamic-residential"
          },
          "expiryPolicy": {
            "enum": [
              "NO_FIXED_EXPIRY",
              "UPSTREAM_EXPIRY"
            ]
          },
          "usageUnit": {
            "enum": [
              "BYTE",
              "IP"
            ]
          },
          "bytesPerGB": {
            "enum": [
              "1000000000",
              null
            ]
          },
          "deliveryType": {
            "const": "DYNAMIC_CHANNEL"
          },
          "connection": {
            "$ref": "#/components/schemas/DynamicConnection"
          }
        },
        "required": [
          "id",
          "orderId",
          "poolId",
          "name",
          "billingType",
          "usedAmount",
          "limitAmount",
          "todayUsedAmount",
          "remainingAmount",
          "expiresAt",
          "expireDate",
          "enabled",
          "usageStatus",
          "syncedAt",
          "lastSyncAttemptAt",
          "syncStatus",
          "poolName",
          "productCode",
          "expiryPolicy",
          "usageUnit",
          "bytesPerGB",
          "deliveryType",
          "connection"
        ],
        "additionalProperties": false
      }
    }
  }
}
