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

# 取消支付链接

> 取消有效的支付链接，使其无法再用于收款



## OpenAPI

````yaml openapi/zh-hans/payment-links/cancel-payment-link.json POST /payment-links/{code}/cancel
openapi: 3.1.0
info:
  title: payment-links
  version: 1.0.2
servers:
  - url: https://api-sandbox.y.uno/v1
    description: Sandbox
  - url: https://api.y.uno/v1
    description: Production (US)
security:
  - sec0: []
    sec1: []
paths:
  /payment-links/{code}/cancel:
    post:
      summary: 取消支付链接
      operationId: cancel-payment-link
      parameters:
        - name: code
          in: path
          description: 支付链接的代码（UUID，36 个字符）
          schema:
            type: string
          required: true
      responses:
        '201':
          description: '201'
          content:
            application/json:
              examples:
                CANCEL PAYMENT LINK:
                  value:
                    code: aace3f6d-e26d-45d0-9a4f-66523909ddf9
                    country: US
                    availability:
                      start_at: '2023-01-15T14:00:12Z'
                      finish_at: '2023-10-29T14:00:12Z'
                    status: CANCELED
                    description: PRUEBA PAYMENT LINK 10/07
                    amount:
                      currency: USD
                      value: 5000
                    metadata:
                      - key: some key
                        value: some value
                    split_payment_methods: false
                    payment_method_types:
                      - PSE
                    one_time_use: true
                    callback_url: https://checkout.sandbox.y.uno/payment/status
                    installments_plan: null
                    customer_payer: null
                    taxes: null
                    additional_data:
                      airline: null
                      order: null
                      seller_details: null
                    organization_code: b887a970-9722-44fe-ab17-106bf1b93577
                    account_code: 8147da44-4de9-48ff-a194-51b2cd7d2a03
                    checkout_url: >-
                      https://checkout.sandbox.y.uno/payment?session=ac63a0d7-b2d7-4e72-9062-2e2e3a448359
                    payments_number: 0
                    merchant_image: ''
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: aace3f6d-e26d-45d0-9a4f-66523909ddf9
                  country:
                    type: string
                    example: US
                  availability:
                    type: object
                    properties:
                      start_at:
                        type: string
                        example: '2023-01-15T14:00:12Z'
                      finish_at:
                        type: string
                        example: '2023-10-29T14:00:12Z'
                  status:
                    type: string
                    example: CANCELED
                  description:
                    type: string
                    example: PRUEBA PAYMENT LINK 10/07
                  amount:
                    type: object
                    properties:
                      currency:
                        type: string
                        example: USD
                      value:
                        type: integer
                        example: 5000
                        default: 0
                  metadata:
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          type: string
                          example: some key
                        value:
                          type: string
                          example: some value
                  split_payment_methods:
                    type: boolean
                    example: false
                    default: true
                  payment_method_types:
                    type: array
                    items:
                      type: string
                      example: PSE
                  one_time_use:
                    type: boolean
                    example: true
                    default: true
                  callback_url:
                    type: string
                    example: https://checkout.sandbox.y.uno/payment/status
                  installments_plan: {}
                  customer_payer: {}
                  taxes: {}
                  external_invoice:
                    type: object
                    description: 该支付链接所支付的 Stripe 发票，与创建链接时发送的内容一致。在未带该字段创建的链接上，此键不会出现。
                    required:
                      - id
                    properties:
                      id:
                        type: string
                        description: 发票在 Stripe 中的标识符（`in_...`）。
                        example: in_1QwZzz
                      customer_id:
                        type: string
                        nullable: true
                        description: 拥有该发票的 Stripe 客户（`cus_...`）。链接创建时未带该字段则为 Null。
                        example: cus_RplXYZ
                  local_pricing:
                    type: boolean
                    example: false
                    description: 当托管式 checkout 页面显示并按买家所在地的货币扣款时为 `true`。
                  tax_collection:
                    type: boolean
                    example: false
                    description: 当托管式 checkout 页面按买家地址报价并收取税费时为 `true`。
                  external_subscription:
                    type: object
                    description: 链接在付款后所售卖的计费平台订阅，与创建链接时发送的内容一致。在未带该字段创建的链接上，此键不会出现。
                    properties:
                      provider:
                        type: string
                        example: STRIPE_BILLING
                        description: 计费平台。
                      customer_id:
                        type: string
                        example: cus_RplXYZ
                        description: 客户在计费平台中的标识符。
                      items:
                        type: array
                        description: 订阅的价格。
                        items:
                          type: object
                          properties:
                            price:
                              type: string
                              example: price_1QwAbc
                            quantity:
                              type: integer
                              example: 1
                      currency:
                        type: string
                        example: USD
                        description: 订阅价格的货币。
                      metadata:
                        type: object
                        additionalProperties:
                          type: string
                        description: 创建链接时发送的文本映射。
                      id:
                        type: string
                        description: 现有订阅的标识符（如果发送了的话）。
                  additional_data:
                    type: object
                    properties:
                      airline: {}
                      order: {}
                      seller_details: {}
                  organization_code:
                    type: string
                    example: b887a970-9722-44fe-ab17-106bf1b93577
                  account_code:
                    type: string
                    example: 8147da44-4de9-48ff-a194-51b2cd7d2a03
                  checkout_url:
                    type: string
                    example: >-
                      https://checkout.sandbox.y.uno/payment?session=ac63a0d7-b2d7-4e72-9062-2e2e3a448359
                  payments_number:
                    type: integer
                    example: 0
                    default: 0
                  merchant_image:
                    type: string
                    example: ''
        '400':
          description: '400'
          content:
            application/json:
              examples:
                Invalid Request:
                  value:
                    code: INVALID_REQUEST
                    messages:
                      - Invalid request
                  summary: Invalid Request
              schema:
                type: object
                properties: {}
      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.