> ## Documentation Index
> Fetch the complete documentation index at: https://fortal-pay.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Buscar cupom

> Retrieve a non-deleted coupon owned by the merchant associated with the API key.

Retorna um cupom pelo identificador público, desde que ele pertença ao merchant autenticado e não tenha sido removido.


## OpenAPI

````yaml openapi.yaml GET /coupons/{id}
openapi: 3.1.0
info:
  title: FortalPay API
  version: '1'
  description: >
    API para gerenciar clientes, produtos e cupons e para criar ou listar
    cobranças.

    A autenticação utiliza uma API key no cabeçalho `Authorization`.
servers:
  - url: https://api-sandbox.fortalpay.tech/v1
    description: Produção — API v1
security:
  - apiKeyAuth: []
tags:
  - name: Clientes
    description: Crie, filtre, consulte e remova clientes do lojista associado à API key.
  - name: Charges
    description: >-
      Create Pix charges and list charges owned by the merchant associated with
      the API key.
  - name: Checkouts
    description: Crie páginas de pagamento hospedadas pela FortalPay usando uma API key.
  - name: Produtos
    description: >-
      Crie, liste, consulte, atualize e remova produtos do lojista associado à
      API key.
  - name: Coupons
    description: >-
      Create, list, retrieve, update, and delete coupons owned by the merchant
      associated with the API key.
paths:
  /coupons/{id}:
    get:
      tags:
        - Coupons
      summary: Retrieve a coupon
      description: >-
        Retrieves a non-deleted coupon owned by the merchant associated with the
        API key.
      operationId: getCoupon
      parameters:
        - $ref: '#/components/parameters/CouponId'
      responses:
        '200':
          description: Coupon retrieved.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CouponEnvelope'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    CouponId:
      name: id
      in: path
      required: true
      description: Identificador público do cupom.
      schema:
        type: string
        format: uuid
  schemas:
    CouponEnvelope:
      type: object
      required:
        - data
        - success
        - error
      properties:
        data:
          $ref: '#/components/schemas/Coupon'
        success:
          type: boolean
          const: true
        error:
          type: 'null'
    Coupon:
      type: object
      required:
        - id
        - code
        - type
        - value
        - used_count
        - status
        - created_at
        - updated_at
      properties:
        id:
          type: string
          format: uuid
          description: Identificador público do cupom.
          example: 6f84d2b5-a612-4e67-8af5-69f98de980f5
        code:
          type: string
        type:
          $ref: '#/components/schemas/CouponType'
        value:
          type: number
          description: >-
            Percentual inteiro para PERCENTAGE; valor decimal em reais para
            FIXED_AMOUNT.
          examples:
            - 10
            - 1.01
        max_uses:
          type:
            - integer
            - 'null'
          description: Null or -1 represents unlimited usage.
        used_count:
          type: integer
        starts_at:
          type:
            - string
            - 'null'
          format: date-time
        expires_at:
          type:
            - string
            - 'null'
          format: date-time
        status:
          $ref: '#/components/schemas/CouponStatus'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
    ErrorEnvelope:
      type: object
      required:
        - data
        - success
        - error
      properties:
        data:
          type: 'null'
        success:
          type: boolean
          const: false
        error:
          $ref: '#/components/schemas/ApiError'
    CouponType:
      type: string
      enum:
        - PERCENTAGE
        - FIXED_AMOUNT
    CouponStatus:
      type: string
      enum:
        - ACTIVE
        - INACTIVE
    ApiError:
      type: object
      required:
        - timestamp
        - status
        - message
        - path
      properties:
        timestamp:
          type: string
          format: date-time
        status:
          type: integer
        message:
          type: string
          description: Current backend messages are returned in Portuguese.
        path:
          type: string
        fields:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/FieldError'
    FieldError:
      type: object
      required:
        - field
        - message
      properties:
        field:
          type: string
        message:
          type: string
  responses:
    Unauthorized:
      description: >-
        A API key está ausente, malformada, não existe, foi revogada, expirou ou
        é incompatível com o ambiente do lojista.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    Forbidden:
      description: >-
        A API key foi autenticada, mas não possui permissão para acessar a rota
        solicitada.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
    NotFound:
      description: >-
        O recurso não existe, foi removido ou não pertence ao lojista
        autenticado.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorEnvelope'
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >
        Todas as requisições devem incluir sua API key no cabeçalho
        `Authorization`

        usando o formato `ApiKey <sua_api_key>`. Não use o esquema `Bearer`.

        Sem esse cabeçalho, a requisição será rejeitada.


        Use `fpay_sk_test_...` no ambiente de teste e `fpay_sk_live_...` em
        produção.

        [Saiba como criar e usar uma API key](/authentication).

````