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

# Listar cupons

> List non-deleted coupons owned by the merchant associated with the API key.

Retorna os cupons não removidos do merchant, ordenados pelos mais recentes.

Use `page` para informar a página, começando em `0`, e `size` para definir a quantidade de itens retornados. A ordenação é fixa pela data de criação, da mais recente para a mais antiga.


## OpenAPI

````yaml openapi.yaml GET /coupons
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:
    get:
      tags:
        - Coupons
      summary: List coupons
      description: >-
        Returns non-deleted coupons owned by the authenticated merchant, ordered
        by creation time descending.
      operationId: listCoupons
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/Size'
      responses:
        '200':
          description: A page of coupons.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CouponPageEnvelope'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  parameters:
    Page:
      name: page
      in: query
      required: false
      description: Índice da página, começando em zero.
      schema:
        type: integer
        minimum: 0
        default: 0
    Size:
      name: size
      in: query
      required: false
      description: Quantidade de registros solicitada por página.
      schema:
        type: integer
        minimum: 1
        default: 20
  schemas:
    CouponPageEnvelope:
      type: object
      required:
        - data
        - success
        - error
      properties:
        data:
          $ref: '#/components/schemas/CouponPage'
        success:
          type: boolean
          const: true
        error:
          type: 'null'
    CouponPage:
      allOf:
        - $ref: '#/components/schemas/PageMetadata'
        - type: object
          properties:
            content:
              type: array
              items:
                $ref: '#/components/schemas/Coupon'
    ErrorEnvelope:
      type: object
      required:
        - data
        - success
        - error
      properties:
        data:
          type: 'null'
        success:
          type: boolean
          const: false
        error:
          $ref: '#/components/schemas/ApiError'
    PageMetadata:
      type: object
      properties:
        page:
          type: integer
        size:
          type: integer
        numberOfElements:
          type: integer
        totalElements:
          type: integer
        totalPages:
          type: integer
    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
    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'
    CouponType:
      type: string
      enum:
        - PERCENTAGE
        - FIXED_AMOUNT
    CouponStatus:
      type: string
      enum:
        - ACTIVE
        - INACTIVE
    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'
  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).

````