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

# Cancelar link de pagamento

> O comprador passa a ver o aviso de link cancelado. Link pago não pode ser cancelado.



## OpenAPI

````yaml /api-reference/openapi-pagamentos.json post /v1/payment-links/{id}/cancel
openapi: 3.1.0
info:
  title: Velan · API de pagamentos
  version: 1.0.0
  description: >-
    Crie links de pagamento de ofertas e planos de assinatura e acompanhe o
    pagamento. Use uma chave `vk_live_…` para produção ou `vk_test_…` para o
    ambiente de teste (nada é cobrado).
servers:
  - url: https://open.velan.app
    description: Produção e teste (o modo vem da chave)
security:
  - bearerAuth: []
tags:
  - name: Links de pagamento
  - name: Ofertas e planos
  - name: Ambiente de teste
paths:
  /v1/payment-links/{id}/cancel:
    post:
      tags:
        - Links de pagamento
      summary: Cancelar link de pagamento
      description: >-
        O comprador passa a ver o aviso de link cancelado. Link pago não pode
        ser cancelado.
      operationId: cancelPaymentLink
      parameters:
        - name: id
          in: path
          required: true
          description: Identificador do link (`id` devolvido na criação).
          schema:
            type: string
          example: jW20RTHT6hN2-x3AQoaSRg
      responses:
        '200':
          description: Link cancelado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaymentLink'
        '401':
          description: Chave ausente, inválida ou revogada.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Chave sem acesso à API de pagamentos.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Link não encontrado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: O link já foi pago.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Limite de requisições atingido.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    PaymentLink:
      type: object
      properties:
        object:
          const: payment_link
        id:
          type: string
        livemode:
          type: boolean
          description: '`false` para links criados com chave de teste.'
        status:
          $ref: '#/components/schemas/PaymentLinkStatus'
        type:
          type: string
          enum:
            - offer
            - plan
        offer_code:
          type:
            - string
            - 'null'
        plan_code:
          type:
            - string
            - 'null'
        url:
          type: string
          format: uri
        short_url:
          type: string
          format: uri
        customer:
          type: object
          properties:
            name:
              type:
                - string
                - 'null'
            email:
              type:
                - string
                - 'null'
            phone:
              type:
                - string
                - 'null'
            document:
              type:
                - string
                - 'null'
        external_reference:
          type:
            - string
            - 'null'
        metadata:
          type: object
          additionalProperties:
            type: string
        coupon_code:
          type:
            - string
            - 'null'
        single_use:
          type: boolean
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        paid_at:
          type:
            - string
            - 'null'
          format: date-time
        canceled_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
        order:
          oneOf:
            - $ref: '#/components/schemas/Order'
            - type: 'null'
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            type:
              type: string
              enum:
                - validation_error
                - authentication_error
                - permission_error
                - not_found
                - conflict
                - rate_limited
                - api_error
            message:
              type: string
            fields:
              type: object
            retry_after_seconds:
              type: integer
    PaymentLinkStatus:
      type: string
      enum:
        - active
        - paid
        - expired
        - canceled
    Order:
      type: object
      properties:
        code:
          type: string
          format: uuid
        status:
          type: string
        amount:
          type: string
          example: '1000.00'
        payment_method:
          type:
            - string
            - 'null'
        paid_at:
          type:
            - string
            - 'null'
          format: date-time
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: vk_live_… | vk_test_…
      description: >-
        Chave criada no painel em Configurações → Chaves de API → Nova chave →
        API de pagamentos (dash.velan.app/dashboard/settings/api-keys).

````

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