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

# 获取发票详情

> 查询发票详情

查询发票详情


## OpenAPI

````yaml openapi/v1-zh.yaml GET /api/v1/invoices/{invoice_id}
openapi: 3.0.3
info:
  title: Subotiz API
  description: Subotiz OpenAPI
  version: 1.0.0
servers:
  - url: https://{api}.subotiz.com
    variables:
      api:
        default: api
security:
  - sec0: []
tags:
  - name: 折扣
    description: 折扣
  - name: 发票
    description: 发票
  - name: 退款
    description: 退款
  - name: 商品管理
    description: 商品管理
  - name: 订阅
    description: 订阅
  - name: 商品定价
    description: 商品定价方案
  - name: 交易单
    description: 交易单
  - name: 支付流水
    description: 支付流水
  - name: 结账会话
    description: 结账会话
  - name: 顾客
    description: 顾客
  - name: 顾客门户
    description: 顾客门户
  - name: Webhook
    description: Webhook
  - name: 争议
    description: 争议订单
paths:
  /api/v1/invoices/{invoice_id}:
    get:
      tags:
        - 发票
      summary: 获取发票详情
      description: 查询发票详情
      operationId: v1-invoice-get-invoice
      parameters:
        - name: invoice_id
          in: path
          description: 发票ID
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/HeaderRequestID'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetInvoiceResponse'
components:
  parameters:
    HeaderRequestID:
      name: Request-Id
      in: header
      description: 请求的唯一标识符
      required: true
      schema:
        type: string
        default: 008e3967-a1b5-48bb-be14-d5bff5092e61
  schemas:
    GetInvoiceResponse:
      type: object
      properties:
        code:
          type: string
          description: error code
        message:
          type: string
          description: error message
        data:
          $ref: '#/components/schemas/GetInvoiceResponse_Data'
    GetInvoiceResponse_Data:
      type: object
      properties:
        invoice_id:
          type: string
          description: 发票ID
        merchant_id:
          type: string
          description: 商家ID
        trade_id:
          type: string
          description: 交易单ID
        subscription_id:
          type: string
          description: 订阅ID
        price_id:
          type: string
          description: 定价ID
        customer_id:
          type: string
          description: 顾客ID
        order_id:
          type: string
          description: 三方订单ID
        original_invoice_id:
          type: string
          description: 原始发票 ID，可用于在退款发票中查询订单原始发票
        refund_order_id:
          type: string
          description: 关联的退款单ID
        amount:
          type: string
          description: 支付金额，截断到2小数字
        currency:
          type: string
          description: 货币
        biz_status:
          type: string
          description: |-
            发票状态
            - open: 初始化
            - pending: 处理中
            - retrying: 等待重试
            - success: 支付成功
            - failed: 支付失败
            - refunded: 全部退款
            - partially_refunded: 部分退款
        invoice_type:
          type: string
          description: |-
            发票类型
            - initial: 首次支付
            - trial: 试用期
            - renewal: 订阅续订
            - refund: 退款
        paid_at:
          type: string
          description: 支付成功时间
        cycle_index:
          type: integer
          description: 当前所处的订阅周期
          format: int32
        created_at:
          type: string
          description: 创建时间
        metadata:
          type: object
          additionalProperties:
            type: string
          description: 一组可附加到对象上的键值对，允许您以结构化格式存储附加信息。
        Discounts:
          allOf:
            - $ref: '#/components/schemas/Discounts'
          description: 发票上的折扣，包括此发票的所有折扣信息
        price_version_id:
          type: string
          description: 定价方案版本 ID
        tax_amount:
          type: string
          description: 税额
    Discounts:
      type: object
      properties:
        current_period:
          type: array
          items:
            $ref: '#/components/schemas/CurrentPeriodDiscount'
          description: 当前时期的折扣详情
      description: 交易订单折扣信息
    CurrentPeriodDiscount:
      type: object
      properties:
        discount_id:
          type: string
          description: 折扣的唯一标识符
        discount_amount:
          type: string
          description: 折扣金额
        discount_code:
          type: string
          description: 使用的折扣代码
      description: 当前时期应用的折扣详情
  securitySchemes:
    sec0:
      type: http
      description: 'Bearer API Key 鉴权。格式：Authorization: Bearer {your_api_key}'
      scheme: bearer

````