{
  "openapi": "3.1.0",
  "info": {
    "title": "Cloudsign OpenAPI",
    "version": "1.22.0-preview.1",
    "description": "通过用户开放 API 管理自己账号下已授权的企业签名和应用分发资源，完成上传、签名、发布、查询和订单处理。接入前请在开发者中心创建 API 应用并配置权限。"
  },
  "servers": [
    {
      "url": "https://{host}",
      "variables": {
        "host": {
          "default": "www.fenfa.im",
          "description": "配置的主网站域名，不是分发或存储域名"
        }
      }
    }
  ],
  "security": [
    {
      "AccessKeySignature": []
    }
  ],
  "components": {
    "securitySchemes": {
      "AccessKeySignature": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "CS1-HMAC-SHA256 Credential=AKP<40hex> 或 AKT<40hex>,Signature=<64hex>。签入 Host、路径、规范查询和 X-Api-* 字段。AKT 必须携带 X-Api-Security-Token，并在 canonical 原有结尾追加换行和 Token 的 SHA-256 摘要；AKP 不携带该头。Secret 不发送给 API。"
      }
    },
    "parameters": {
      "Date": {
        "name": "X-Api-Date",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "format": "date-time"
        },
        "description": "UTC，YYYY-MM-DDTHH:mm:ssZ，前后 300 秒窗口"
      },
      "Nonce": {
        "name": "X-Api-Nonce",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[a-f0-9]{32}$"
        }
      },
      "BodyHash": {
        "name": "X-Api-Content-Sha256",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "description": "实际请求体字节的 SHA-256；GET 为零字节摘要"
      },
      "Environment": {
        "name": "X-Api-Environment",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "const": "production"
        }
      },
      "Idempotency": {
        "name": "X-Api-Idempotency-Key",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{16,64}$"
        },
        "description": "同一次业务重试保持原值及原始请求体，更换 nonce 重新签名。有效记录保留 90 天。"
      },
      "SecurityToken": {
        "name": "X-Api-Security-Token",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string",
          "pattern": "^CST_[A-Za-z0-9_-]{43}$"
        },
        "description": "Required only for AKT credentials; append SHA256(token) to the canonical string. AKP requests must omit it."
      },
      "FinancialIdempotency": {
        "name": "X-Api-Idempotency-Key",
        "in": "header",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]{16,64}$"
        },
        "description": "财务幂等记录长期保留，不按普通 90 天缓存删除。同一 API 应用跨密钥有效；保留原幂等键及确认字段，JSON 字段顺序可变化，每次使用新 nonce 重新签名。更换幂等键不能再次支付同一报价。"
      }
    },
    "schemas": {
      "App": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "name",
          "bundle_id",
          "platform",
          "version",
          "build",
          "size_bytes",
          "module",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "name": {
            "type": "string"
          },
          "bundle_id": {
            "type": "string"
          },
          "platform": {
            "type": "string",
            "enum": [
              "ipa",
              "apk"
            ]
          },
          "version": {
            "type": "string"
          },
          "build": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          },
          "module": {
            "type": "string",
            "enum": [
              "enterprise",
              "distribution"
            ]
          },
          "updated_at": {
            "type": "integer",
            "description": "Unix 秒"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "request_id",
          "error"
        ],
        "properties": {
          "request_id": {
            "type": "string"
          },
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              }
            }
          }
        }
      },
      "Version": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "app_id",
          "bundle_id",
          "platform",
          "version",
          "build",
          "size_bytes",
          "package_type",
          "is_current",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^V[a-f0-9]{32}$"
          },
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "bundle_id": {
            "type": "string"
          },
          "platform": {
            "type": "string",
            "enum": [
              "ipa",
              "apk"
            ]
          },
          "version": {
            "type": "string"
          },
          "build": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          },
          "package_type": {
            "type": "string",
            "enum": [
              "original",
              "signed"
            ]
          },
          "is_current": {
            "type": "boolean",
            "description": "该类型安装包的当前发布标记；原包与签名包可各自为当前版本"
          },
          "created_at": {
            "type": "integer",
            "description": "Unix 秒；无法解析的旧时间为 0"
          }
        }
      },
      "Job": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "app_id",
          "status",
          "progress",
          "attempt",
          "created_at",
          "updated_at",
          "terminal",
          "error"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^J[a-f0-9]{32}$"
          },
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "preparing",
              "ready",
              "leased",
              "running",
              "verifying",
              "publishing",
              "succeeded",
              "failed",
              "cancelled",
              "superseded",
              "unknown"
            ]
          },
          "progress": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "attempt": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": "integer"
          },
          "updated_at": {
            "type": "integer"
          },
          "terminal": {
            "type": "boolean"
          },
          "error": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "code",
                  "message"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "const": "SigningFailed"
                  },
                  "message": {
                    "type": "string"
                  }
                }
              }
            ]
          }
        }
      },
      "Upload": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "app_id",
          "state",
          "size_bytes",
          "expires_at",
          "version_id",
          "error_code"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^U[a-f0-9]{32}$"
          },
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "state": {
            "type": "string",
            "enum": [
              "uploading",
              "validating",
              "succeeded",
              "failed",
              "cancelled"
            ]
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 22
          },
          "expires_at": {
            "type": "integer"
          },
          "version_id": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^V[a-f0-9]{32}$"
          },
          "error_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "transfer_mode": {
            "type": "string",
            "enum": [
              "single",
              "multipart"
            ]
          },
          "format": {
            "type": "string",
            "enum": [
              "ipa",
              "apk"
            ]
          },
          "part_size_bytes": {
            "type": "integer",
            "minimum": 0
          },
          "part_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1024
          }
        }
      },
      "UploadInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "file_name",
          "size_bytes",
          "sha256",
          "md5"
        ],
        "properties": {
          "file_name": {
            "type": "string",
            "maxLength": 160,
            "description": "IPA 文件名",
            "pattern": "^[^/\\\\:]+\\.(?:ipa|apk)$"
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 22,
            "maximum": 5368709120
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "md5": {
            "type": "string",
            "description": "16 字节 MD5 的标准 Base64"
          }
        }
      },
      "JobInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source_version_id"
        ],
        "properties": {
          "source_version_id": {
            "type": "string",
            "pattern": "^V[a-f0-9]{32}$"
          },
          "certificate_id": {
            "type": "string",
            "pattern": "^C[a-f0-9]{32}$"
          }
        }
      },
      "JobAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "app_id",
          "accepted"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^J[a-f0-9]{32}$"
          },
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "accepted": {
            "const": true,
            "type": "boolean"
          }
        }
      },
      "UploadTicket": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "upload_id",
          "ticket"
        ],
        "properties": {
          "upload_id": {
            "type": "string",
            "pattern": "^U[a-f0-9]{32}$"
          },
          "ticket": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "url",
              "method",
              "headers",
              "expires_at"
            ],
            "properties": {
              "url": {
                "type": "string",
                "format": "uri"
              },
              "method": {
                "type": "string",
                "const": "PUT"
              },
              "headers": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "expires_at": {
                "type": "integer"
              }
            }
          }
        }
      },
      "MultipartUploadInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "file_name",
          "size_bytes",
          "transfer_mode"
        ],
        "properties": {
          "file_name": {
            "type": "string",
            "maxLength": 160,
            "description": "IPA 文件名",
            "pattern": "^[^/\\\\:]+\\.(?:ipa|apk)$"
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 22,
            "maximum": 17179869184
          },
          "transfer_mode": {
            "const": "multipart",
            "type": "string"
          }
        }
      },
      "UploadPart": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "part_number",
          "size_bytes",
          "sha256",
          "uploaded"
        ],
        "properties": {
          "part_number": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1024
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 33554432
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "uploaded": {
            "type": "boolean",
            "description": "已确认暂存对象存在；最终内容校验与合并在异步 validating 阶段执行。查询 U.state=succeeded 之后才表示版本发布完成。"
          }
        }
      },
      "UploadPartInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "part_number",
          "sha256"
        ],
        "properties": {
          "part_number": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1024
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        }
      },
      "UploadParts": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_after"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UploadPart"
            }
          },
          "next_after": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[1-9][0-9]{0,3}$"
          }
        }
      },
      "UploadPartTicket": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "upload_id",
          "ticket",
          "part_number"
        ],
        "properties": {
          "upload_id": {
            "type": "string",
            "pattern": "^U[a-f0-9]{32}$"
          },
          "ticket": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "url",
              "method",
              "headers",
              "expires_at"
            ],
            "properties": {
              "url": {
                "type": "string",
                "format": "uri"
              },
              "method": {
                "type": "string",
                "enum": [
                  "PUT",
                  "POST"
                ]
              },
              "headers": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "expires_at": {
                "type": "integer"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "s3",
                  "oss",
                  "local",
                  "qiniu"
                ],
                "description": "平台生成的传输指令类型，由 SDK 自动识别；业务代码无需填写或选择。省略时沿用兼容传输指令。"
              },
              "encoding": {
                "type": "string",
                "const": "multipart"
              },
              "fields": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "key",
                  "token"
                ],
                "properties": {
                  "key": {
                    "type": "string"
                  },
                  "token": {
                    "type": "string",
                    "x-sensitive": true
                  }
                }
              }
            },
            "description": "平台返回该片的短期上传指令，由 SDK 按方法、请求头或表单字段自动传输。自行实现 HTTP 时，按返回指令发送；浏览器的 Content-Length 由浏览器根据文件字节生成。分片确认只表示暂存成功，整个安装包校验并返回版本 ID 后才可使用。"
          },
          "part_number": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1024
          }
        }
      },
      "Session": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "app_id",
          "name",
          "actions",
          "rpm",
          "created_at",
          "expires_at",
          "last_used_at",
          "state"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^AKT[a-f0-9]{40}$"
          },
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "actions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "enterprise:ReadApps",
                "enterprise:ReadVersions",
                "enterprise:ReadJobs",
                "distribution:ReadApps",
                "distribution:ReadVersions",
                "distribution:ReadSettings",
                "enterprise:ReadStatistics",
                "distribution:ReadStatistics",
                "enterprise:ReadPricing",
                "distribution:ReadPricing",
                "enterprise:ReadVersionStatistics"
              ]
            }
          },
          "rpm": {
            "type": "integer",
            "minimum": 1,
            "maximum": 60
          },
          "created_at": {
            "type": "integer"
          },
          "expires_at": {
            "type": "integer"
          },
          "last_used_at": {
            "type": "integer"
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          }
        }
      },
      "SessionIssued": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "app_id",
          "name",
          "actions",
          "rpm",
          "created_at",
          "expires_at",
          "last_used_at",
          "state",
          "credentials"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^AKT[a-f0-9]{40}$"
          },
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "name": {
            "type": "string",
            "maxLength": 80
          },
          "actions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "enterprise:ReadApps",
                "enterprise:ReadVersions",
                "enterprise:ReadJobs",
                "distribution:ReadApps",
                "distribution:ReadVersions",
                "distribution:ReadSettings",
                "enterprise:ReadStatistics",
                "distribution:ReadStatistics",
                "enterprise:ReadPricing",
                "distribution:ReadPricing",
                "enterprise:ReadVersionStatistics"
              ]
            }
          },
          "rpm": {
            "type": "integer",
            "minimum": 1,
            "maximum": 60
          },
          "created_at": {
            "type": "integer"
          },
          "expires_at": {
            "type": "integer"
          },
          "last_used_at": {
            "type": "integer"
          },
          "state": {
            "type": "string",
            "enum": [
              "active",
              "expired",
              "revoked"
            ]
          },
          "credentials": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "access_key_id",
                  "access_key_secret",
                  "security_token"
                ],
                "properties": {
                  "access_key_id": {
                    "type": "string",
                    "pattern": "^AKT[a-f0-9]{40}$"
                  },
                  "access_key_secret": {
                    "type": "string",
                    "pattern": "^CSK_[A-Za-z0-9_-]{43}$"
                  },
                  "security_token": {
                    "type": "string",
                    "pattern": "^CST_[A-Za-z0-9_-]{43}$"
                  }
                }
              }
            ]
          }
        }
      },
      "SessionInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "name",
          "actions",
          "networks",
          "duration_seconds",
          "rpm"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "actions": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "enterprise:ReadApps",
                "enterprise:ReadVersions",
                "enterprise:ReadJobs",
                "distribution:ReadApps",
                "distribution:ReadVersions",
                "distribution:ReadSettings",
                "enterprise:ReadStatistics",
                "distribution:ReadStatistics",
                "enterprise:ReadPricing",
                "distribution:ReadPricing",
                "enterprise:ReadVersionStatistics"
              ]
            }
          },
          "networks": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "maxItems": 50
          },
          "duration_seconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 3600
          },
          "rpm": {
            "type": "integer",
            "minimum": 1,
            "maximum": 60
          }
        }
      },
      "SessionList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Session"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^AKT[a-f0-9]{40}$"
          }
        }
      },
      "SessionRevoked": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "revoked"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^AKT[a-f0-9]{40}$"
          },
          "revoked": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "DownloadTicket": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url",
          "method",
          "headers",
          "expires_at"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "敏感的短期存储凭证。不要记录日志、公开或附带平台 Authorization 请求头。",
            "x-sensitive": true
          },
          "method": {
            "type": "string",
            "const": "GET"
          },
          "headers": {
            "type": "object",
            "additionalProperties": false
          },
          "expires_at": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "DownloadReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "app_id",
          "version_id",
          "package_type",
          "platform",
          "size_bytes",
          "file_name",
          "created_at",
          "expires_at",
          "ticket"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^D[a-f0-9]{32}$"
          },
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "version_id": {
            "type": "string",
            "pattern": "^V[a-f0-9]{32}$"
          },
          "package_type": {
            "type": "string",
            "enum": [
              "original",
              "signed"
            ]
          },
          "platform": {
            "type": "string",
            "enum": [
              "ipa",
              "apk"
            ]
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 1
          },
          "file_name": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}-V[a-f0-9]{32}\\.(ipa|apk)$"
          },
          "created_at": {
            "type": "integer",
            "minimum": 1
          },
          "expires_at": {
            "type": "integer",
            "minimum": 1
          },
          "ticket": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DownloadTicket"
              }
            ]
          }
        }
      },
      "DistributionSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "app_id",
          "revision",
          "template_id",
          "language",
          "introduction",
          "available_template_ids",
          "available_languages"
        ],
        "properties": {
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "revision": {
            "type": "string",
            "pattern": "^R[a-f0-9]{64}$"
          },
          "template_id": {
            "type": "integer",
            "minimum": 1,
            "maximum": 8
          },
          "language": {
            "type": "string",
            "enum": [
              "auto",
              "zh",
              "en",
              "zh-tw",
              "vi",
              "ru",
              "th",
              "ja",
              "ko",
              "es",
              "pt",
              "fr",
              "de",
              "it",
              "id",
              "ms",
              "ar",
              "hi",
              "tr"
            ]
          },
          "introduction": {
            "type": "string",
            "maxLength": 255
          },
          "available_template_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1,
              "maximum": 8
            }
          },
          "available_languages": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "auto",
                "zh",
                "en",
                "zh-tw",
                "vi",
                "ru",
                "th",
                "ja",
                "ko",
                "es",
                "pt",
                "fr",
                "de",
                "it",
                "id",
                "ms",
                "ar",
                "hi",
                "tr"
              ]
            }
          }
        }
      },
      "DistributionSettingsInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "revision",
          "template_id",
          "language",
          "introduction"
        ],
        "properties": {
          "revision": {
            "type": "string",
            "pattern": "^R[a-f0-9]{64}$"
          },
          "template_id": {
            "type": "integer",
            "minimum": 1,
            "maximum": 8
          },
          "language": {
            "type": "string",
            "enum": [
              "auto",
              "zh",
              "en",
              "zh-tw",
              "vi",
              "ru",
              "th",
              "ja",
              "ko",
              "es",
              "pt",
              "fr",
              "de",
              "it",
              "id",
              "ms",
              "ar",
              "hi",
              "tr"
            ]
          },
          "introduction": {
            "type": "string",
            "maxLength": 255
          }
        }
      },
      "DistributionSettingsUpdated": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "settings",
          "replayed"
        ],
        "properties": {
          "settings": {
            "$ref": "#/components/schemas/DistributionSettings"
          },
          "replayed": {
            "type": "boolean"
          }
        }
      },
      "AppStatistics": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "app_id",
          "module",
          "generated_at",
          "timezone",
          "record_scope",
          "window",
          "downloads",
          "installation_statistics_state",
          "installations",
          "launches",
          "daily"
        ],
        "properties": {
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "module": {
            "type": "string",
            "enum": [
              "enterprise",
              "distribution"
            ]
          },
          "generated_at": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "timezone": {
            "type": "string",
            "const": "Asia/Shanghai"
          },
          "record_scope": {
            "type": "string",
            "const": "current_retained_counters"
          },
          "window": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "start_date",
              "end_date",
              "start_at",
              "end_at"
            ],
            "properties": {
              "start_date": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "end_date": {
                "type": "string",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
              },
              "start_at": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "end_at": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            }
          },
          "downloads": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "unit",
              "total",
              "today",
              "yesterday",
              "last_7_days",
              "last_30_days"
            ],
            "properties": {
              "unit": {
                "type": "string",
                "const": "admitted_downloads"
              },
              "total": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "today": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "yesterday": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "last_7_days": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "last_30_days": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            }
          },
          "installation_statistics_state": {
            "type": "string",
            "enum": [
              "available",
              "not_initialized",
              "not_applicable"
            ]
          },
          "installations": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "unit",
                  "total",
                  "today",
                  "yesterday",
                  "last_7_days",
                  "last_30_days",
                  "cross_version_deduplicated"
                ],
                "properties": {
                  "unit": {
                    "type": "string",
                    "const": "unique_admitted_device_fingerprints"
                  },
                  "total": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "today": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "yesterday": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "last_7_days": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "last_30_days": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "cross_version_deduplicated": {
                    "type": "boolean",
                    "const": true
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "launches": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "unit",
                  "total",
                  "today",
                  "today_estimated",
                  "current_rules_include_first_open",
                  "legacy_totals_may_exclude_first_open"
                ],
                "properties": {
                  "unit": {
                    "type": "string",
                    "const": "recorded_launch_events"
                  },
                  "total": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "today": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "today_estimated": {
                    "type": "boolean"
                  },
                  "current_rules_include_first_open": {
                    "type": "boolean",
                    "const": true
                  },
                  "legacy_totals_may_exclude_first_open": {
                    "type": "boolean",
                    "const": true
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "daily": {
            "type": "array",
            "minItems": 30,
            "maxItems": 30,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "date",
                "downloads",
                "new_installations"
              ],
              "properties": {
                "date": {
                  "type": "string",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                },
                "downloads": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "new_installations": {
                  "oneOf": [
                    {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "PricedProduct": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sku",
          "category",
          "name",
          "amount",
          "plan_id",
          "quantity",
          "quantity_unit",
          "service_days"
        ],
        "properties": {
          "sku": {
            "type": "string",
            "pattern": "^(?:[1-6]|100[1-4]|300[1-4]|day[123])$"
          },
          "category": {
            "type": "string",
            "enum": [
              "enterprise_signature",
              "distribution_points",
              "distribution_membership"
            ]
          },
          "name": {
            "type": "string"
          },
          "amount": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,9})\\.[0-9]{2}$"
          },
          "plan_id": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 3
              },
              {
                "type": "null"
              }
            ]
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2147483647
          },
          "quantity_unit": {
            "type": "string",
            "enum": [
              "days",
              "months",
              "download_points",
              "years"
            ]
          },
          "service_days": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 1,
                "maximum": 3650
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "AppPricing": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "app_id",
          "module",
          "generated_at",
          "pricing_revision",
          "reference_only",
          "payment_api_available",
          "currency",
          "products",
          "daily",
          "refund_policy"
        ],
        "properties": {
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "module": {
            "type": "string",
            "enum": [
              "enterprise",
              "distribution"
            ]
          },
          "generated_at": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "pricing_revision": {
            "type": "string",
            "pattern": "^P[a-f0-9]{64}$"
          },
          "reference_only": {
            "type": "boolean",
            "const": true
          },
          "payment_api_available": {
            "type": "boolean",
            "const": false
          },
          "currency": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "unit",
              "prefix",
              "suffix",
              "external_settlement"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "CNY",
                  "USD",
                  "EUR",
                  "HKD",
                  "GBP",
                  "POINT",
                  "CUSTOM"
                ]
              },
              "unit": {
                "type": "string"
              },
              "prefix": {
                "type": "string"
              },
              "suffix": {
                "type": "string"
              },
              "external_settlement": {
                "type": "string",
                "const": "payment_provider"
              }
            }
          },
          "products": {
            "type": "array",
            "minItems": 6,
            "maxItems": 12,
            "items": {
              "$ref": "#/components/schemas/PricedProduct"
            }
          },
          "daily": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "sku",
                "plan_id",
                "enabled",
                "unit_amount",
                "min_days",
                "max_days"
              ],
              "properties": {
                "sku": {
                  "type": "string",
                  "pattern": "^day[123]$"
                },
                "plan_id": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3
                },
                "enabled": {
                  "type": "boolean"
                },
                "unit_amount": {
                  "type": "string",
                  "pattern": "^(?:0|[1-9][0-9]{0,9})\\.[0-9]{2}$"
                },
                "min_days": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3650
                },
                "max_days": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 3650
                }
              }
            }
          },
          "refund_policy": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "window_seconds",
                  "daily_supported",
                  "redemption_supported",
                  "other_rules_apply"
                ],
                "properties": {
                  "window_seconds": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 315360000
                  },
                  "daily_supported": {
                    "type": "boolean"
                  },
                  "redemption_supported": {
                    "type": "boolean",
                    "const": false
                  },
                  "other_rules_apply": {
                    "type": "boolean",
                    "const": true
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "AppQuote": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "app_id",
          "module",
          "generated_at",
          "pricing_revision",
          "reference_only",
          "payment_api_available",
          "currency",
          "product"
        ],
        "properties": {
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "module": {
            "type": "string",
            "enum": [
              "enterprise",
              "distribution"
            ]
          },
          "generated_at": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "pricing_revision": {
            "type": "string",
            "pattern": "^P[a-f0-9]{64}$"
          },
          "reference_only": {
            "type": "boolean",
            "const": true
          },
          "payment_api_available": {
            "type": "boolean",
            "const": false
          },
          "currency": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "unit",
              "prefix",
              "suffix",
              "external_settlement"
            ],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "CNY",
                  "USD",
                  "EUR",
                  "HKD",
                  "GBP",
                  "POINT",
                  "CUSTOM"
                ]
              },
              "unit": {
                "type": "string"
              },
              "prefix": {
                "type": "string"
              },
              "suffix": {
                "type": "string"
              },
              "external_settlement": {
                "type": "string",
                "const": "payment_provider"
              }
            }
          },
          "product": {
            "$ref": "#/components/schemas/PricedProduct"
          }
        }
      },
      "Creation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "state",
          "module",
          "platform",
          "expires_at"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "state": {
            "type": "string",
            "enum": [
              "awaiting_upload",
              "ready",
              "expired"
            ]
          },
          "module": {
            "type": "string"
          },
          "platform": {
            "type": "string"
          },
          "expires_at": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "AppMetadata": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "app_id",
          "name",
          "remark",
          "revision"
        ],
        "properties": {
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "name": {
            "type": "string"
          },
          "remark": {
            "type": "string"
          },
          "revision": {
            "type": "string"
          }
        }
      },
      "PublishedVersion": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "app_id",
          "version_id",
          "previous_version_id",
          "published_at"
        ],
        "properties": {
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "version_id": {
            "type": "string"
          },
          "previous_version_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "published_at": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "TrashedApp": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "app_id",
          "state",
          "files_retained"
        ],
        "properties": {
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "state": {
            "type": "string"
          },
          "files_retained": {
            "type": "boolean"
          }
        }
      },
      "AccountBalance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "available",
          "currency",
          "observed_at"
        ],
        "properties": {
          "available": {
            "type": "string",
            "pattern": "^-?[0-9]{1,11}\\.[0-9]{2}$"
          },
          "currency": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "unit",
              "external_settlement"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "external_settlement": {
                "type": "string"
              }
            }
          },
          "observed_at": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "AccountOrders": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor",
          "currency",
          "historical_complete"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "app_id",
                "order_number",
                "description",
                "amount",
                "status",
                "payment_method",
                "created_at",
                "paid_at"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "app_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^A[a-f0-9]{32}$"
                },
                "order_number": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "amount": {
                  "type": "string",
                  "pattern": "^-?[0-9]{1,11}\\.[0-9]{2}$"
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "paid",
                    "pending",
                    "closed",
                    "refunded",
                    "unknown"
                  ]
                },
                "payment_method": {
                  "type": "string",
                  "enum": [
                    "alipay",
                    "wechat",
                    "balance",
                    "admin",
                    "usdt_gateway",
                    "usdt_tron",
                    "other"
                  ]
                },
                "created_at": {
                  "type": "integer",
                  "minimum": 0
                },
                "paid_at": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^O[a-f0-9]{32}$"
          },
          "currency": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "unit",
              "external_settlement"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "external_settlement": {
                "type": "string"
              }
            }
          },
          "historical_complete": {
            "type": "boolean"
          }
        }
      },
      "AccountLedger": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "next_cursor",
          "currency",
          "historical_complete"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "app_id",
                "before",
                "change",
                "after",
                "event_type",
                "title",
                "created_at"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "app_id": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "pattern": "^A[a-f0-9]{32}$"
                },
                "before": {
                  "type": "string",
                  "pattern": "^-?[0-9]{1,11}\\.[0-9]{2}$"
                },
                "change": {
                  "type": "string",
                  "pattern": "^-?[0-9]{1,11}\\.[0-9]{2}$"
                },
                "after": {
                  "type": "string",
                  "pattern": "^-?[0-9]{1,11}\\.[0-9]{2}$"
                },
                "event_type": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "created_at": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^L[a-f0-9]{32}$"
          },
          "currency": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "code",
              "unit",
              "external_settlement"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "external_settlement": {
                "type": "string"
              }
            }
          },
          "historical_complete": {
            "type": "boolean"
          }
        }
      },
      "PurchaseCurrency": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "unit",
          "external_settlement",
          "revision"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "external_settlement": {
            "type": "string",
            "const": "payment_provider"
          },
          "revision": {
            "type": "string",
            "pattern": "^C[a-f0-9]{64}$"
          }
        }
      },
      "PurchaseEntitlement": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "scope",
          "sign_expires_at",
          "sign_plan",
          "download_points",
          "membership_tier",
          "membership_expires_at"
        ],
        "properties": {
          "scope": {
            "type": "string",
            "enum": [
              "application",
              "account"
            ]
          },
          "sign_expires_at": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "sign_plan": {
            "oneOf": [
              {
                "type": "integer",
                "enum": [
                  1,
                  2,
                  3
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "download_points": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "membership_tier": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 3
              },
              {
                "type": "null"
              }
            ]
          },
          "membership_expires_at": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PurchaseReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "quote_id",
          "app_id",
          "order_id",
          "state",
          "payment_method",
          "amount",
          "currency",
          "balance_before",
          "balance_after",
          "paid_at",
          "automatic_signing",
          "entitlement"
        ],
        "properties": {
          "quote_id": {
            "type": "string",
            "pattern": "^Q[a-f0-9]{32}$"
          },
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "order_id": {
            "type": "string",
            "pattern": "^O[a-f0-9]{32}$"
          },
          "state": {
            "type": "string",
            "const": "paid"
          },
          "payment_method": {
            "type": "string",
            "const": "balance"
          },
          "amount": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "currency": {
            "$ref": "#/components/schemas/PurchaseCurrency"
          },
          "balance_before": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "balance_after": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "paid_at": {
            "type": "integer",
            "minimum": 0
          },
          "automatic_signing": {
            "type": "boolean",
            "const": false
          },
          "entitlement": {
            "$ref": "#/components/schemas/PurchaseEntitlement"
          }
        }
      },
      "PurchaseQuote": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "app_id",
          "module",
          "state",
          "product",
          "amount",
          "currency",
          "pricing_revision",
          "created_at",
          "expires_at",
          "price_reserved",
          "funds_reserved",
          "automatic_signing",
          "receipt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^Q[a-f0-9]{32}$"
          },
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "module": {
            "type": "string",
            "enum": [
              "enterprise",
              "distribution"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "awaiting_payment",
              "paid",
              "expired"
            ]
          },
          "product": {
            "$ref": "#/components/schemas/PricedProduct"
          },
          "amount": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "currency": {
            "$ref": "#/components/schemas/PurchaseCurrency"
          },
          "pricing_revision": {
            "type": "string",
            "pattern": "^P[a-f0-9]{64}$"
          },
          "created_at": {
            "type": "integer",
            "minimum": 0
          },
          "expires_at": {
            "type": "integer",
            "minimum": 0
          },
          "price_reserved": {
            "type": "boolean",
            "const": true
          },
          "funds_reserved": {
            "type": "boolean",
            "const": false
          },
          "automatic_signing": {
            "type": "boolean",
            "const": false
          },
          "receipt": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/PurchaseReceipt"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "PurchaseQuoteInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "sku"
        ],
        "properties": {
          "sku": {
            "type": "string",
            "pattern": "^(?:[1-6]|100[1-4]|300[1-4]|day[123])$"
          },
          "days": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,3}$"
          }
        }
      },
      "PurchaseConfirmation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "payment_method",
          "amount",
          "pricing_revision",
          "currency_revision"
        ],
        "properties": {
          "payment_method": {
            "type": "string",
            "const": "balance"
          },
          "amount": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "pricing_revision": {
            "type": "string",
            "pattern": "^P[a-f0-9]{64}$"
          },
          "currency_revision": {
            "type": "string",
            "pattern": "^C[a-f0-9]{64}$"
          }
        }
      },
      "BudgetPeriod": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "limit",
          "used",
          "remaining",
          "resets_at"
        ],
        "properties": {
          "limit": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "used": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,12})\\.[0-9]{2}$"
          },
          "remaining": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "resets_at": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "BudgetScope": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "currency_current",
          "single_limit",
          "daily",
          "monthly"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "currency_current": {
            "type": "boolean"
          },
          "single_limit": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "daily": {
            "$ref": "#/components/schemas/BudgetPeriod"
          },
          "monthly": {
            "$ref": "#/components/schemas/BudgetPeriod"
          }
        }
      },
      "PaymentBudget": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "currency",
          "timezone",
          "observed_at",
          "account",
          "application",
          "financial_health"
        ],
        "properties": {
          "currency": {
            "$ref": "#/components/schemas/PurchaseCurrency"
          },
          "timezone": {
            "type": "string",
            "const": "Asia/Shanghai"
          },
          "observed_at": {
            "type": "integer",
            "minimum": 0
          },
          "account": {
            "$ref": "#/components/schemas/BudgetScope"
          },
          "application": {
            "$ref": "#/components/schemas/BudgetScope"
          },
          "financial_health": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "payment_quarantined",
              "checked_at"
            ],
            "properties": {
              "payment_quarantined": {
                "type": "boolean"
              },
              "checked_at": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        }
      },
      "RefundConfirmation": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "amount",
          "currency_revision",
          "confirmation"
        ],
        "properties": {
          "amount": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "currency_revision": {
            "type": "string",
            "pattern": "^C[a-f0-9]{64}$"
          },
          "confirmation": {
            "type": "string",
            "const": "revoke_order_entitlement"
          }
        }
      },
      "RefundReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "app_id",
          "order_id",
          "quote_id",
          "state",
          "amount",
          "currency",
          "balance_before",
          "balance_after",
          "refunded_at",
          "revoked_days",
          "sign_expires_at",
          "refund_destination",
          "budget_restored"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^R[a-f0-9]{32}$"
          },
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "order_id": {
            "type": "string",
            "pattern": "^O[a-f0-9]{32}$"
          },
          "quote_id": {
            "type": "string",
            "pattern": "^Q[a-f0-9]{32}$"
          },
          "state": {
            "type": "string",
            "const": "refunded"
          },
          "amount": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "currency": {
            "$ref": "#/components/schemas/PurchaseCurrency"
          },
          "balance_before": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "balance_after": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "refunded_at": {
            "type": "integer",
            "minimum": 0
          },
          "revoked_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3650
          },
          "sign_expires_at": {
            "type": "integer",
            "minimum": 0
          },
          "refund_destination": {
            "type": "string",
            "const": "site_balance"
          },
          "budget_restored": {
            "type": "boolean",
            "const": false
          }
        }
      },
      "OrderRefund": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "app_id",
          "order_id",
          "state",
          "eligible",
          "amount",
          "currency",
          "days",
          "deadline",
          "message",
          "receipt",
          "refund_destination",
          "budget_restored",
          "confirmation"
        ],
        "properties": {
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "order_id": {
            "type": "string",
            "pattern": "^O[a-f0-9]{32}$"
          },
          "state": {
            "type": "string",
            "enum": [
              "eligible",
              "unavailable",
              "refunded"
            ]
          },
          "eligible": {
            "type": "boolean"
          },
          "amount": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "currency": {
            "$ref": "#/components/schemas/PurchaseCurrency"
          },
          "days": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ]
          },
          "deadline": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0
              },
              {
                "type": "null"
              }
            ]
          },
          "message": {
            "type": "string",
            "maxLength": 400
          },
          "receipt": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/RefundReceipt"
              },
              {
                "type": "null"
              }
            ]
          },
          "refund_destination": {
            "type": "string",
            "const": "site_balance"
          },
          "budget_restored": {
            "type": "boolean",
            "const": false
          },
          "confirmation": {
            "type": "string",
            "const": "revoke_order_entitlement"
          }
        }
      },
      "CapacityInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "quantity"
        ],
        "properties": {
          "quantity": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,5}$",
            "description": "增加 1–100000 台额度，超出范围由服务端拒绝。"
          }
        }
      },
      "CapacityReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "quote_id",
          "app_id",
          "order_id",
          "state",
          "payment_method",
          "quantity",
          "unit_price",
          "amount",
          "currency",
          "balance_before",
          "balance_after",
          "paid_at",
          "old_max",
          "new_max",
          "refund_supported"
        ],
        "properties": {
          "quote_id": {
            "type": "string",
            "pattern": "^Q[a-f0-9]{32}$"
          },
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "order_id": {
            "type": "string",
            "pattern": "^O[a-f0-9]{32}$"
          },
          "state": {
            "type": "string",
            "const": "paid"
          },
          "payment_method": {
            "type": "string",
            "const": "balance"
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000
          },
          "unit_price": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "amount": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "currency": {
            "$ref": "#/components/schemas/PurchaseCurrency"
          },
          "balance_before": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "balance_after": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "paid_at": {
            "type": "integer",
            "minimum": 0
          },
          "old_max": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2147483647
          },
          "new_max": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2147483647
          },
          "refund_supported": {
            "type": "boolean",
            "const": false
          }
        }
      },
      "CapacityQuote": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "app_id",
          "state",
          "quantity",
          "unit_price",
          "amount",
          "current_max",
          "new_max",
          "installed_devices",
          "currency",
          "pricing_revision",
          "created_at",
          "expires_at",
          "price_reserved",
          "funds_reserved",
          "refund_supported",
          "receipt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^Q[a-f0-9]{32}$"
          },
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "state": {
            "type": "string",
            "enum": [
              "awaiting_payment",
              "expired",
              "paid"
            ]
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000
          },
          "unit_price": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "amount": {
            "type": "string",
            "pattern": "^(?:0|[1-9][0-9]{0,8})\\.[0-9]{2}$"
          },
          "current_max": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2147483647
          },
          "new_max": {
            "type": "integer",
            "minimum": 1,
            "maximum": 2147483647
          },
          "installed_devices": {
            "type": "integer",
            "minimum": 0
          },
          "currency": {
            "$ref": "#/components/schemas/PurchaseCurrency"
          },
          "pricing_revision": {
            "type": "string",
            "pattern": "^P[a-f0-9]{64}$"
          },
          "created_at": {
            "type": "integer",
            "minimum": 0
          },
          "expires_at": {
            "type": "integer",
            "minimum": 0
          },
          "price_reserved": {
            "type": "boolean",
            "const": false
          },
          "funds_reserved": {
            "type": "boolean",
            "const": false
          },
          "refund_supported": {
            "type": "boolean",
            "const": false
          },
          "receipt": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CapacityReceipt"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "VersionStatistics": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "app_id",
          "version_id",
          "module",
          "package_type",
          "generated_at",
          "timezone",
          "date",
          "record_scope",
          "statistics_scope",
          "installations",
          "launches"
        ],
        "properties": {
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "version_id": {
            "type": "string",
            "pattern": "^V[a-f0-9]{32}$"
          },
          "module": {
            "type": "string",
            "const": "enterprise"
          },
          "package_type": {
            "type": "string",
            "enum": [
              "original",
              "signed"
            ]
          },
          "generated_at": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "timezone": {
            "type": "string",
            "const": "Asia/Shanghai"
          },
          "date": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
          },
          "record_scope": {
            "type": "string",
            "const": "current_retained_version_counters"
          },
          "statistics_scope": {
            "type": "string",
            "enum": [
              "independent",
              "merged",
              "merged_member",
              "disabled",
              "source"
            ]
          },
          "installations": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": false,
            "required": [
              "unit",
              "total",
              "today",
              "cross_version_deduplicated"
            ],
            "properties": {
              "unit": {
                "type": "string",
                "const": "unique_admitted_device_fingerprints_per_version"
              },
              "total": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "today": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "cross_version_deduplicated": {
                "type": "boolean",
                "const": false
              }
            }
          },
          "launches": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": false,
            "required": [
              "unit",
              "total",
              "today",
              "current_rules_include_first_open",
              "legacy_totals_may_exclude_first_open"
            ],
            "properties": {
              "unit": {
                "type": "string",
                "const": "recorded_launch_events"
              },
              "total": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "today": {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              "current_rules_include_first_open": {
                "type": "boolean",
                "const": true
              },
              "legacy_totals_may_exclude_first_open": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "SigningCertificate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "label",
          "team",
          "certificate_expires",
          "profile_expires",
          "selected"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^C[a-f0-9]{32}$"
          },
          "label": {
            "type": "string",
            "maxLength": 255
          },
          "team": {
            "type": "string",
            "maxLength": 255
          },
          "certificate_expires": {
            "type": "string",
            "maxLength": 80
          },
          "profile_expires": {
            "type": "string",
            "maxLength": 80
          },
          "selected": {
            "type": "boolean"
          }
        }
      },
      "SigningCertificates": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "app_id",
          "items"
        ],
        "properties": {
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "items": {
            "type": "array",
            "maxItems": 1000,
            "items": {
              "$ref": "#/components/schemas/SigningCertificate"
            }
          }
        }
      },
      "SigningParametersInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "revision",
          "bundle_mode",
          "keychain_mode",
          "remove_plugins"
        ],
        "properties": {
          "revision": {
            "type": "string",
            "pattern": "^R[a-f0-9]{64}$"
          },
          "bundle_mode": {
            "type": "string",
            "enum": [
              "original",
              "certificate",
              "administrator"
            ]
          },
          "keychain_mode": {
            "type": "string",
            "enum": [
              "off",
              "certificate",
              "custom"
            ]
          },
          "remove_plugins": {
            "type": "string",
            "enum": [
              "none",
              "auto",
              "selected"
            ]
          }
        }
      },
      "SigningParameters": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "app_id",
          "revision",
          "bundle_mode",
          "keychain_mode",
          "remove_plugins"
        ],
        "properties": {
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "revision": {
            "type": "string",
            "pattern": "^R[a-f0-9]{64}$"
          },
          "bundle_mode": {
            "type": "string",
            "enum": [
              "original",
              "certificate",
              "administrator"
            ]
          },
          "keychain_mode": {
            "type": "string",
            "enum": [
              "off",
              "certificate",
              "custom"
            ]
          },
          "remove_plugins": {
            "type": "string",
            "enum": [
              "none",
              "auto",
              "selected"
            ]
          }
        }
      },
      "SigningBatchInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "app_id",
                "source_version_id"
              ],
              "properties": {
                "app_id": {
                  "type": "string",
                  "pattern": "^A[a-f0-9]{32}$"
                },
                "source_version_id": {
                  "type": "string",
                  "pattern": "^V[a-f0-9]{32}$"
                },
                "certificate_id": {
                  "type": "string",
                  "pattern": "^C[a-f0-9]{32}$"
                }
              }
            }
          }
        }
      },
      "SigningBatchAccepted": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "items",
          "accepted"
        ],
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/JobAccepted"
            }
          },
          "accepted": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "DeviceRecord": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "device_id",
          "ip",
          "region",
          "first_seen_at",
          "last_seen_at",
          "recorded_launches"
        ],
        "properties": {
          "device_id": {
            "type": "string",
            "pattern": "^F(?:[a-f0-9]{24,64}|[a-f0-9]{8}-[a-f0-9]{16}|instance:[a-f0-9]{40})$"
          },
          "ip": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 45
          },
          "region": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "first_seen_at": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "last_seen_at": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "recorded_launches": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        }
      },
      "OverflowDeviceRecord": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "device_id",
          "ip",
          "region",
          "first_denied_at",
          "last_denied_at",
          "attempts",
          "last_install_limit",
          "admitted_at",
          "state"
        ],
        "properties": {
          "device_id": {
            "type": "string",
            "pattern": "^F(?:[a-f0-9]{24,64}|[a-f0-9]{8}-[a-f0-9]{16}|instance:[a-f0-9]{40})$"
          },
          "ip": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 45
          },
          "region": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "first_denied_at": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "last_denied_at": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "attempts": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "last_install_limit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "admitted_at": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "recovered"
            ]
          }
        }
      },
      "DeviceList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "app_id",
          "generated_at",
          "source",
          "device_identifier",
          "network_visible",
          "consistency",
          "legacy_launches_may_exclude_first_open",
          "items",
          "next_cursor"
        ],
        "properties": {
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "generated_at": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "source": {
            "type": "string",
            "const": "devices"
          },
          "device_identifier": {
            "type": "string",
            "const": "retained_installation_identifier_not_hardware_attestation"
          },
          "network_visible": {
            "type": "boolean"
          },
          "consistency": {
            "type": "string",
            "const": "live_retained_records"
          },
          "legacy_launches_may_exclude_first_open": {
            "type": "boolean",
            "const": true
          },
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/DeviceRecord"
            }
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string",
                "pattern": "^F(?:[a-f0-9]{24,64}|[a-f0-9]{8}-[a-f0-9]{16}|instance:[a-f0-9]{40})$"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "OverflowDeviceList": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "app_id",
          "generated_at",
          "source",
          "device_identifier",
          "network_visible",
          "consistency",
          "legacy_launches_may_exclude_first_open",
          "items",
          "next_cursor"
        ],
        "properties": {
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "generated_at": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "source": {
            "type": "string",
            "const": "overflow"
          },
          "device_identifier": {
            "type": "string",
            "const": "retained_installation_identifier_not_hardware_attestation"
          },
          "network_visible": {
            "type": "boolean"
          },
          "consistency": {
            "type": "string",
            "const": "live_retained_records"
          },
          "legacy_launches_may_exclude_first_open": {
            "type": "boolean",
            "const": true
          },
          "items": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/OverflowDeviceRecord"
            }
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string",
                "pattern": "^F(?:[a-f0-9]{24,64}|[a-f0-9]{8}-[a-f0-9]{16}|instance:[a-f0-9]{40})$"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "DeviceExportInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "source",
          "state",
          "limit",
          "cursor"
        ],
        "properties": {
          "source": {
            "type": "string",
            "enum": [
              "devices",
              "overflow"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "all",
              "pending",
              "recovered"
            ]
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 500
          },
          "cursor": {
            "type": "string",
            "pattern": "^(?:F(?:[a-f0-9]{24,64}|[a-f0-9]{8}-[a-f0-9]{16}|instance:[a-f0-9]{40}))?$"
          }
        }
      },
      "DeviceExport": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "app_id",
          "source",
          "file_name",
          "format",
          "rows",
          "next_cursor",
          "sha256",
          "content_base64"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^X[a-f0-9]{32}$"
          },
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "source": {
            "type": "string",
            "enum": [
              "devices",
              "overflow"
            ]
          },
          "file_name": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}-(?:devices|overflow)\\.jsonl$"
          },
          "format": {
            "type": "string",
            "const": "jsonl"
          },
          "rows": {
            "type": "integer",
            "minimum": 0,
            "maximum": 500
          },
          "next_cursor": {
            "oneOf": [
              {
                "type": "string",
                "pattern": "^F(?:[a-f0-9]{24,64}|[a-f0-9]{8}-[a-f0-9]{16}|instance:[a-f0-9]{40})$"
              },
              {
                "type": "null"
              }
            ]
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "content_base64": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1500000
          }
        }
      },
      "SigningRedemptionInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "code",
          "confirm_non_refundable"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "完整企业签名开通密钥，不是 AccessKey Secret；套餐及 30/90/360 天时长由密钥决定。不要写入日志或浏览器源码。",
            "pattern": "^[A-Za-z0-9_-]{6,128}$",
            "writeOnly": true
          },
          "confirm_non_refundable": {
            "type": "boolean",
            "description": "必须明确确认密钥开通不支持退款。",
            "const": true
          }
        }
      },
      "SigningRedemptionReceipt": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "app_id",
          "state",
          "redeemed_at",
          "duration_days",
          "plan_id",
          "previous_expires_at",
          "sign_expires_at",
          "refund_supported",
          "automatic_signing"
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "持久核销回执 E 标识，绑定当前账号、业务应用及创建核销的 API 应用。",
            "pattern": "^E[a-f0-9]{32}$"
          },
          "app_id": {
            "type": "string",
            "description": "目标业务应用 A。",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "state": {
            "type": "string",
            "description": "redeemed 表示密钥核销与权益已原子提交。",
            "enum": [
              "redeemed"
            ]
          },
          "redeemed_at": {
            "type": "integer",
            "minimum": 0,
            "description": "实际核销 UTC 秒。"
          },
          "duration_days": {
            "type": "integer",
            "minimum": 1,
            "description": "本次授予天数：月/季/年密钥分别为 30/90/360 天。"
          },
          "plan_id": {
            "type": "integer",
            "enum": [
              1,
              2,
              3
            ],
            "description": "密钥对应签名套餐：1 基础版、2 高级版、3 独立版。"
          },
          "previous_expires_at": {
            "type": "integer",
            "minimum": 0,
            "description": "本次核销前签名到期 UTC 秒，0 表示未开通。"
          },
          "sign_expires_at": {
            "type": "integer",
            "minimum": 0,
            "description": "核销后的签名到期 UTC 秒。原套餐仍有效时从原到期时间延长，否则从本次核销时间开始。"
          },
          "refund_supported": {
            "type": "boolean",
            "description": "密钥核销固定不支持退款。",
            "const": false
          },
          "automatic_signing": {
            "type": "boolean",
            "description": "固定 false，核销不创建签名任务。另行授予 CreateJobs 并提交原包版本。",
            "const": false
          }
        }
      },
      "SigningEntitlement": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "app_id",
          "generated_at",
          "state",
          "plan_id",
          "plan_name",
          "sign_expires_at",
          "remaining_seconds",
          "first_recorded_activation_at",
          "application_status",
          "certificate",
          "certificate_state",
          "installation_limit",
          "verification",
          "refund_policy",
          "statistics_state",
          "statistics",
          "signing_admission_rechecked"
        ],
        "properties": {
          "app_id": {
            "type": "string",
            "description": "当前账号授权的企业签名应用。",
            "pattern": "^A[a-f0-9]{32}$"
          },
          "generated_at": {
            "type": "integer",
            "minimum": 0,
            "description": "查询时刻 UTC 秒，权益和准入仍会在后续写入时重新核实。"
          },
          "state": {
            "type": "string",
            "description": "not_activated 未开通、active 有效、expired 已到期；该状态不代表一定可以成功提交任务。",
            "enum": [
              "not_activated",
              "active",
              "expired"
            ]
          },
          "plan_id": {
            "type": "integer",
            "minimum": 0,
            "description": "当前套餐编号，0 未分类、1 基础版、2 高级版、3 独立版。"
          },
          "plan_name": {
            "type": "string",
            "description": "当前套餐展示名称。"
          },
          "sign_expires_at": {
            "type": "integer",
            "minimum": 0,
            "description": "当前签名有效期到期 UTC 秒；0 表示未开通。"
          },
          "remaining_seconds": {
            "type": "integer",
            "minimum": 0,
            "description": "距到期的剩余秒数，不小于零。"
          },
          "first_recorded_activation_at": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 0,
                "description": "当前权益台账中最早记录的开通时刻；旧数据缺少记录时为 null，不用上传时间冒充开通时间。"
              },
              {
                "type": "null"
              }
            ],
            "description": "当前权益台账中最早记录的开通时刻；缺失为 null，不能拿上传时间代替。"
          },
          "application_status": {
            "type": "string",
            "description": "normal 正常、pending_review 待审核、blocked 被锁定。",
            "enum": [
              "normal",
              "pending_review",
              "blocked"
            ]
          },
          "certificate": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/SigningCertificate"
              },
              {
                "type": "null"
              }
            ],
            "description": "当前已分配的同套餐证书公开信息；缺失、重复或套餐不符为 null。"
          },
          "certificate_state": {
            "type": "string",
            "description": "assigned 当前已分配同套餐证书的公开信息；unavailable 表示缺失、重复或套餐不匹配。",
            "enum": [
              "assigned",
              "unavailable"
            ]
          },
          "installation_limit": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "maximum_devices",
              "unlimited",
              "cross_version_deduplicated"
            ],
            "properties": {
              "maximum_devices": {
                "type": "integer",
                "minimum": 0,
                "description": "应用级唯一设备上限，0 表示不限；不逐版本重复计费。"
              },
              "unlimited": {
                "type": "boolean",
                "description": "上限为 0 时为 true。"
              },
              "cross_version_deduplicated": {
                "type": "boolean",
                "description": "同一应用跨版本按设备指纹去重，不是系统真实 UDID。",
                "const": true
              }
            },
            "description": "应用级安装量上限与跨版本去重规则。"
          },
          "verification": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "injection_enabled",
              "ui_mode",
              "ui_inherited",
              "applies_to_next_signature"
            ],
            "properties": {
              "injection_enabled": {
                "type": "boolean",
                "description": "后续签名是否注入平台验证库；不是授权通过状态。"
              },
              "ui_mode": {
                "type": "integer",
                "enum": [
                  1,
                  2,
                  3
                ],
                "description": "后续签名生效的等待提示方案，不改变授权、到期和安装量规则。"
              },
              "ui_inherited": {
                "type": "boolean",
                "description": "是否跟随全局默认验证提示方式。"
              },
              "applies_to_next_signature": {
                "type": "boolean",
                "description": "上述配置用于后续签名，不能据此推断已有安装包所带配置。",
                "const": true
              }
            },
            "description": "后续签名使用的验证库与等待提示配置，不代表当前安装包授权结果。"
          },
          "refund_policy": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "window_seconds",
              "daily_supported",
              "redemption_supported",
              "other_rules_apply"
            ],
            "properties": {
              "window_seconds": {
                "type": "integer",
                "minimum": 0,
                "description": "当前全局余额订单退款窗口，仍需查询指定 API 订单资格。"
              },
              "daily_supported": {
                "type": "boolean",
                "description": "当前按天余额订单是否支持退款。"
              },
              "redemption_supported": {
                "type": "boolean",
                "description": "密钥开通固定不支持退款。",
                "const": false
              },
              "other_rules_apply": {
                "type": "boolean",
                "description": "还需满足来源 API 应用、次数、安装量等退款规则；不是退款资格承诺。",
                "const": true
              }
            },
            "description": "网站当前全局退款政策；实际退款资格须查询指定原 API 订单。"
          },
          "statistics_state": {
            "type": "string",
            "description": "available 已按统计权限返回，not_authorized 未授统计动作，disabled 账号未批准统计，unavailable 统计暂不可用或被限流。",
            "enum": [
              "available",
              "not_authorized",
              "disabled",
              "unavailable"
            ]
          },
          "statistics": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AppStatistics"
              },
              {
                "type": "null"
              }
            ],
            "description": "同时获统计动作与账号统计审批时返回现有统计结构；否则为 null，不能当作零。"
          },
          "signing_admission_rechecked": {
            "type": "boolean",
            "description": "后续任务将重新检查期限、账号、应用、证书、源版本及并发/每日额度，当前详情不预留资格。",
            "const": true
          }
        }
      },
      "JobResult": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "app_id",
          "job_id",
          "status",
          "terminal",
          "result_state",
          "source_version",
          "signed_version",
          "published_at"
        ],
        "properties": {
          "app_id": {
            "type": "string",
            "pattern": "^A[a-f0-9]{32}$",
            "description": "当前账号拥有且获授权的企业签名应用完整 A 标识。"
          },
          "job_id": {
            "type": "string",
            "pattern": "^J[a-f0-9]{32}$",
            "description": "本次查询的准确签名任务 J 标识。"
          },
          "status": {
            "type": "string",
            "enum": [
              "preparing",
              "ready",
              "leased",
              "running",
              "verifying",
              "publishing",
              "succeeded",
              "failed",
              "cancelled",
              "superseded"
            ],
            "description": "任务状态。succeeded 表示发布完成，仍须检查 result_state。"
          },
          "terminal": {
            "type": "boolean",
            "description": "是否为终态：succeeded、failed、cancelled、superseded。"
          },
          "result_state": {
            "type": "string",
            "enum": [
              "pending",
              "available",
              "not_produced",
              "not_recorded",
              "removed"
            ],
            "description": "pending 正在执行；available 可取准确签名 V；not_produced 任务未成功；not_recorded 旧任务无可信关联；removed 产物版本已清理。"
          },
          "source_version": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Version"
              },
              {
                "type": "null"
              }
            ],
            "description": "该 J 实际输入的原包版本。若已清理则为 null，不是签名包。"
          },
          "signed_version": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Version"
              },
              {
                "type": "null"
              }
            ],
            "description": "仅 available 时返回准确的签名版本；其他状态为 null。id 用于 DownloadSigned 票据；不要求 is_current=true。"
          },
          "published_at": {
            "oneOf": [
              {
                "type": "integer",
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "description": "可信关联记录中的发布时间（Unix 秒）；尚未发布或旧记录缺失时为 null。"
          }
        },
        "description": "以任务不可变关联查询的结果快照，不依赖版本列表顺序。"
      }
    },
    "responses": {
      "Error": {
        "description": "400 请求格式；401 凭据无效/过期；403 未授权；404 资源不存在或不可见；405 方法不支持；409 nonce 重放；429 限流（Retry-After 秒）；503 平台关闭或依赖不可用。通过验签的失败请求也须使用新 nonce 重试。",
        "headers": {
          "X-Request-Id": {
            "schema": {
              "type": "string"
            }
          },
          "Retry-After": {
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/api/v1/whoami": {
      "get": {
        "operationId": "getIdentity",
        "summary": "查询当前身份与权限",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "responses": {
          "200": {
            "description": "身份校验成功（不要求额外业务动作权限）",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "owner_id": {
                          "type": "integer"
                        },
                        "actions": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "resources": {
                          "oneOf": [
                            {
                              "type": "string",
                              "const": "*"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        },
                        "environment": {
                          "type": "string",
                          "const": "production"
                        }
                      },
                      "required": [
                        "owner_id",
                        "actions",
                        "resources",
                        "environment"
                      ]
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "首次接入时先调用此接口。用 owner_id 核对账号，用 actions 和 resources 核对操作及应用范围。之后可调用列出应用取得业务应用 ID。",
        "tags": [
          "接入与授权"
        ],
        "x-cloudsign-products": [
          "access"
        ]
      }
    },
    "/api/v1/apps": {
      "get": {
        "operationId": "listApps",
        "summary": "列出已授权应用",
        "description": "选择企业签名或普通分发模块，获取可操作的应用及完整 A 标识。首次请求省略 cursor，后续请求原样传回 next_cursor。空列表表示当前筛选和授权范围内没有应用。\n\nenterprise 需要 enterprise:ReadApps；distribution 需要 distribution:ReadApps。资源未授权时为空列表。无超级签名数据。\n\nsearch 对应用名称、Bundle ID、备注做关键词匹配，首尾空格忽略，最多 256 个 UTF-8 字节，不允许控制字符。% 和 _ 按普通字符匹配，不是通配符。bundle_id 是完整包名匹配（非关键词），最多 255 个 ASCII 字符；比较大小写规则跟随站点数据库排序规则。两个条件同时提供时取交集。翻页时保持 module、search、bundle_id、limit 不变；修改条件应省略 cursor 重新查询。每次只查询当前账号的已授权应用；不返回总数，查询超时不会退化为全表无限扫描。",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "module",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "enterprise",
                "distribution"
              ],
              "default": "enterprise"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            },
            "description": "上一页 next_cursor；不传为第一页"
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 256
            },
            "description": "名称、Bundle ID 或备注关键词。最多 256 个 UTF-8 字节；百分号及下划线按字面匹配；空值不筛选。"
          },
          {
            "name": "bundle_id",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 255,
              "pattern": "^(?:[A-Za-z0-9][A-Za-z0-9._-]*)?$"
            },
            "description": "完整 Bundle ID，精确匹配；空值不筛选。与 search 同时指定时取交集。"
          }
        ],
        "responses": {
          "200": {
            "description": "按公开 ID 升序，游标分页",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "items",
                        "next_cursor"
                      ],
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/App"
                          }
                        },
                        "next_cursor": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      },
      "post": {
        "operationId": "createApp",
        "summary": "预留新应用",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          }
        ],
        "description": "创建上传前的应用预留，立即返回 A 标识。24 小时内为该 A 上传首包。包名及平台校验成功后才生成可管理的正式应用。每个账号同时最多保留 10 个待完成预留。企业签名选 ipa，普通分发可选 ipa 或 apk。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Creation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "module",
                  "platform",
                  "name",
                  "bundle_id"
                ],
                "properties": {
                  "module": {
                    "type": "string"
                  },
                  "platform": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "bundle_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{id}": {
      "get": {
        "operationId": "getApp",
        "summary": "查询应用详情",
        "description": "把应用列表返回的 id 放入路径，取得包名、平台、版本、Build、包大小及更新时间。需要下载某一版本的安装包时，再查询版本列表并申请下载凭证。\n\n需要相应模块 ReadApps 动作及资源授权；不接受查询参数，不返回包地址、证书或私有存储信息。",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "responses": {
          "200": {
            "description": "应用详情",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string"
                    },
                    "data": {
                      "$ref": "#/components/schemas/App"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/versions": {
      "get": {
        "operationId": "listVersions",
        "summary": "列出应用历史版本",
        "description": "从最近版本开始分页。用 package_type 区分原包和签名产物，从返回项取得 V 标识和 is_current。next_cursor 为空时已读完。\n\n需要 enterprise:ReadVersions 或 distribution:ReadVersions，及相应应用范围；不隐含 ReadApps 权限。按版本记录创建顺序倒序分页，V 标识不包含内部序号。 不做总量 COUNT；非快照分页。删除游标对应记录后返回 InvalidCursor 400，不静默重置到第一页。",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^V[a-f0-9]{32}$"
            }
          },
          {
            "name": "package_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "original",
                "signed"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功；不包含安装包下载 URL、证书或私有内部信息",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "items",
                        "next_cursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Version"
                          }
                        },
                        "next_cursor": {
                          "oneOf": [
                            {
                              "type": "null"
                            },
                            {
                              "type": "string",
                              "pattern": "^V[a-f0-9]{32}$"
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/versions/{version_id}": {
      "get": {
        "operationId": "getVersion",
        "summary": "查询指定版本",
        "description": "从同一应用的历史版本列表取 V 标识，与 A 标识一起传入路径。核对 Build、大小和包类型后，可据此申请下载凭证。\n\n需要 enterprise:ReadVersions 或 distribution:ReadVersions，及相应应用范围；不隐含 ReadApps 权限。按版本记录创建顺序倒序分页，V 标识不包含内部序号。 详情不接受查询参数。",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^V[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功；不包含安装包下载 URL、证书或私有内部信息",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Version"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/jobs": {
      "get": {
        "operationId": "listJobs",
        "summary": "列出应用签名任务",
        "description": "按创建时间从新到旧查看本人提交的企业签名任务。可按状态过滤，用返回的 J 标识查详情。分页过程中状态可能变化。\n\n需要 enterprise:ReadJobs 及应用范围；仅当前应用所有者发起的 enterprise 任务，不包含其他用户、prepare/device 任务或原始错误详情。按 created_at、随机任务 ID 倒序分页，状态变化不使当前应用内的游标失效。 不做总量 COUNT；非快照分页。删除游标对应记录后返回 InvalidCursor 400，不静默重置到第一页。",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^J[a-f0-9]{32}$"
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "preparing",
                "ready",
                "leased",
                "running",
                "verifying",
                "publishing",
                "succeeded",
                "failed",
                "cancelled",
                "superseded"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功；不包含安装包下载 URL、证书或私有内部信息",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "items",
                        "next_cursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Job"
                          }
                        },
                        "next_cursor": {
                          "oneOf": [
                            {
                              "type": "null"
                            },
                            {
                              "type": "string",
                              "pattern": "^J[a-f0-9]{32}$"
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      },
      "post": {
        "operationId": "createJob",
        "summary": "提交企业签名任务",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "description": "先确认签名套餐已开通，并从版本列表取最新可签原包的 V 标识。提交后立即保存返回的 J 标识，再查询任务进度。可以使用应用当前证书，或显式选择同套餐的可用证书。",
        "responses": {
          "200": {
            "description": "成功受理；异步操作须继续查询状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/JobAccepted"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/JobInput"
              }
            }
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    },
    "/api/v1/apps/{app_id}/jobs/{job_id}": {
      "get": {
        "operationId": "getJob",
        "summary": "查询签名任务进度",
        "description": "传入提交任务返回的 J 和对应的 A。用 terminal 判断是否已结束，再读取 status 和 error。进度百分比只供展示。成功后通过 getJobResult 查询该 J 对应的签名版本，避免并发任务取错包。\n\n需要 enterprise:ReadJobs 及应用范围；仅当前应用所有者发起的 enterprise 任务，不包含其他用户、prepare/device 任务或原始错误详情。按 created_at、随机任务 ID 倒序分页，状态变化不使当前应用内的游标失效。 详情不接受查询参数。",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^J[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功；不包含安装包下载 URL、证书或私有内部信息",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Job"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    },
    "/api/v1/apps/{app_id}/uploads": {
      "post": {
        "operationId": "createUpload",
        "summary": "创建版本上传",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "description": "为企业签名或普通分发应用创建上传任务。推荐使用 SDK 上传助手，自动完成分片、传输与确认，无需选择存储厂商或填写后台存储配置。自行实现 HTTP 时，通用分片流程提交 transfer_mode=multipart；整包方式提交文件摘要。立即保存响应 data.id，它就是上传任务 ID，后续查询、申请凭证、确认分片及恢复上传均使用此值。任务创建成功不代表安装包已保存为版本。",
        "responses": {
          "200": {
            "description": "成功受理；异步操作须继续查询状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Upload"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "$ref": "#/components/schemas/UploadInput"
                  },
                  {
                    "$ref": "#/components/schemas/MultipartUploadInput"
                  }
                ]
              }
            }
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      },
      "get": {
        "operationId": "listUploads",
        "summary": "列出应用上传任务",
        "description": "查询企业签名或普通分发应用的上传记录，按 created_at、上传任务 ID倒序分页，支持 state 筛选。可找回上传中、等待校验或已结束的任务，继续查询进度或恢复同一个上传。\n\n只返回当前账号、当前业务 A 且由当前 API 应用创建的记录。需对应模块 UploadVersions 和写入准入；AKT 只读会话不可调用。OAuth 还须独立终端上传授权，且只能查询用户授权的既有应用。每页 1–100 条，不执行全量 COUNT，不返回对象路径、存储账号、URL 或凭据。保留 U 的情况下也可直接查询上传详情。状态变化不使当前应用内的游标失效；已清理、其他业务应用或其他 API 应用的游标返回 InvalidCursor。新应用上传校验成功前，用创建预留返回的 A 查询，并保持原 API 应用。",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^U[a-f0-9]{32}$"
            }
          },
          {
            "name": "state",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "uploading",
                "validating",
                "succeeded",
                "failed",
                "cancelled"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功；不包含安装包下载 URL、证书或私有内部信息",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "type": "object",
                      "required": [
                        "items",
                        "next_cursor"
                      ],
                      "additionalProperties": false,
                      "properties": {
                        "items": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/Upload"
                          }
                        },
                        "next_cursor": {
                          "oneOf": [
                            {
                              "type": "null"
                            },
                            {
                              "type": "string",
                              "pattern": "^U[a-f0-9]{32}$"
                            }
                          ]
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/uploads/{upload_id}": {
      "get": {
        "operationId": "getUpload",
        "summary": "查询上传和校验进度",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^U[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "description": "通过创建上传响应 data.id 中的上传任务 ID查看 state、expires_at 和 version_id。提交整包校验后查询此接口，取得版本 ID 后再发布或签名。如果失败，保留 error_code 和 request_id。",
        "responses": {
          "200": {
            "description": "成功受理；异步操作须继续查询状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Upload"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/uploads/{upload_id}/ticket": {
      "get": {
        "operationId": "getUploadTicket",
        "summary": "获取整包上传凭证",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^U[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "description": "用于整包上传。按 ticket 指定的地址、方法和签名请求头上传原始文件字节，再提交整包校验。向存储发请求时只发送票据要求的头，平台 AccessKey 仅用于平台 API。",
        "responses": {
          "200": {
            "description": "成功受理；异步操作须继续查询状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/UploadTicket"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/uploads/{upload_id}/complete": {
      "post": {
        "operationId": "completeUpload",
        "summary": "提交整包校验",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^U[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "description": "上传全部字节后用空对象提交。分片模式先确认每一片。这个调用提交后台校验，得到回执后仍须查询上传状态，等待可用的 version_id。",
        "responses": {
          "200": {
            "description": "成功受理；异步操作须继续查询状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Upload"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [],
                "properties": {}
              }
            }
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/uploads/{upload_id}/abort": {
      "post": {
        "operationId": "abortUpload",
        "summary": "取消未完成上传",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^U[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "description": "用户放弃上传时，使用原 U 和一个独立的幂等键取消。先查上传状态，已进入后续处理的上传可能无法取消。",
        "responses": {
          "200": {
            "description": "成功受理；异步操作须继续查询状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Upload"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [],
                "properties": {}
              }
            }
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/uploads/{upload_id}/parts": {
      "get": {
        "operationId": "listUploadParts",
        "summary": "查询已申报的分片",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^U[a-f0-9]{32}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          },
          {
            "name": "after",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1024,
              "default": 0
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "description": "断点续传时按 U 查询分片序号、摘要和 uploaded。只跳过已经确认且摘要匹配的分片。继续分页时传 next_after，确认完所有分片再提交整包校验。",
        "responses": {
          "200": {
            "description": "成功受理；异步操作须继续查询状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/UploadParts"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      },
      "post": {
        "operationId": "declareUploadPart",
        "summary": "申报分片摘要",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^U[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "description": "按任务返回的 part_size_bytes 切分原始文件，从 1 开始为每片计算 SHA-256 并申报。同一 U 下同一序号的内容应始终一致，随后为该片申请上传凭证。",
        "responses": {
          "200": {
            "description": "成功受理；异步操作须继续查询状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/UploadPart"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadPartInput"
              }
            }
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/uploads/{upload_id}/parts/{part_number}/ticket": {
      "get": {
        "operationId": "getUploadPartTicket",
        "summary": "获取分片上传凭证",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^U[a-f0-9]{32}$"
            }
          },
          {
            "name": "part_number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1024
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "description": "为已声明的分片申请短期上传指令。将结果交给 SDK 自动传输，无需识别或配置底层存储。自行实现 HTTP 时，严格按照返回的方法、请求头或表单字段发送原分片。传输完成后仍须确认分片，不能仅凭文件传输成功开始发布。",
        "responses": {
          "200": {
            "description": "成功受理；异步操作须继续查询状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/UploadPartTicket"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/uploads/{upload_id}/parts/{part_number}/complete": {
      "post": {
        "operationId": "completeUploadPart",
        "summary": "确认分片已上传",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^U[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          },
          {
            "name": "part_number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1024
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "description": "存储返回成功后调用。若传输响应丢失，先确认同一分片。收到 PartMissing 再获取票据补传。确认成功仅代表该片可用于后续整包校验。",
        "responses": {
          "200": {
            "description": "成功受理；异步操作须继续查询状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/UploadPart"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [],
                "properties": {}
              }
            }
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/sessions": {
      "get": {
        "operationId": "listSessions",
        "summary": "列出已签发的只读凭据",
        "description": "使用签发凭据的父 AKP，读取当前 API 应用在指定业务应用下的会话状态、到期时间和最近使用时间。可从列表获取撤销所需的 AKT 标识。",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^AKT[a-f0-9]{40}$"
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "responses": {
          "200": {
            "description": "查询成功；不包含安装包下载 URL、证书或私有内部信息",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/SessionList"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "接入与授权"
        ],
        "x-cloudsign-products": [
          "access"
        ]
      },
      "post": {
        "operationId": "createSession",
        "summary": "签发单应用只读凭据",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "description": "为一个自有应用签发 AKT，选择父密钥已具备的只读动作、时长、网络和限额。首次成功立即安全保存完整 credentials。响应丢失时先查会话并撤销，再用新幂等键签发。",
        "responses": {
          "200": {
            "description": "成功受理；异步操作须继续查询状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/SessionIssued"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SessionInput"
              }
            }
          }
        },
        "tags": [
          "接入与授权"
        ],
        "x-cloudsign-products": [
          "access"
        ]
      }
    },
    "/api/v1/apps/{app_id}/sessions/{session_id}/revoke": {
      "post": {
        "operationId": "revokeSession",
        "summary": "撤销单个只读凭据",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          },
          {
            "name": "session_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^AKT[a-f0-9]{40}$"
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "description": "从会话列表取得 AKT 标识，在路径中同时指定对应的业务应用，正文传空对象。撤销成功后该会话不能继续读取应用数据。",
        "responses": {
          "200": {
            "description": "成功受理；异步操作须继续查询状态",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/SessionRevoked"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        "tags": [
          "接入与授权"
        ],
        "x-cloudsign-products": [
          "access"
        ]
      }
    },
    "/api/v1/apps/{app_id}/download-tickets": {
      "post": {
        "operationId": "createDownloadTicket",
        "summary": "申请原包或签名包下载链接",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "description": "指定 A、V 和 package_type。第一次成功时立即保存 ticket，按其 method、url 和 headers 下载，并比对 size_bytes。幂等重放仅返回回执。链接到期后需用新的业务幂等键申请。文件传输服务由平台自动处理，调用方不选择存储厂商。\n\n账号需开通对应下载能力，原包与签名包分别授权；API 应用分别授予 DownloadOriginal / DownloadSigned，绑定自己的完整应用及版本。时长为 60–300 秒，受账号上限及 AKP 到期时间约束。AKT 及超级签名不支持。不会发布、扣费或增加安装/下载统计。重复幂等请求只返回 ticket=null 的回执，不重新签发链接。已发出存储链接在期限内可重复使用，撤销平台 AKP 不能保证即时撤回该链接；过期只阻止新下载请求，不强制中断正在进行的传输。没有 HEAD/内容校验，存储缺失可能在 GET 时返回 404，须与预期大小比对；本响应不宣称提供内容摘要。",
        "responses": {
          "200": {
            "description": "首次返回短期链接；重复请求返回相同回执且 ticket=null。响应不得缓存。",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/DownloadReceipt"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version_id",
                  "package_type",
                  "duration_seconds"
                ],
                "properties": {
                  "version_id": {
                    "type": "string",
                    "pattern": "^V[a-f0-9]{32}$"
                  },
                  "package_type": {
                    "type": "string",
                    "enum": [
                      "original",
                      "signed"
                    ]
                  },
                  "duration_seconds": {
                    "type": "integer",
                    "minimum": 60,
                    "maximum": 300
                  }
                }
              }
            }
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/distribution-settings": {
      "get": {
        "operationId": "getDistributionSettings",
        "summary": "读取分发下载页设置",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "responses": {
          "200": {
            "description": "成功；响应禁止缓存。版本冲突须重新读取并由调用方确认，禁止 SDK 自动覆盖。",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/DistributionSettings"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "查询当前模板、语言、介绍和 revision。下拉选择请使用返回的 available_template_ids 和 available_languages，保存设置时带回 revision。\n\n须单独授予 distribution:ReadSettings。只支持普通应用分发，返回当前模板、语言、纯文本介绍、内容版本标识和可用选项；可使用显式授予此动作的指定应用只读 AKT。",
        "tags": [
          "应用分发"
        ],
        "x-cloudsign-products": [
          "distribution"
        ]
      },
      "post": {
        "operationId": "updateDistributionSettings",
        "summary": "修改分发下载页设置",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          }
        ],
        "responses": {
          "200": {
            "description": "成功；响应禁止缓存。版本冲突须重新读取并由调用方确认，禁止 SDK 自动覆盖。",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/DistributionSettingsUpdated"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DistributionSettingsInput"
              }
            }
          }
        },
        "description": "将最近读取的 revision 与模板、语言、纯文本介绍一并提交。介绍转义后最多 255 个字符。成功后读取 settings 获取新版本。遇到修订冲突先展示最新设置供确认。\n\n仅 AKP；账号已开通分发设置修改，并且 API 应用授予 distribution:UpdateSettings。必须提交全部四个字段，拒绝未知/重复字段。模板 1–8，语言来自读取结果，介绍按纯文本转义后须不超过 255 字符。版本标识绑定当前应用及三个字段原始内容，网页保存变更后返回 RevisionConflict 409。成功回执在同一事务保存；相同幂等键和字节返回旧回执并标记 replayed=true，不再次修改，也不覆盖之后的网页保存。读取与修改权限独立，未开放上传/签名写入不影响单独审批的设置修改。锁定、删除、封停、跨账号和超级签名均禁止修改；不改短链、密码、文件、计费或安装规则。",
        "tags": [
          "应用分发"
        ],
        "x-cloudsign-products": [
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/statistics": {
      "get": {
        "operationId": "getAppStatistics",
        "summary": "查询应用安装、启动与下载统计",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "responses": {
          "200": {
            "description": "成功；禁止缓存。daily 为升序 30 日；end_date 含今日，end_at 为明日 00:00 的排他上界。",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/AppStatistics"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "查看累计、今日和近 30 日趋势。应用总安装按准入设备指纹跨版本去重，启动是联网记录的事件次数。查看 installation_statistics_state 区分可用、未初始化、不适用，null 表示无可用计数。\n\n账号需开通统计查询，并显式授予 enterprise:ReadStatistics 或 distribution:ReadStatistics。固定近 30 个 Asia/Shanghai 自然日，不接受查询参数。允许显式授予统计动作的指定应用 AKT。下载为现有准入计数，非下载完成或唯一设备；安装按应用设备指纹去重，不累加版本计数。首次打开计入当前启动规则；历史总启动可能不含首次，迁移当日标注估计。不返回历史每日启动以免伪造趋势。计数受现有重置与留存影响，不承诺永久累计。未初始化安装统计返回 null/state；缺失表/索引、超查询上限或不安全数值返回 StatisticsUnavailable(503)，不扫描设备表补算。账号默认关闭、10 次/分钟，可设 1–60；全局统计 600 次/分钟，并继续受一般限流。",
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/pricing": {
      "get": {
        "operationId": "getAppPricing",
        "summary": "列出套餐和按天价格",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "responses": {
          "200": {
            "description": "成功；禁止缓存。产品 SKU 必须在对应模块使用；签名月套餐每月按现有 30 日计算，分发会员按一年服务规则。",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/AppPricing"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "查询本账号在该应用上的套餐 SKU、金额单位、按天范围和退款规则。显示价格时保留金额字符串及返回的单位。选好 SKU 后可查询参考价或创建购买报价。\n\n须显式授予对应模块 ReadPricing，可使用明确授予此动作的单应用 AKT。按当前账号专属价/全局折扣和后台配置计算，不读网页登录身份。每个账号所有 API 应用/密钥共用 30 次/分钟，仍受一般限流。两位小数金额为字符串，currency 是站内展示单位，外部结算依支付服务商。pricing_revision 是本次价格内容指纹，不是财务报价票据；reference_only=true、payment_api_available=false。不创建订单、扣款、锁价或承诺库存/可购买/可退款，后续真实支付须重新确认。 此参考响应的 payment_api_available=false 不表示购买报价接口不存在；真实购买须另行创建 purchase-quotes，不能直接支付此参考结果。",
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/quote": {
      "get": {
        "operationId": "getAppQuote",
        "summary": "查询套餐参考价",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          },
          {
            "name": "sku",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^(?:[1-6]|100[1-4]|300[1-4]|day[123])$"
            }
          },
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "仅 day1/day2/day3 必须提供；实际范围取当前配置，其他套餐禁止携带。",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 3650
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功；禁止缓存。产品 SKU 必须在对应模块使用；签名月套餐每月按现有 30 日计算，分发会员按一年服务规则。",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/AppQuote"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "传入价格列表中的 sku。按天 SKU 还要传 days。此查询用于界面试算，真正付款要先创建带 Q 标识的购买报价。\n\n须显式授予对应模块 ReadPricing，可使用明确授予此动作的单应用 AKT。按当前账号专属价/全局折扣和后台配置计算，不读网页登录身份。每个账号所有 API 应用/密钥共用 30 次/分钟，仍受一般限流。两位小数金额为字符串，currency 是站内展示单位，外部结算依支付服务商。pricing_revision 是本次价格内容指纹，不是财务报价票据；reference_only=true、payment_api_available=false。不创建订单、扣款、锁价或承诺库存/可购买/可退款，后续真实支付须重新确认。 此参考响应的 payment_api_available=false 不表示购买报价接口不存在；真实购买须另行创建 purchase-quotes，不能直接支付此参考结果。",
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/creation": {
      "get": {
        "operationId": "getAppCreation",
        "summary": "查询应用创建进度",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          }
        ],
        "description": "使用预留新应用返回的 A 标识查询预留状态及截止时间。首次上传完成后，用同一 A 查询正式应用详情。请使用创建该预留的 API 应用。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/Creation"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/metadata": {
      "get": {
        "operationId": "getAppMetadata",
        "summary": "读取名称、备注与修订号",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          }
        ],
        "description": "修改应用资料前调用，保存返回的 revision、name 和 remark。提交修改时带回该 revision，以免覆盖网页或其他接入程序的新改动。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/AppMetadata"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      },
      "post": {
        "operationId": "updateAppMetadata",
        "summary": "修改应用名称与备注",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          }
        ],
        "description": "先读取最新资料，再同时提交 revision、name、remark。已开通企业签名的应用只可修改备注，此时 name 传原名称。成功后保存新的 revision。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/AppMetadata"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "revision",
                  "name",
                  "remark"
                ],
                "properties": {
                  "revision": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "remark": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/publish": {
      "post": {
        "operationId": "publishVersion",
        "summary": "发布或回滚指定版本",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          }
        ],
        "description": "先列出版本，取目标 version_id 和当前发布的 current_version_id。普通分发可切换到对应历史包，企业签名可回滚到符合设备验证要求的已签名历史包。并发发布时重新读取当前版本并让用户确认。\n\n普通分发发布原包或企业签名受控回滚。分别需要 distribution:PublishVersions / enterprise:PublishVersions，以及应用管理审批。企业包须为同证书、未停用、具有独立安装验证的签名包；保留原包、设备及统计身份。当前版本条件与事务幂等防止并发覆盖。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PublishedVersion"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "version_id",
                  "current_version_id"
                ],
                "properties": {
                  "version_id": {
                    "type": "string"
                  },
                  "current_version_id": {
                    "type": "string",
                    "pattern": "^(?:V[a-f0-9]{32})?$"
                  }
                }
              }
            }
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/trash": {
      "post": {
        "operationId": "trashApp",
        "summary": "确认删除应用",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          }
        ],
        "description": "在业务界面向用户确认后，将路径中的完整 A 标识同时传入 confirm_app_id。成功后应用退出用户列表，文件保留。企业签名应用进入回收站。\n\n普通分发或企业签名确认删除，分别需要独立的 distribution:TrashApps / enterprise:TrashApps 动作及应用管理审批。confirm_app_id 须等于路径。保留安装包和历史记录，不物理删除云文件。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/TrashedApp"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "confirm_app_id"
                ],
                "properties": {
                  "confirm_app_id": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/billing/balance": {
      "get": {
        "operationId": "getBalance",
        "summary": "查询账号可用余额",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          }
        ],
        "description": "读取本账号的 available、站内金额单位与观测时间。金额为十进制字符串，展示和记账应保留小数精度。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/AccountBalance"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "账号与账单"
        ],
        "x-cloudsign-products": [
          "account"
        ]
      }
    },
    "/api/v1/billing/orders": {
      "get": {
        "operationId": "listOrders",
        "summary": "查询账号订单",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^O[a-f0-9]{32}$"
            }
          }
        ],
        "description": "按状态分页查询本人订单。保存 next_cursor 查询下一页。订单描述、支付方式和金额均按返回值展示，后台充值是订单的支付来源之一。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/AccountOrders"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "账号与账单"
        ],
        "x-cloudsign-products": [
          "account"
        ]
      }
    },
    "/api/v1/billing/ledger": {
      "get": {
        "operationId": "listLedger",
        "summary": "查询账号资金流水",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^L[a-f0-9]{32}$"
            }
          }
        ],
        "description": "分页读取有真实记录的变动前余额、变动额和变动后余额。历史数据覆盖范围见 historical_complete，原样使用返回的游标。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/AccountLedger"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "账号与账单"
        ],
        "x-cloudsign-products": [
          "account"
        ]
      }
    },
    "/api/v1/apps/{app_id}/purchase-quotes": {
      "post": {
        "operationId": "createPurchaseQuote",
        "summary": "创建开通或续费报价",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          }
        ],
        "description": "选定 SKU 和天数后创建五分钟保价报价。保存 Q 标识、金额、pricing_revision 与 currency.revision，向用户展示并确认后再调用余额付款。\n\n仅限父 AKP；账号付款许可、用户 API 应用预算、显式动作及资源归属独立校验。新能力默认关闭，既有密钥不自动获得权限。报价和付款均不自动提交签名任务；签名须另外授予 CreateJobs 并显式提交。 另需对应模块 ReadPricing 和 CreatePurchaseQuotes。报价采用当前付款账号价格，五分钟内按原报价金额支付；不预扣或占用余额。day 套餐须提供字符串 days，其他套餐不得提供。普通分发购买的是账号点数/会员权益，不限制于此应用。每个账号最多 100 个未使用报价。 账务对账隔离期间返回 PaymentQuarantined，请保留原订单与 request_id 联系平台复核；修改预算不能解除隔离。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PurchaseQuote"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseQuoteInput"
              }
            }
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/purchase-quotes/{quote_id}": {
      "get": {
        "operationId": "getPurchaseQuote",
        "summary": "查询购买报价及付款结果",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "quote_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^Q[a-f0-9]{32}$"
            }
          }
        ],
        "description": "按 Q 查询报价是否到期或已消费。付款响应丢失时先查原报价。包含完整付款回执还须具备付款动作且来源 IP 满足付款条件。\n\n仅限父 AKP；账号付款许可、用户 API 应用预算、显式动作及资源归属独立校验。新能力默认关闭，既有密钥不自动获得权限。报价和付款均不自动提交签名任务；签名须另外授予 CreateJobs 并显式提交。 须对应模块 CreatePurchaseQuotes，只能查询本 API 应用创建的报价。已付款回执是付款时快照，后续网页退款以订单状态与当前应用权益为准；不会重新发放权益。 已支付报价的完整 receipt 包含付款时余额，额外要求当前模块 PayOrders 与明确付款 IP 白名单；仅报价权限时返回 paid 状态和 receipt=null。回执为历史快照，不能替代当前权益查询。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PurchaseQuote"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/apps/{app_id}/purchase-quotes/{quote_id}/pay": {
      "post": {
        "operationId": "payPurchaseQuote",
        "summary": "使用余额支付购买报价",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "quote_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^Q[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/FinancialIdempotency"
          }
        ],
        "description": "按用户确认的原报价提交 balance、金额与两个修订号。成功后余额扣减并发放对应权益。开通企业签名后，另行提交签名任务。请求超时应先查原 Q。\n\n仅限父 AKP；账号付款许可、用户 API 应用预算、显式动作及资源归属独立校验。新能力默认关闭，既有密钥不自动获得权限。报价和付款均不自动提交签名任务；签名须另外授予 CreateJobs 并显式提交。 须对应模块 PayOrders；来源须匹配 IPv4 /24 或更精确、IPv6 /64 或更精确的白名单。严格确认金额字符串、价格版本和金额单位版本，余额、订单、权益、退款快照、预算和长期回执在同一事务提交。余额不足、报价过期、应用/权益变化或预算不足均不扣款。两层预算按 Asia/Shanghai 的 API 成功付款总额计算，退款不返还预算；金额单位变化须重新审批。支付响应丢失时使用原幂等键重试或 GET 原报价，禁止盲目另建付款。 新付款因账务不一致可被隔离；具有当前付款权限的原成功幂等回执仍可查询。付款和 API 来源的网站退款在同一资金事务登记可靠财务通知。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PurchaseReceipt"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseConfirmation"
              }
            }
          }
        },
        "tags": [
          "企业签名",
          "应用分发"
        ],
        "x-cloudsign-products": [
          "enterprise",
          "distribution"
        ]
      }
    },
    "/api/v1/billing/budget": {
      "get": {
        "operationId": "getPaymentBudget",
        "summary": "查询费用预算与剩余额度",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          }
        ],
        "description": "分别查看账号与本 API 应用的单笔上限、日/月已用与剩余预算。付款同时受两层额度约束，余额与预算请分别查询。\n\n仅父 AKP；须独立 billing:ReadBudget、全部资源范围及账号财务读取许可。查询账号和当前 API 应用预算，不授予扣款权限，不返回其他 API 应用详情。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/PaymentBudget"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "账号与账单"
        ],
        "x-cloudsign-products": [
          "account"
        ]
      }
    },
    "/api/v1/apps/{app_id}/orders/{order_id}/refund": {
      "get": {
        "operationId": "getOrderRefund",
        "summary": "查询订单退款资格",
        "description": "从原购买回执取得 O 标识，仅可查询当前 API 应用创建的企业签名余额订单。读取 eligible、deadline 和确认条件。提交退款响应丢失时回到这里查询 receipt。\n\n仅支持当前 API 应用创建的企业签名余额订单。同一用户的其他 API 应用、网站订单、密钥开通及普通分发不在此接口范围。需要独立 ReadRefunds / RefundOrders 动作及精确 IP 白名单，禁止 AKT。账号需已开通退款能力，执行网站当前退款时限、按天开关、账号日/月/累计次数及应用唯一安装设备上限。确认原金额和金额单位，退回原付款账号站内余额并撤销该笔权益，保留其他续费，不恢复 API 付款预算。金额单位变化、账务隔离和已删除应用拒绝新退款。丢失响应先 GET 同一地址，或使用原幂等键重试；原持久回执在关闭新退款后仍可查询，更换幂等键不会再次退款。回执、余额、权益、流水与 refund.completed outbox 同事务提交。GET 的 eligible 仅代表查询时刻，POST 重新检查当前规则。",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^O[a-f0-9]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/OrderRefund"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      },
      "post": {
        "operationId": "refundOrder",
        "summary": "确认退款并撤销签名权益",
        "description": "先取得退款资格并向用户确认原金额和单位。成功后全额退回原付款账号的站内余额并撤销该笔签名权益，保留其他续费。时限、按天规则、次数和唯一设备数按网站当前政策判断。\n\n仅支持当前 API 应用创建的企业签名余额订单。同一用户的其他 API 应用、网站订单、密钥开通及普通分发不在此接口范围。需要独立 ReadRefunds / RefundOrders 动作及精确 IP 白名单，禁止 AKT。账号需已开通退款能力，执行网站当前退款时限、按天开关、账号日/月/累计次数及应用唯一安装设备上限。确认原金额和金额单位，退回原付款账号站内余额并撤销该笔权益，保留其他续费，不恢复 API 付款预算。金额单位变化、账务隔离和已删除应用拒绝新退款。丢失响应先 GET 同一地址，或使用原幂等键重试；原持久回执在关闭新退款后仍可查询，更换幂等键不会再次退款。回执、余额、权益、流水与 refund.completed outbox 同事务提交。GET 的 eligible 仅代表查询时刻，POST 重新检查当前规则。",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^O[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/FinancialIdempotency"
          }
        ],
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/RefundReceipt"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundConfirmation"
              }
            }
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    },
    "/api/v1/apps/{app_id}/capacity-quotes": {
      "post": {
        "operationId": "createCapacityQuote",
        "summary": "创建安装量扩容报价",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          }
        ],
        "description": "给设有安装上限的企业签名应用增加 1 至 100000 个名额。先取得五分钟报价，核对原上限、新上限、单价和总额，再确认付款。\n\n仅限自有企业签名 IPA 应用，账号扩容购买许可、CreateCapacityQuotes / PayCapacity 动作及 API 账号和应用两层费用预算。付款要求精确 IP 白名单，禁止 AKT。增加 1–100000 台，沿用当前网站扩容单价，报价有效五分钟且不预扣款；单价、金额单位、应用状态或安装上限变化后须重新报价。不限安装量、未注入平台动态库、封停、过期或回收站应用拒绝新购买。只增加安装上限，保留设备统计和签名有效期；扩容不支持退款。独立扩容购买记录、资金流水、API 预算、持久回执与 capacity.purchased 事件同事务提交。与普通开通续费共用 API 总支出预算，单独回执不在普通 paylog 订单列表中，查询原报价恢复结果。关闭新扩容后原成功回执仍可按当前权限查询；重试保留原财务幂等键，不得换键重复付款。只具报价权限的 GET 不返回余额回执；有 PayCapacity 且精确 IP 获准才返回。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/CapacityQuote"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CapacityInput"
              }
            }
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    },
    "/api/v1/apps/{app_id}/capacity-quotes/{quote_id}": {
      "get": {
        "operationId": "getCapacityQuote",
        "summary": "查询扩容报价及付款回执",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "quote_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^Q[a-f0-9]{32}$"
            }
          }
        ],
        "description": "使用扩容报价 Q 查询当前状态、原上限和新上限。扩容有独立购买回执。读取完整付款回执还需付款权限和匹配的来源 IP。\n\n仅限自有企业签名 IPA 应用，账号扩容购买许可、CreateCapacityQuotes / PayCapacity 动作及 API 账号和应用两层费用预算。付款要求精确 IP 白名单，禁止 AKT。增加 1–100000 台，沿用当前网站扩容单价，报价有效五分钟且不预扣款；单价、金额单位、应用状态或安装上限变化后须重新报价。不限安装量、未注入平台动态库、封停、过期或回收站应用拒绝新购买。只增加安装上限，保留设备统计和签名有效期；扩容不支持退款。独立扩容购买记录、资金流水、API 预算、持久回执与 capacity.purchased 事件同事务提交。与普通开通续费共用 API 总支出预算，单独回执不在普通 paylog 订单列表中，查询原报价恢复结果。关闭新扩容后原成功回执仍可按当前权限查询；重试保留原财务幂等键，不得换键重复付款。只具报价权限的 GET 不返回余额回执；有 PayCapacity 且精确 IP 获准才返回。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/CapacityQuote"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    },
    "/api/v1/apps/{app_id}/capacity-quotes/{quote_id}/pay": {
      "post": {
        "operationId": "payCapacityQuote",
        "summary": "使用余额购买安装量",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "quote_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^Q[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/FinancialIdempotency"
          }
        ],
        "description": "按用户确认的金额与修订号付款。成功后检查 new_max，超限设备可在下次验证时按新上限办理准入。本次只增加安装额度，扩容不支持退款。\n\n仅限自有企业签名 IPA 应用，账号扩容购买许可、CreateCapacityQuotes / PayCapacity 动作及 API 账号和应用两层费用预算。付款要求精确 IP 白名单，禁止 AKT。增加 1–100000 台，沿用当前网站扩容单价，报价有效五分钟且不预扣款；单价、金额单位、应用状态或安装上限变化后须重新报价。不限安装量、未注入平台动态库、封停、过期或回收站应用拒绝新购买。只增加安装上限，保留设备统计和签名有效期；扩容不支持退款。独立扩容购买记录、资金流水、API 预算、持久回执与 capacity.purchased 事件同事务提交。与普通开通续费共用 API 总支出预算，单独回执不在普通 paylog 订单列表中，查询原报价恢复结果。关闭新扩容后原成功回执仍可按当前权限查询；重试保留原财务幂等键，不得换键重复付款。只具报价权限的 GET 不返回余额回执；有 PayCapacity 且精确 IP 获准才返回。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/CapacityReceipt"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseConfirmation"
              }
            }
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    },
    "/api/v1/apps/{app_id}/versions/{version_id}/statistics": {
      "get": {
        "operationId": "getVersionStatistics",
        "summary": "查询单个签名版本统计",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "version_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^V[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "responses": {
          "200": {
            "description": "成功；禁止缓存。daily 为升序 30 日；end_date 含今日，end_at 为明日 00:00 的排他上界。",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/VersionStatistics"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "description": "用同一企业签名应用的 A 与 V 查询该次签名的今日和累计安装、启动量。当前规则包含首次打开。旧数据按 statistics_scope 标出合并口径，版本设备数相加不能得到应用的唯一设备数。\n\n仅企业签名；独立 enterprise:ReadVersionStatistics 动作、指定自有应用范围与账号统计准入，不隐含 ReadVersions 或应用级 ReadStatistics。绑定 A/V 标识，共用应用统计的分钟额度；允许显式授予此动作的单应用只读 AKT。只返回原生保留的总量和今日计数，首次打开计入当前启动规则；旧包 merged/merged_member 保留合并口径，disabled/source 无独立计数时返回 null。版本设备数跨版本不去重，不能相加替代应用唯一设备总量。不扫描或导出设备/IP，不补造历史日趋势；日期固定 Asia/Shanghai，缺表/索引或异常计数返回 StatisticsUnavailable 503。",
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    },
    "/api/v1/apps/{app_id}/certificates": {
      "get": {
        "operationId": "listSigningCertificates",
        "summary": "列出可选签名证书",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          }
        ],
        "description": "取得当前应用套餐可选的证书公开标识、备注和有效期。selected 标记当前选择。需要切换证书时，把返回的 C 标识用于提交签名任务。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/SigningCertificates"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    },
    "/api/v1/apps/{app_id}/signing-parameters": {
      "get": {
        "operationId": "getSigningParameters",
        "summary": "读取签名参数",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          }
        ],
        "description": "读取企业签名应用的 Bundle ID、Keychain 与去插件选项及 revision。只需查看时授予读权限即可。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/SigningParameters"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      },
      "post": {
        "operationId": "updateSigningParameters",
        "summary": "保存签名参数",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          }
        ],
        "description": "用最近读取的 revision 提交支持的参数值，成功后对新签名任务生效。需要签名时另行创建任务。遇到 RevisionConflict 时重新读取并核对差异。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/SigningParameters"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SigningParametersInput"
              }
            }
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    },
    "/api/v1/signing/batches": {
      "post": {
        "operationId": "createSigningBatch",
        "summary": "批量提交签名任务",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          }
        ],
        "description": "单次最多提交 10 个不同自有应用，各指定最新可签原包。整批通过后为每项返回 J 标识，任一项失败时整批回滚。用同一幂等键恢复一次批量提交的回执。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/SigningBatchAccepted"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SigningBatchInput"
              }
            }
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    },
    "/api/v1/apps/{app_id}/devices": {
      "get": {
        "operationId": "listDevices",
        "summary": "列出已登记设备",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:F(?:[a-f0-9]{24,64}|[a-f0-9]{8}-[a-f0-9]{16}|instance:[a-f0-9]{40}))?$"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 45
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "description": "按页读取应用内设备指纹、首次与最近记录和留存启动次数。每页最多 100 行。network_visible 表示能否读取网络字段，设备标识用于安装统计。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/DeviceList"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    },
    "/api/v1/apps/{app_id}/overflow": {
      "get": {
        "operationId": "listOverflowDevices",
        "summary": "查询超限安装记录",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^(?:F(?:[a-f0-9]{24,64}|[a-f0-9]{8}-[a-f0-9]{16}|instance:[a-f0-9]{40}))?$"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "pending",
                "recovered"
              ]
            }
          },
          {
            "name": "ip",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 45
            }
          },
          {
            "name": "region",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          }
        ],
        "description": "查看安装量达到上限后的设备尝试，按 pending 或 recovered 区分尚待准入与已恢复的记录，分别读取设备标识和尝试次数。每页最多 100 行。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/OverflowDeviceList"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    },
    "/api/v1/apps/{app_id}/devices/export": {
      "post": {
        "operationId": "exportDevices",
        "summary": "导出一页设备明细",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/Idempotency"
          }
        ],
        "description": "选择登记或超限数据源，每次最多导出 500 行 JSONL。首次成功时解码 content_base64 并核对 SHA-256，保存 next_cursor 后再取下一页。幂等重放只返回回执。",
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/DeviceExport"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeviceExportInput"
              }
            }
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    },
    "/api/v1/apps/{app_id}/signing-entitlement": {
      "get": {
        "operationId": "getSigningEntitlement",
        "summary": "查询完整签名权益",
        "description": "读取本人企业签名应用的套餐、有效期、锁定/审核状态、已分配证书公开信息、应用级安装量上限、后续签名验证配置和退款政策。统计仅在同时授予 enterprise:ReadStatistics 并通过现有统计准入时返回，否则为 null；不得把未知统计当作零。首次记录开通时间缺失为 null。证书不包含 P12、密码、描述文件或内部路径。仅父 AKP；当前查询不预留任务资格，不改变权益。",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/SigningEntitlement"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    },
    "/api/v1/apps/{app_id}/signing-redemptions": {
      "post": {
        "operationId": "redeemSigningKey",
        "summary": "核销密钥开通或续费签名",
        "description": "仅受信服务端父 AKP。账号需开通密钥核销和写入，再为 API 应用授予 enterprise:RedeemKeys、本人 A 资源及 IPv4 /24 或更精确、IPv6 /64 或更精确的 IP 白名单。密钥决定套餐及 30/90/360 天时长，传入 confirm_non_refundable=true。核销、权益台账和不含密钥的持久 E 回执同事务提交。不同账号、不同应用和重复新幂等键都不能再次延长；响应丢失用原幂等键及完全相同正文重试，已知 E 可查询回执。每账号每分钟 5 次尝试，错误也计数。此处的开通密钥不是 AccessKey，不生成或列出密钥，不扣余额，不支持退款，不自动签名。使用不同幂等键重试将返回 CodeAlreadyRedeemed。",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/FinancialIdempotency"
          }
        ],
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/SigningRedemptionReceipt"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SigningRedemptionInput"
              }
            }
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    },
    "/api/v1/apps/{app_id}/signing-redemptions/{redemption_id}": {
      "get": {
        "operationId": "getSigningRedemption",
        "summary": "查询密钥核销回执",
        "description": "需要 enterprise:ReadRedemptions 和本人 A 资源，使用创建该回执的同一个 API 应用父 AKP。支持该 API 应用下父密钥轮换；其他 API 应用、其他账号或业务应用返回 404。关闭新核销审批后仍可查询原回执。返回原始授予快照，不是当前有效期；用 getSigningEntitlement 查询当前权益。不返回开通密钥、内部密钥 ID、余额或存储配置。已删除或转移出本人账号的应用不再允许查询。",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "redemption_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^E[a-f0-9]{32}$"
            },
            "description": "从本 API 应用原核销响应取得的完整 E 标识。"
          }
        ],
        "responses": {
          "200": {
            "description": "成功；禁止缓存",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/SigningRedemptionReceipt"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    },
    "/api/v1/apps/{app_id}/jobs/{job_id}/result": {
      "get": {
        "operationId": "getJobResult",
        "summary": "查询签名任务对应的准确产物",
        "description": "使用提交任务返回的 A 和 J，获取该任务输入的原包版本和实际发布的签名版本。须同时授予 enterprise:ReadJobs 与 enterprise:ReadVersions，并满足应用、平台及项目授权范围。支持范围内的只读临时凭据与 OAuth。仅可查询当前账号发起的企业签名任务。\n\nresult_state 为 available 时，用 signed_version.id 创建签名包下载凭证；不要取版本列表第一项，不要把 source_version.id 当签名包。pending 表示仍在执行；not_produced 表示任务未成功；not_recorded 表示旧任务没有可信关联；removed 表示关联的签名版本已被清理。这些状态均不应改为猜测最新版本。source_version 可因清理为空，is_current=false 也不影响准确关联。不返回存储路径、下载 URL、私钥或原始诊断。下载仍需独立 DownloadSigned 权限、下载准入及父 AccessKey。接口不购买权益、不重签、不扣费。",
        "parameters": [
          {
            "$ref": "#/components/parameters/Date"
          },
          {
            "$ref": "#/components/parameters/Nonce"
          },
          {
            "$ref": "#/components/parameters/BodyHash"
          },
          {
            "$ref": "#/components/parameters/Environment"
          },
          {
            "name": "app_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^A[a-f0-9]{32}$"
            }
          },
          {
            "name": "job_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^J[a-f0-9]{32}$"
            }
          },
          {
            "$ref": "#/components/parameters/SecurityToken"
          }
        ],
        "responses": {
          "200": {
            "description": "返回该 J 的结果快照；终态并不一定存在可下载产物",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request_id",
                    "data"
                  ],
                  "properties": {
                    "request_id": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{32}$"
                    },
                    "data": {
                      "$ref": "#/components/schemas/JobResult"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "$ref": "#/components/responses/Error"
          }
        },
        "tags": [
          "企业签名"
        ],
        "x-cloudsign-products": [
          "enterprise"
        ]
      }
    }
  },
  "x-cloudsign-webhooks": "webhooks-v1.json",
  "tags": [
    {
      "name": "企业签名",
      "description": "从上传 IPA、开通权益、选择证书到提交签名、查询产物、退款与安装量管理。所有操作仅限本人账号获授权的企业签名应用。"
    },
    {
      "name": "应用分发",
      "description": "普通 IPA / APK 应用的创建、更新上传、版本发布、下载页设置、套餐购买与用量查询。应用分发业务 API 需要授权，面向安装用户的下载页面可免登录访问。"
    },
    {
      "name": "账号与账单",
      "description": "查询本人账号的余额、API 费用预算、订单和资金流水。账单查询与付款分别授权；账号级账单需要覆盖全部自有应用的范围。"
    },
    {
      "name": "接入与授权",
      "description": "确认当前调用身份，管理本人应用范围内的只读临时凭据。AccessKey 签名、OAuth、Webhook 与沙箱说明见接入指南，各自遵守既有授权和准入。"
    }
  ]
}
