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

# 获取卡包详情

> 使用 `slug` 查询单个卡包的价格、各档概率和回购规则。

响应包含目录估值范围和公布的回购比例。向买家说明概率和估值时，请区分以下数据。

| 数据 | 含义 |
| - | - |
| 各档概率 | 按整组卡牌计算并四舍五入。 |
| `expectedValueInUsd` | 卡包资料中保存的期望价值。 |
| `activeSetExpectedValueInUsd` | v3 抽卡机当前整组卡牌的平均价值。尚未抽出的卡牌可能有不同的均值。 |

美元金额以美分计，USDT 金额采用 18 位精度，两者都用整数字符串表示。如需查看向你的应用单独开放的卡包，参见[浏览卡包](https://docs.renaiss.xyz/cn/gacha.md#浏览卡包)。

## 请求

开发者密钥可选

## 响应

## 错误码

在下表中查找接口返回的 HTTP 状态码和响应原文。有关各接口通用的处理建议，请参阅[错误码含义与处理方式](https://docs.renaiss.xyz/cn/api-reference/errors.md)。

| HTTP | 错误码 | 文本字段 | 响应文本与处理方式 |
| :- | :- | :- | :- |
| `400` | `INVALID_SCHEMA` | `message` | `Unable to load pack details` |
| `400` | `WRONG_REQUEST_PARAMS` | `message` | `Bad request - invalid parameters` |
| `401` | `API_AUTH_INVALID_CREDENTIAL` | `error` | `Invalid authentication credential` 开发者密钥格式错误、未知、已过期或已撤销。请核对并更换密钥。 |
| `403` | `API_AUTH_CREDENTIAL_NOT_ALLOWED` | `error` | `Credential is not allowed by this policy` 省略全部凭据，或仅通过 `x-builder-api-key` 发送可选的开发者密钥。 |
| `403` | `GACHA_V3_BUILDER_NOT_ACCEPTED_ON_PUBLIC_API` | `error` | `This builder checks out on its own surface, not on the public API` 此密钥无法用于当前 API。请联系 Renaiss，无需重试。 |
| `404` | `CARD_PACK_NOT_FOUND` | `message` | `Pack not found` |
| `408` | `SUBGRAPH_ABORTED` | `message` | `Unable to load pack details` 主网读取卡包超时时可能返回此码。测试网在相同情况下返回 HTTP `502` 和 `SUBGRAPH_NETWORK_ERROR`。 |
| `429` | `API_AUTH_RATE_LIMITED` | `error` | `Authentication rate limit exceeded` 已达到密钥的请求频率上限。稍候再以较低频率重试。 |
| `429` | `SUBGRAPH_RATE_LIMITED` | `message` | `Unable to load pack details` |
| `500` | `API_AUTH_ERROR` | `error` | `Internal server error` |
| `500` | `FUNCTION_ERROR` | `error` | `Internal server error` |
| `500` | `FUNCTION_ERROR` | `message` | `Unable to load pack details` |
| `500` | `CARD_PACKS_QUERY_FAILED` `SUBGRAPH_QUERY_FAILED` | `message` | `Unable to load pack details` 请稍后重新查询。 |
| `500` | 其他错误码 | `message` | `Unable to load pack details` |
| `502` | `SUBGRAPH_NETWORK_ERROR` `SUBGRAPH_REQUEST_FAILED` `SUBGRAPH_QUERY_ERROR` | `message` | `Unable to load pack details` 请稍后重新查询。 |
| `502` | 其他错误码 | `message` | `Unable to load pack details` |


## OpenAPI

````yaml cn/api-reference/openapi.json GET /v2/gacha/packs/{slug}
openapi: 3.1.1
info:
  version: 1.0.0
  title: Renaiss 开发者 API v2
  description: >-
    在 BNB 智能链（链 ID 56）上使用外部钱包接入抽卡、交易市场和实物兑换。所有已批准且有效的开发者密钥均可准备购买。


    藏品包括钱包可抽取、交易、回售或兑换的物品，例如卡牌。接口路径、字段和描述统一使用 collectible 表示藏品。


    可以匿名浏览目录。准备购买后，请由买家钱包签名。抽卡记录和回购报价需要开发者密钥，购买和回购还需操作签名。私有配送信息及兑换需要钱包访问令牌，由钱包在已注册的合作方来源签署登录消息后签发。抽卡和市场不使用钱包访问令牌。请在后端保管开发者密钥。


    操作钱包可以是 EOA 或已部署的 ERC-1271 合约账户。不支持 EIP-7702 委托账户、ERC-6492 或 ERC-8010 封装签名及
    Renaiss 托管的 Safe（签名验证后才会识别并拒绝该类 Safe）。无法接收 ERC-721 的合约钱包抽卡会返回
    `CONTRACT_WALLET_CANNOT_RECEIVE_NFT`。链上读取失败返回
    `API_AUTH_ERROR`（500）。钱包访问令牌及实物兑换仅支持 EOA。
servers:
  - url: https://api.renaiss.xyz
    description: BNB 智能链主网
  - url: https://dev-api.renaiss.xyz
    description: BNB 测试网
security: []
tags:
  - name: Gacha v2
    description: 使用 EOA 浏览和购买卡包、揭晓藏品、读取购买记录及回购。无需钱包访问令牌。
  - name: Marketplace
    description: 公开浏览藏品，通过外部钱包挂牌、出价、购买或撤单。交易需要开发者授权及钱包操作签名。
  - name: Users
    description: 查询特定钱包的藏品、市场总估值和链上活动。仅需开发者密钥，各接口按相应的可见范围返回记录。
  - name: Redemption
    description: 查询兑换资格、运费报价，准备并提交兑换及跟踪物流。需要开发者密钥及同一钱包的访问令牌。
  - name: Wallet access tokens
    description: >-
      获取、刷新或撤销实物兑换使用的钱包访问令牌。钱包签署一次性登录消息（5 分钟有效）后，API 返回访问令牌（15 分钟）和一次性刷新令牌（7
      天）。先注册精确的合作方前端来源。抽卡和市场无需钱包访问令牌。
paths:
  /v2/gacha/packs/{slug}:
    get:
      tags:
        - Gacha v2
      summary: 按 slug 获取 VRF 卡包
      description: 使用 `slug` 查询单个卡包的价格、各档概率和回购规则。
      parameters:
        - schema:
            type: string
            minLength: 1
          required: true
          name: slug
          in: path
        - $ref: '#/components/parameters/OptionalPackBuilderKey'
      responses:
        '200':
          description: 成功
          content:
            application/json:
              schema:
                type: object
                properties:
                  cardPack:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                      slug:
                        type: string
                      name:
                        type: string
                      packType:
                        type: string
                        enum:
                          - limited
                          - perpetual
                          - v3
                          - v3-limited
                      stage:
                        type: string
                        enum:
                          - countdown
                          - active
                          - soldout-or-restocking
                          - archived
                      description:
                        type: string
                        description: 发布者提供的卡包描述，仅支持行内 Markdown（**粗体**、*斜体*、__下划线__）。
                      priceInUsdt:
                        type: string
                        pattern: ^[0-9]+$
                        description: 卡包价格，以精度为 18 位的 USDT 最小单位计，序列化为十进制字符串。
                      expectedValueInUsd:
                        type:
                          - string
                          - 'null'
                        pattern: ^[0-9]+$
                        description: >-
                          已保存的卡包期望价值，以美分计，返回十进制字符串；未设置时为 `null`。v3 售卡机展示应使用 `GET
                          /v2/gacha/packs/{slug}` 的
                          `activeSetExpectedValueInUsd`。此字段不会随当前卡组或剩余藏品重新计算。
                      packBannerVideoUrl:
                        type:
                          - string
                          - 'null'
                      gachaMachineVideoUrl:
                        type:
                          - string
                          - 'null'
                      gachaRippingPackAnimationVideoUrl:
                        type:
                          - string
                          - 'null'
                      onChainPackId:
                        type: string
                        description: 32 字节，以 0x 开头，后接 64 个十六进制数字。
                      vendingMachineAddress:
                        type: string
                        description: 带 0x 前缀的 20 字节钱包或合约地址。请使用全小写或有效的校验和格式。
                      tiers:
                        type: array
                        items:
                          type: object
                          properties:
                            tier:
                              type: integer
                            name:
                              anyOf:
                                - type: string
                                  enum:
                                    - TOP
                                    - S
                                    - A
                                    - B
                                    - C
                                    - D
                                - type: string
                                  enum:
                                    - epic
                                    - rare
                                    - uncommon
                                    - common
                                    - legendary
                                    - thorn
                                    - bloom
                                    - crown
                            chance:
                              anyOf:
                                - type: number
                                - type: string
                                  enum:
                                    - UNDER-1-PERCENT
                              description: >-
                                当前整组中该档占比，四舍五入至整数；大于 0 但不足 1% 时为
                                `UNDER-1-PERCENT`。各档相加可能不等于 100，也不代表剩余卡牌的抽取概率。
                            priceRangeInUsd:
                              type: object
                              properties:
                                min:
                                  type: string
                                  pattern: ^[0-9]+$
                                max:
                                  type: string
                                  pattern: ^[0-9]+$
                              required:
                                - min
                                - max
                              description: >-
                                目录展示的美元价格区间，以美分的十进制字符串表示。下限为本档设定的起点，上限为上一档起点，最高档则取公开目录的最大值。该区间不表示当前卡组或剩余卡的实际价值，也不保证单次抽卡的价值。
                          required:
                            - tier
                            - name
                            - chance
                            - priceRangeInUsd
                      activeSetExpectedValueInUsd:
                        type: string
                        pattern: ^[0-9]+$
                        description: >-
                          当前整组所有卡位的藏品基础价值均值，包含已抽走的卡，以美分四舍五入，空组为 0。这是 v3
                          售卡机展示的期望价值，尚未应用回购比例，不代表剩余藏品的均值或保证收益。
                      buybackConfig:
                        type: array
                        items:
                          type: object
                          properties:
                            buybackPercentage:
                              type: number
                              description: 回购支付的藏品基础价值比例，例如 85 表示 85%。
                            buybackExpiredInSeconds:
                              type: integer
                              minimum: 0
                              description: 自抽卡结果确定至该档截止的秒数。
                          required:
                            - buybackPercentage
                            - buybackExpiredInSeconds
                        description: >-
                          档位按截止时间排序。已完成抽卡沿用当时的档位，之后修改仅影响新的抽卡。从结果确定时算起，使用第一个尚未超过
                          `buybackExpiredInSeconds`
                          的档位，在截止那一秒仍然有效。最长档结束后才可交付藏品。公开记录在该时限或 24
                          小时后显示，以较早者为准。未配置时返回空列表。实际金额和截止时间请查询 `GET
                          /v2/gacha/buyback/offers`。
                    required:
                      - id
                      - slug
                      - name
                      - packType
                      - stage
                      - description
                      - priceInUsdt
                      - expectedValueInUsd
                      - packBannerVideoUrl
                      - gachaMachineVideoUrl
                      - gachaRippingPackAnimationVideoUrl
                      - onChainPackId
                      - vendingMachineAddress
                      - tiers
                      - activeSetExpectedValueInUsd
                      - buybackConfig
                required:
                  - cardPack
        '400':
          description: |-
            请求参数无效。

            见[错误码与处理方式](/cn/api-reference/gacha/get-pack#http-errors)。
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - WRONG_REQUEST_PARAMS
                      - INVALID_SCHEMA
                    description: |-
                      可能的错误码
                      - `WRONG_REQUEST_PARAMS`：请求数据无效。
                      - `INVALID_SCHEMA`：数据结构无效。
                  message:
                    type: string
                required:
                  - code
                  - message
        '401':
          description: |-
            提供的开发者密钥未通过验证。

            见[错误码与处理方式](/cn/api-reference/gacha/get-pack#http-errors)。
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: 简短的错误说明。
                  code:
                    type: string
                    enum:
                      - API_AUTH_INVALID_CREDENTIAL
                required:
                  - error
                  - code
              example:
                error: Invalid authentication credential
                code: API_AUTH_INVALID_CREDENTIAL
        '403':
          description: |-
            公开查询不接受所提供的凭据。

            见[错误码与处理方式](/cn/api-reference/gacha/get-pack#http-errors)。
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: 简短的错误说明。
                  code:
                    type: string
                    enum:
                      - API_AUTH_CREDENTIAL_NOT_ALLOWED
                      - GACHA_V3_BUILDER_NOT_ACCEPTED_ON_PUBLIC_API
                required:
                  - error
                  - code
              example:
                error: Credential is not allowed by this policy
                code: API_AUTH_CREDENTIAL_NOT_ALLOWED
        '404':
          description: |-
            找不到卡包。

            见[错误码与处理方式](/cn/api-reference/gacha/get-pack#http-errors)。
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - CARD_PACK_NOT_FOUND
                    description: |-
                      可能的错误码
                      - `CARD_PACK_NOT_FOUND`：未找到卡包。
                  message:
                    type: string
                required:
                  - code
                  - message
        '408':
          description: 主网读取卡包超时。测试网在此情况下返回 502。
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    enum:
                      - SUBGRAPH_ABORTED
                  message:
                    type: string
                required:
                  - code
                  - message
              example:
                code: SUBGRAPH_ABORTED
                message: Unable to load pack details
        '429':
          description: >-
            请求过于频繁。`SUBGRAPH_RATE_LIMITED` 返回 Retry-After
            时，请等待指定的整数秒数再试。开发者密钥也可能达到请求限额。


            见[错误码与处理方式](/cn/api-reference/gacha/get-pack#http-errors)。
          headers:
            Retry-After:
              description: 如果返回此响应头，按指定秒数等待后重试。
              schema:
                type: integer
                minimum: 0
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - SUBGRAPH_RATE_LIMITED
                        description: |-
                          可能的错误码
                          - `SUBGRAPH_RATE_LIMITED`：当前请求过多，请稍后重试。
                      message:
                        type: string
                    required:
                      - code
                      - message
                  - type: object
                    properties:
                      error:
                        type: string
                        description: 简短的错误说明。
                      code:
                        type: string
                        enum:
                          - API_AUTH_RATE_LIMITED
                    required:
                      - error
                      - code
        '500':
          description: |-
            服务端暂时失败，请稍后重试。

            见[错误码与处理方式](/cn/api-reference/gacha/get-pack#http-errors)。
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                  - type: object
                    properties:
                      error:
                        type: string
                        description: 简短的错误说明。
                      code:
                        type: string
                    required:
                      - error
                      - code
              example:
                code: FUNCTION_ERROR
                message: Unable to load pack details
        '502':
          description: |-
            服务端暂时失败，请稍后重试。

            见[错误码与处理方式](/cn/api-reference/gacha/get-pack#http-errors)。
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    examples:
                      - SUBGRAPH_NETWORK_ERROR
                      - SUBGRAPH_REQUEST_FAILED
                      - SUBGRAPH_QUERY_ERROR
                  message:
                    type: string
                required:
                  - code
                  - message
              example:
                message: Unable to load pack details
                code: SUBGRAPH_NETWORK_ERROR
      security: []
components:
  parameters:
    OptionalPackBuilderKey:
      name: x-builder-api-key
      in: header
      required: false
      description: 仅查询公开卡包时请留空。填写开发者密钥后，还可查询对该开发者开放的卡包。
      schema:
        type: string

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.