> ## 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/session/{session_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/session/{session_id}:
    get:
      tags:
        - 结账会话
      summary: 获取结账会话详情
      description: 结账会话详情
      operationId: v1-checkout-session-get-checkout-session
      parameters:
        - name: session_id
          in: path
          description: Session id的值
          required: true
          schema:
            type: string
        - $ref: '#/components/parameters/HeaderRequestID'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuerySessionResponse'
components:
  parameters:
    HeaderRequestID:
      name: Request-Id
      in: header
      description: 请求的唯一标识符
      required: true
      schema:
        type: string
        default: 008e3967-a1b5-48bb-be14-d5bff5092e61
  schemas:
    QuerySessionResponse:
      type: object
      properties:
        code:
          type: string
          description: error code
        message:
          type: string
          description: error message
        data:
          $ref: '#/components/schemas/QuerySessionResponse_Data'
    QuerySessionResponse_Data:
      type: object
      properties:
        id:
          type: string
          description: checkout session id
        access_no:
          type: string
          description: 接入方编号
        merchant_id:
          type: string
          description: 商户唯一标识
        order_id:
          type: string
          description: 接入方订单号
        trade_id:
          type: string
          description: 交易单ID
        customer:
          allOf:
            - $ref: '#/components/schemas/Customer'
          description: 顾客信息
        status:
          type: string
          description: |-
            checkout session 状态:
             - open: 创建成功
             - expire: 过期
             - complete: 交易完成
        expire_time:
          type: string
          description: 有效期(秒), 使用创建时间加上有效期可计算过期时间
        return_url:
          type: string
          description: 支付成功跳转地址
        cancel_url:
          type: string
          description: 取消支付跳转地址
        callback_url:
          type: string
          description: webhook 通知地址
        session_url:
          type: string
          description: Checkout页面URL
        mode:
          type: string
          description: |-
            支付模式，用于判断是否校验商品信息：
            - checkout：校验商品数据，默认值
            - payment：不校验商品数据
        total_amount:
          type: string
          description: 总金额（不含折扣和税）
        integration_method:
          type: string
          description: |-
            集成模式：
            - hosted：托管式，默认为该模式
            - embedded ：嵌入式集成
        redirect_on_completion:
          type: string
          description: |-
            嵌入式ui模式的重定向行为
            - always： 支付成功后，会自动重定向到 return_url
            - if_required： 仅在有重定向的付款方式才会重定向到return_url
        created_at:
          type: string
          description: 创建时间
        payment_token:
          type: string
          description: 订阅支付时，返回的支付凭证，用于后续订阅续费
        metadata:
          type: object
          additionalProperties:
            type: string
          description: 一组可附加到对象上的键值对，允许您以结构化格式存储附加信息。
        first_source_channel:
          type: string
          description: 该结账会话的首次创建来源
        last_source_channel:
          type: string
          description: 该结账会话的最后访问来源
        fixed_term:
          type: integer
          description: 固定期限期数
          format: int32
        is_renewable:
          type: boolean
          description: 是否支持转为持续订阅
        tax_amount:
          type: string
          description: 税额
    Customer:
      type: object
      properties:
        id:
          type: string
          description: 顾客iD
        payer_id:
          type: string
          description: 接入方顾客的ID
        email:
          type: string
          description: 顾客邮箱
  securitySchemes:
    sec0:
      type: http
      description: 'Bearer API Key 鉴权。格式：Authorization: Bearer {your_api_key}'
      scheme: bearer

````