> ## Documentation Index
> Fetch the complete documentation index at: https://waasapi.uuwallet.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取能量最大可租赁笔数

## 接口描述

该接口用于查询商户基于其当前持有的能量，所能提供的​​最大能量租赁交易笔数​​。该结果由商户实时能量余额与其预设的单笔交易能量成本计算得出。


## OpenAPI

````yaml POST /api/v1/api/order/getEnergyMaxCount
openapi: 3.1.0
info:
  title: API Documentation
  description: A sample API documentation
  version: 1.0.0
servers:
  - url: https://waas2-out-api.powersafe-rel.cc/
security: []
paths:
  /api/v1/api/order/getEnergyMaxCount:
    post:
      tags:
        - order-controller
      summary: 获取商户能量最大可租赁笔数
      operationId: getEnergyMaxCount
      parameters:
        - name: Content-Type
          in: header
          required: true
          schema:
            type: string
          description: 必须设置为 application/x-www-form-urlencoded
        - name: X-API-KEY
          in: header
          required: true
          description: 平台分配的商户身份凭证
          schema:
            type: string
            example: 53af2797-3eca-4412-b0cc-15273afe2d3e
      requestBody:
        required: true
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              required:
                - data
              properties:
                data:
                  type: string
                  description: >-
                    Base64编码的RSA加密数据，由以下原始参数加密生成:


                    **symbol** (string): 资源类型标识。当前固定填写
                    `"ENERGY"`，代表查询波场能量资源。未来若支持带宽（Bandwidth）等资源，可传入其他值。


                    **chainName** (string): 区块链网络名称。当前固定填写 `"TRON"`，代表查询波场网络资源。
                  pattern: ^[A-Za-z0-9+/]+={0,2}$
                  example: U2FsdGVkX1+Jfz0VjXJbZ0tZz8G8v4w3Z2jWkT...
      responses:
        '200':
          description: 成功响应
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - data
                properties:
                  code:
                    type: integer
                    description: 业务状态码（0 = 成功），其他值均表示失败。
                    example: 0
                  message:
                    type: string
                    description: 正常情况下返回为空，当请求失败时则会返回错误信息。
                    example: ''
                  data:
                    type: string
                    description: >+
                      Base64编码的RSA加密数据，由以下原始参数加密生成:


                      **chainName** (string):
                      区块链网络名称。固定返回"TRON"，表示当前查询的资源属于波场网络。


                      **symbol** (string):  资源类型标识符。固定返回"ENERGY"，表示当前查询的资源类型为能量。


                      **energyMaxCount** (integer):  商户当前最大可租赁能量笔数。该数值根据公式计算得出：


                      可用总能量值 / 商户预设单笔能量成本（向下取整）。

                    example: G+RlQN2lJ4qQtiXJC7Y6rgHm5UI7GIv+6FNyY/yyN30N7EaBA==....
              examples:
                encrypted_response_example:
                  summary: 加密响应示例
                  value:
                    code: 0
                    message: ''
                    data: gwgguizKfpnzkvgotgLZD126qlI69oicjKhaVuyCaa4ZPYYxhDUIu2....
                decrypted_response_example:
                  summary: 解密后的完整响应
                  value:
                    code: 0
                    message: ''
                    data: >-
                      {"chainName":"TRON","symbol":"ENERGY","energyMaxCount":140}
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '404':
          $ref: '#/components/responses/NotFoundError'
components:
  responses:
    UnauthorizedError:
      description: 用户未授权，需提供有效的身份凭证。
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                description: 错误代码
              message:
                type: string
                description: 错误描述
          example:
            code: UNAUTHORIZED
            message: unauthorized
    ForbiddenError:
      description: 访问被拒绝，用户许可权不足。
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                description: 错误代码
              message:
                type: string
                description: 错误描述
          example:
            code: FORBIDDEN
            message: forbidden
    NotFoundError:
      description: 请求的资源未找到，检查 URL 是否正确。
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: string
                description: 错误代码
              message:
                type: string
                description: 错误描述
          example:
            code: NOT FOUND
            message: not found

````