# 更新支付链接状态

> 按 Payment Link ID 启用或停用支付链接。

```yaml
openapi: 3.1.0
info:
  title: 更新支付链接状态
  version: 1.0.0
  description: 按 Payment Link ID 启用或停用支付链接。
paths:
  /v1/txn/paymentLink/updateStatus:
    post:
      summary: 更新支付链接状态
      description: 按 Payment Link ID 启用或停用支付链接。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: 创建支付链接接口或查询支付链接列表接口返回的 Payment Link ID；请求时按字符串传入。
                linkStatus:
                  type: boolean
                  description: 目标支付链接状态。
                  x-onerway-constraints:
                    - kind: values
                      text: 本状态更新接口使用 boolean `true` 启用支付链接、`false` 停用支付链接；不要传数字 `1` / `0`。
                merchantNo:
                  type: string
                  description: Onerway 分配的商户号；获取方式参见[接入准备](/zh/payments/get-started/setup#获取凭证)。
                sign:
                  type: string
                  description: 请求签名字符串；生成方式详见[请求签名](/zh/payments/get-started/request-signing)。
              required:
                - id
                - linkStatus
                - merchantNo
                - sign
            examples:
              enable-payment-link:
                summary: 启用支付链接
                value:
                  id: payment_link_demo_202606210001
                  linkStatus: true
                  merchantNo: replace_with_merchant_no
                  sign: "{{SIGN}}"
      responses:
        "200":
          description: Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  respCode:
                    type: string
                    description: 响应码；`20000`
                      表示请求处理成功，其余为错误码。完整码表见[响应码](/zh/payments/api-reference/response-codes)。
                  respMsg:
                    type: string
                    description: 响应码对应的可读说明。
                  data:
                    type:
                      - object
                      - "null"
                    properties:
                      {}
                    description: 状态更新结果数据。
                    x-onerway-value:
                      nullable: true
                      when:
                        en: Can be `null` when the update succeeds.
                        zh: 更新成功时可为 `null`。
```
