> ## 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.

# 从计划中移除促销

> 从订阅计划中移除促销。已经拥有该促销的订阅会保留其副本

从计划中移除促销的附加关系。该计划不再提供此促销，因此无法将其应用于该计划上的新订阅。已经拥有该促销的订阅不会改变：它们会保留其副本，直到其变为 `COMPLETED` 或 `ENDED`。

响应没有响应体。要在单个订阅上结束促销，请使用[从订阅中移除促销](https://docs.y.uno/zh-hans/reference/subscriptions/remove-subscription-promotion.md)。

> [!NOTE]
>
> **更改 `cycles`**
>
> 附加关系不可编辑。要更改 `cycles` 或 `on_pause`，请使用此 endpoint 移除该附加关系，然后[重新附加促销](https://docs.y.uno/zh-hans/reference/plans/attach-plan-promotion.md)。

## 错误

| HTTP | `code` | 发生情况 |
| :- | :- | :- |
| `404` | `PLAN_NOT_FOUND` | 该计划不存在。 |
| `404` | `PROMOTION_NOT_FOUND` | 该促销未附加到此计划。 |


## OpenAPI

````yaml openapi/zh-hans/plans/remove-plan-promotion.json DELETE /subscriptions/plans/{plan_id}/promotions/{promotion_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)
  - url: https://api.eu.y.uno/v1
    description: Production (EMEA)
security:
  - sec0: []
    sec1: []
paths:
  /subscriptions/plans/{plan_id}/promotions/{promotion_id}:
    delete:
      summary: 从计划中移除促销
      description: 移除促销与计划的附加关系。已拥有该促销的订阅不受影响：它们会保留各自的副本，直到其状态变为 `COMPLETED` 或 `ENDED`。
      operationId: remove-plan-promotion
      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
        - name: promotion_id
          in: path
          description: 要从计划中移除的促销 ID（UUID）。
          schema:
            type: string
          required: true
      responses:
        '204':
          description: 204。促销已从计划中移除。响应没有响应体。
        '404':
          description: 404。计划不存在（`PLAN_NOT_FOUND`），或该促销未附加到此计划（`PROMOTION_NOT_FOUND`）。
          content:
            application/json:
              examples:
                Result:
                  value:
                    code: PROMOTION_NOT_FOUND
                    messages:
                      - Promotion not found.
              schema:
                type: object
                properties:
                  code:
                    type: string
                  messages:
                    type: array
                    items:
                      type: string
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.