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

> ## Agent Instructions
> Test in the sandbox first: base URL https://api-sandbox.y.uno (Test Mode in the Dashboard). Production is https://api.y.uno (Live Mode).
> Every API request needs the public-api-key and private-secret-key headers. Get them in the Dashboard at https://dashboard.y.uno/developers (Developers > Credentials); sandbox and production keys are different.
> Send an X-Idempotency-Key (a UUID) when creating payments, refunds and cancels, so retries do not create duplicates.
> Start with the Quickstart (https://docs.y.uno/docs/quickstart.md) and the agent guide (https://docs.y.uno/agents.md). To search these docs from a coding agent, connect the docs MCP server at https://docs.y.uno/mcp.

# 检索计划

> 获取计划的完整详细信息，包括其阶段、按国家/地区定价和附加的促销。

> [!NOTE]
>
> **附加的促销**
>
> 响应包含一个 `promotions` 列表，列出附加到该计划的促销，每个促销都带有其覆盖的 `cycles` 数量、`on_pause` 行为、`type`（`AUTOMATIC` 或 `CODE`）以及 `status`。`status` 为 `ENABLED` 或 `DISABLED`，从促销引擎读取。如果引擎未响应，状态为 `UNKNOWN`。使用[将促销附加到计划](https://docs.y.uno/zh-hans/reference/plans/attach-plan-promotion.md)和[从计划中移除促销](https://docs.y.uno/zh-hans/reference/plans/remove-plan-promotion.md)附加和移除促销。请参阅[订阅计划促销](https://docs.y.uno/zh-hans/docs/payment-features/subscriptions/promotions.md)。


## OpenAPI

````yaml openapi/zh-hans/plans/retrieve-plan.json GET /subscriptions/plans/{plan_id}
openapi: 3.1.0
info:
  title: plans
  version: 1.0.0
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - sec0: []
    sec1: []
paths:
  /subscriptions/plans/{plan_id}:
    get:
      summary: 检索计划
      operationId: retrieve-plan
      parameters:
        - in: header
          name: X-Account-Code
          required: true
          schema:
            type: string
          description: >-
            您的 [Yuno Dashboard](https://dashboard.y.uno/developers) 中的
            `account_id`（UUID）。必填：缺少该参数时返回 `400 BAD_REQUEST`（"Invalid
            x-account-code header."）。
        - name: plan_id
          in: path
          description: 计划的唯一标识符。
          schema:
            type: string
          required: true
      responses:
        '200':
          description: '200'
          content:
            application/json:
              examples:
                Result:
                  value:
                    id: 00000000-0000-4000-8000-000000000001
                    account_id: 00000000-0000-4000-8000-000000000002
                    name: Streaming Pro
                    description: Access to Pro features, billed monthly
                    merchant_reference: streaming-pro-monthly
                    status: ACTIVE
                    base_amount:
                      currency: USD
                      value: 20
                    frequency:
                      type: MONTH
                      value: 1
                    country_prices:
                      - country: US
                        amount:
                          currency: USD
                          value: 20
                      - country: BR
                        amount:
                          currency: BRL
                          value: 99.9
                    allowed_payment_methods:
                      - CARD
                      - PIX
                    metadata:
                      - key: campaign
                        value: app_store
                    phases:
                      - order: 1
                        name: Intro
                        type: TRIAL
                        duration:
                          type: MONTH
                          value: 3
                        frequency:
                          type: MONTH
                          value: 1
                        amount:
                          currency: USD
                          value: 9.99
                        total_payments: 3
                        country_prices: []
                      - order: 2
                        name: Regular
                        type: REGULAR
                        duration: null
                        frequency: null
                        amount: null
                        total_payments: null
                        country_prices: []
                    promotions:
                      - promotion_id: 8f2d6c1e-3b7a-4c55-9a1e-2f4d8b7c6a10
                        name: Welcome 20% x3
                        type: AUTOMATIC
                        status: ENABLED
                        cycles: 3
                        on_pause: KEEP
                        attached_at: '2026-11-02T14:00:00Z'
                    created_at: '2024-01-15T10:30:00.000000Z'
                    updated_at: '2024-01-15T10:30:00.000000Z'
                    account_ids:
                      - a5b50509-2f47-444e-8056-feb736ad89ae
                    retries: null
                    retry_split: null
                    meters: []
              schema:
                type: object
                properties:
                  id:
                    type: string
                  account_id:
                    type: string
                  name:
                    type: string
                  description:
                    type: string
                    nullable: true
                  merchant_reference:
                    type: string
                  status:
                    type: string
                  base_amount:
                    type: object
                    properties:
                      currency:
                        type: string
                      value:
                        type: number
                  frequency:
                    type: object
                    properties:
                      type:
                        type: string
                      value:
                        type: integer
                  country_prices:
                    type: array
                    items:
                      type: object
                      properties:
                        country:
                          type: string
                        amount:
                          type: object
                          properties:
                            currency:
                              type: string
                            value:
                              type: number
                  allowed_payment_methods:
                    type: array
                    items:
                      type: string
                  metadata:
                    type: array
                    items:
                      type: object
                  phases:
                    type: array
                    items:
                      type: object
                  created_at:
                    type: string
                  updated_at:
                    type: string
                  account_ids:
                    type: array
                    items:
                      type: string
                    description: 计划可用的所有账户。始终返回；当计划仅限单个账户时，包含 `account_id`。
                  retries:
                    type: object
                    nullable: true
                    description: 基于此计划创建的订阅所继承的重试配置。计划未设置时为 `null`。
                  retry_split:
                    type: object
                    nullable: true
                    description: 附加到此计划的 Smart Retries A/B 拆分配置。未设置时为 `null`。
                  meters:
                    type: array
                    items:
                      type: object
                    description: >-
                      附加到此计划的计量价格。计划没有按用量定价时为空，参见[将计量器附加到计划](/reference/meters/attach-meter-to-plan)。
                  promotions:
                    type: array
                    items:
                      type: object
                      properties:
                        promotion_id:
                          type: string
                          description: 所附加促销的 ID（UUID）。
                        name:
                          type: string
                          description: 促销名称。
                        type:
                          type: string
                          enum:
                            - AUTOMATIC
                            - CODE
                          description: >-
                            促销的兑换模式。`AUTOMATIC` 促销会在该计划下创建订阅时自动应用。`CODE`
                            促销会在商户发送优惠码时应用。
                        status:
                          type: string
                          enum:
                            - ENABLED
                            - DISABLED
                            - UNKNOWN
                          description: 读取自促销引擎。引擎无响应时为 `UNKNOWN`。
                        cycles:
                          type: integer
                          description: 促销在此计划上覆盖的扣款次数。
                        on_pause:
                          type: string
                          enum:
                            - KEEP
                            - END
                          description: 暂停对此促销副本的影响：`KEEP`（默认）或 `END`。
                        attached_at:
                          type: string
                          format: date-time
                          description: 促销附加到计划的时间。
                    description: >-
                      附加到此计划的促销。未附加任何促销时为空。参见[订阅计划上的促销](/zh-hans/docs/payment-features/subscriptions/promotions)。
        '404':
          description: '404'
          content:
            application/json:
              examples:
                Result:
                  value:
                    code: PLAN_NOT_FOUND
                    messages:
                      - Plan not found.
                  summary: Result
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: PLAN_NOT_FOUND
                  messages:
                    type: array
                    items:
                      type: string
      deprecated: false
components:
  securitySchemes:
    sec0:
      type: apiKey
      in: header
      name: public-api-key
      x-default: <Your public-api-key>
    sec1:
      type: apiKey
      in: header
      name: private-secret-key
      x-default: <Your private-secret-key>

````

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