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

# Listar Pacotes

> Use este endpoint para recuperar todos os pacotes registrados junto com suas taxas associadas.



## OpenAPI

````yaml pt/openapi/v3-current/fees-engine.yaml get /v1/packages
openapi: 3.1.0
info:
  title: Fees Engine
  description: ''
  version: 3.3.0
servers:
  - url: https://fees.sandbox.lerian.net
security: []
tags:
  - name: Fees Engine
paths:
  /v1/packages:
    get:
      tags:
        - Packages API
      summary: Listar Pacotes
      description: >-
        Use este endpoint para recuperar todos os pacotes registrados junto com
        suas taxas associadas.
      parameters:
        - name: page
          in: query
          description: Número da página a ser retornada.
          required: false
          example: 1
          schema:
            type: integer
        - name: limit
          in: query
          description: Número de registros retornados.
          required: false
          example: 1
          schema:
            type: integer
        - name: sort_order
          in: query
          description: A ordem utilizada para classificar os resultados.
          required: false
          example: desc
          schema:
            type: string
        - name: transactionRoute
          in: query
          description: >-
            A rota contábil principal que define a natureza da transação. Ajuda
            a agrupar operações relacionadas no ledger.
          required: false
          example: TED-DEBIT
          schema:
            type: string
        - name: enable
          in: query
          description: Se `true`, indica que o pacote está ativo.
          required: false
          example: true
          schema:
            type: boolean
        - name: start_date
          in: query
          description: >-
            A data inicial do período que você deseja recuperar. **Deve ser
            usada junto com o `end_date`**.
          required: false
          example: '2025-01-01'
          schema:
            type: string
        - name: end_date
          in: query
          description: >-
            A data final do período que você deseja recuperar. **Deve ser usada
            junto com o `start_date`**.
          required: false
          example: '2025-01-31'
          schema:
            type: string
        - $ref: '#/components/parameters/Authorization'
        - $ref: '#/components/parameters/LedgerId'
        - $ref: '#/components/parameters/SegmentId'
        - $ref: '#/components/parameters/ContentType'
        - $ref: '#/components/parameters/XOrganizationId'
      responses:
        '200':
          description: >-
            Indica que o recurso foi criado com sucesso e a operação foi
            concluída conforme esperado.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/CreatePackagesResponse'
                    description: Lista com os itens retornados.
                  page:
                    type: integer
                    description: Número da página retornada.
                  limit:
                    type: integer
                    description: Número de registros retornados.
                  total:
                    type: integer
                    description: Número de itens retornados.
              example:
                items:
                  - id: 0196251d-a93a-7c42-9eef-c9f463470e21
                    feeGroupLabel: Package 1
                    description: Package created for testing
                    transactionRoute: 019c96a0-10a0-72d2-9fb0-2b7de8093182
                    segmentId: 019c96a0-0b4e-7079-8be0-ab6bdccf975f
                    ledgerId: 019c96a0-0ac0-7de9-9f53-9cf842a2ee5a
                    minimumAmount: '3000.00'
                    maximumAmount: '6000.00'
                    waivedAccounts:
                      - customer-brl-1
                    fees:
                      fee1:
                        feeLabel: Administrative fee 1
                        calculationModel:
                          applicationRule: maxBetweenTypes
                          calculations:
                            - type: flat
                              value: '15'
                            - type: percentage
                              value: '2'
                        referenceAmount: originalAmount
                        priority: 1
                        isDeductibleFrom: false
                        creditAccount: business-brl-1
                        routeFrom: 019c96a0-1071-7a0d-9916-a831221de252
                        routeTo: 019c96a0-108c-7a74-8e31-3789daffe1ed
                      fee2:
                        feeLabel: Administrative fee 2
                        calculationModel:
                          applicationRule: flatFee
                          calculations:
                            - type: flat
                              value: '5'
                        referenceAmount: originalAmount
                        priority: 2
                        isDeductibleFrom: false
                        creditAccount: business-brl-2
                        routeFrom: 019c96a0-1071-7a0d-9916-a831221de252
                        routeTo: 019c96a0-108c-7a74-8e31-3789daffe1ed
                      fee3:
                        feeLabel: Fee 3
                        calculationModel:
                          applicationRule: percentual
                          calculations:
                            - type: percentage
                              value: '5'
                        referenceAmount: afterFeesAmount
                        priority: 3
                        isDeductibleFrom: true
                        creditAccount: business-brl-3
                        routeFrom: 019c96a0-1071-7a0d-9916-a831221de252
                        routeTo: 019c96a0-108c-7a74-8e31-3789daffe1ed
                    enable: true
                    createdAt: '2025-04-11T13:50:23.034Z'
                    updatedAt: '2025-04-11T13:50:23.034Z'
                    deletedAt: null
                  - id: 01962522-d87e-7120-80bf-c55b770df818
                    feeGroupLabel: Package 2
                    description: Second package created for testing
                    transactionRoute: 019c96a0-10a0-72d2-9fb0-2b7de8093182
                    segmentId: 019c96a0-0b4e-7079-8be0-ab6bdccf975f
                    ledgerId: 019c96a0-0ac0-7de9-9f53-9cf842a2ee5a
                    minimumAmount: '3000.00'
                    maximumAmount: '6000.00'
                    waivedAccounts: []
                    fees:
                      fee1:
                        feeLabel: Administrative fee test 2
                        calculationModel:
                          applicationRule: maxBetweenTypes
                          calculations:
                            - type: flat
                              value: '16'
                            - type: percentage
                              value: '1'
                        referenceAmount: originalAmount
                        priority: 1
                        isDeductibleFrom: false
                        creditAccount: business-brl-1
                        routeFrom: 019c96a0-1071-7a0d-9916-a831221de252
                        routeTo: 019c96a0-108c-7a74-8e31-3789daffe1ed
                    enable: true
                    createdAt: '2025-04-11T13:56:02.814Z'
                    updatedAt: '2025-04-11T13:56:02.814Z'
                    deletedAt: null
                page: 1
                limit: 5
                total: 3
          headers: {}
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Error0003:
                  $ref: '#/components/examples/Error0003'
                Error0006:
                  $ref: '#/components/examples/Error0006'
                Error0007:
                  $ref: '#/components/examples/Error0007'
                Error0008:
                  $ref: '#/components/examples/Error0008'
                Error0009:
                  $ref: '#/components/examples/Error0009'
                Error0010:
                  $ref: '#/components/examples/Error0010'
                Error0011:
                  $ref: '#/components/examples/Error0011'
                Error0012:
                  $ref: '#/components/examples/Error0012'
                Error0016:
                  $ref: '#/components/examples/Error0016'
                Error0020:
                  $ref: '#/components/examples/Error0020'
                Error0036:
                  $ref: '#/components/examples/Error0036'
                Error0039:
                  $ref: '#/components/examples/Error0039'
                Error0040:
                  $ref: '#/components/examples/Error0040'
                Error0051:
                  $ref: '#/components/examples/Error0051'
          headers: {}
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Error0004:
                  $ref: '#/components/examples/Error0004'
          headers: {}
      security: []
components:
  parameters:
    Authorization:
      name: Authorization
      in: header
      description: >-
        O token de autorização no formato 'Bearer <token>'.


        **Importante:** Este header é obrigatório se o seu ambiente possui o
        Access Manager habilitado. Para mais informações, consulte a
        documentação do [Access Manager](/pt/access-manager).
      required: false
      schema:
        type: string
    LedgerId:
      name: ledgerId
      in: query
      description: Identificador do Ledger.
      required: false
      schema:
        type: string
        example: 019c96a0-0ac0-7de9-9f53-9cf842a2ee5a
    SegmentId:
      name: segmentId
      in: query
      description: >-
        Identificador único do produto ou categoria ao qual as taxas estão
        vinculadas. Este campo está associado ao Midaz Ledger.
      required: false
      schema:
        type: string
        example: 019c96a0-0b4e-7079-8be0-ab6bdccf975f
    ContentType:
      name: Content-Type
      in: header
      description: O tipo de mídia do recurso. Deve ser `application/json`.
      required: true
      schema:
        type: string
        example: application/json
    XOrganizationId:
      name: X-Organization-Id
      in: header
      description: O identificador único da Organização associada à requisição.
      required: true
      schema:
        type: string
        example: 019c96a0-0a98-7287-9a31-786e0809c769
  schemas:
    CreatePackagesResponse:
      type: object
      properties:
        id:
          type: string
          description: Identificador único do pacote, no formato UUIDv7.
        feeGroupLabel:
          type: string
          description: >-
            Nome do grupo de taxas, utilizado para identificar o pacote de taxas
            configurado.
        description:
          type: string
          nullable: true
          description: Resumo breve do pacote explicando o que ele abrange.
        transactionRoute:
          type: string
          nullable: true
          description: >-
            A rota contábil principal que define a natureza da transação. Ajuda
            a agrupar operações relacionadas no ledger.
        segmentId:
          type: string
          nullable: true
          description: >-
            Identificador único do Segmento ao qual este Pacote de Taxas está
            vinculado no Midaz Ledger.
        ledgerId:
          type: string
          description: >-
            Identificador único do Ledger ao qual este Pacote de Taxas está
            vinculado no Midaz Ledger.
        minimumAmount:
          type: string
          description: >-
            Valor mínimo da transação abaixo do qual as taxas do pacote não se
            aplicam.
        maximumAmount:
          type: string
          description: >-
            Valor máximo da transação acima do qual as taxas do pacote não se
            aplicam.
        waivedAccounts:
          type: array
          nullable: true
          items:
            type: string
          description: Lista de contas que estão isentas das taxas definidas no pacote.
        fees:
          description: >-
            Objeto contendo regras de taxas com nomes personalizados. Cada chave
            é definida pelo cliente (ex., `admFee`, `iof`) e seu valor deve
            seguir o schema do objeto `Fee`.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Fee'
        enable:
          type: boolean
          description: Se `true`, indica que o pacote está ativo.
        createdAt:
          type: string
          format: date-time
          description: Data em que o pacote foi criado.
        updatedAt:
          type: string
          format: date-time
          nullable: true
          description: Data em que o pacote foi atualizado pela última vez.
        deletedAt:
          type: string
          format: date-time
          nullable: true
          description: Data em que o pacote foi excluído.
      required:
        - id
        - feeGroupLabel
        - ledgerId
        - minimumAmount
        - maximumAmount
        - enable
        - fees
    Error:
      type: object
      properties:
        code:
          type: string
          description: Um identificador único e estável para o erro.
        title:
          type: string
          description: Um resumo breve do problema.
        message:
          type: string
          description: Orientação detalhada para resolver o erro.
      required:
        - code
        - title
        - message
      description: A mensagem de erro da resposta.
    Fee:
      type: object
      description: >-
        Representa uma regra de taxa definida sob uma chave personalizada no
        objeto `fees`. O nome da chave (ex., `admFee`, `iof`) é definido pelo
        cliente e deve seguir a formatação `camelCase`.
      required:
        - feeLabel
        - calculationModel
        - referenceAmount
        - priority
        - isDeductibleFrom
        - creditAccount
      properties:
        feeLabel:
          type: string
          description: Nome de exibição da taxa, como 'Taxa Administrativa' ou 'IOF'.
        calculationModel:
          type: object
          description: Objeto que define o modelo de cálculo da taxa.
          required:
            - applicationRule
            - calculations
          properties:
            applicationRule:
              type: string
              description: >-
                Define como a taxa é calculada. Opções: `maxBetweenTypes`,
                `percentual` ou `flatFee`.
              enum:
                - maxBetweenTypes
                - percentual
                - flatFee
            calculations:
              type: array
              description: >-
                Lista de valores a serem aplicados de acordo com o campo
                `applicationRule`.
              items:
                type: object
                required:
                  - type
                  - value
                properties:
                  type:
                    type: string
                    enum:
                      - percentage
                      - flat
                    description: Tipo de cálculo utilizado, como `flat` ou `percentage`.
                  value:
                    type: string
                    description: Valor da taxa.
        referenceAmount:
          type: string
          description: Define qual valor utilizar como base para o cálculo da taxa.
          enum:
            - originalAmount
            - afterFeesAmount
        priority:
          type: integer
          description: Define a ordem em que as taxas são aplicadas.
        isDeductibleFrom:
          type: boolean
          description: Se `true`, indica que a taxa é deduzida do valor base.
        creditAccount:
          type: string
          description: O alias da conta que receberá os créditos gerados pela taxa.
        routeFrom:
          type: string
          description: Especifica a rota contábil para a operação de débito.
        routeTo:
          type: string
          description: Especifica a rota contábil para a operação de crédito.
  examples:
    Error0003:
      summary: Bad request
      value:
        code: FEE-0003
        title: Bad request
        message: >-
          The server could not understand the request due to malformed syntax.
          Please check the listed fields and try again.
    Error0006:
      summary: Invalid query parameter
      value:
        code: FEE-0006
        title: Invalid query parameter
        message: >-
          One or more query parameters are in an incorrect format. Please check
          the following parameters 'parametros_erros' and ensure they meet the
          required format before trying again.
    Error0007:
      summary: Invalid date format error
      value:
        code: FEE-0007
        title: Invalid date format error
        message: >-
          The 'initialDate', 'finalDate', or both are in the incorrect format.
          Please use the 'yyyy-mm-dd' format and try again.
    Error0008:
      summary: Invalid final date error
      value:
        code: FEE-0008
        title: Invalid final date error
        message: >-
          The 'finalDate' cannot be earlier than the 'initialDate'. Please
          verify the dates and try again.
    Error0009:
      summary: Date range exceeds limit error
      value:
        code: FEE-0009
        title: Date range exceeds limit error
        message: >-
          The range between 'initialDate' and 'finalDate' exceeds the permitted
          limit of %v months. Please adjust the dates and try again.
    Error0010:
      summary: Invalid date range error
      value:
        code: FEE-0010
        title: Invalid date range error
        message: >-
          Both 'initialDate' and 'finalDate' fields are required and must be in
          the 'yyyy-mm-dd' format. Please provide valid dates and try again.
    Error0011:
      summary: Pagination limit exceeded
      value:
        code: FEE-0011
        title: Pagination limit exceeded
        message: >-
          The pagination limit exceeds the maximum allowed of %v items per page.
          Please verify the limit and try again.
    Error0012:
      summary: Entity not found
      value:
        code: FEE-0012
        title: Entity not found
        message: >-
          No entity was found for the given ID. Please make sure to use the
          correct ID for the entity you are trying to manage.
    Error0016:
      summary: Invalid path parameter
      value:
        code: FEE-0016
        title: Invalid path parameter
        message: >-
          Path parameters is in an incorrect format. Please check the following
          parameter and ensure they meet the required format before trying
          again.
    Error0020:
      summary: Missing header
      value:
        code: FEE-0020
        title: Missing header
        message: >-
          Headers parameters is required. Please check the following header
          parameters %v and ensure they are passing the values correctly.
    Error0036:
      summary: Invalid sort order
      value:
        code: FEE-0036
        title: Invalid sort order
        message: Invalid sort_order value. Expected 'asc' or 'desc'.
    Error0039:
      summary: Invalid segmentID
      value:
        code: FEE-0039
        title: Invalid segmentID
        message: >-
          The specified segmentID is not a valid UUID. Please check the value
          passed.
    Error0040:
      summary: Invalid ledgerID
      value:
        code: FEE-0040
        title: Invalid ledgerID
        message: >-
          The specified ledgerID is not a valid UUID. Please check the value
          passed.
    Error0051:
      summary: Invalid page parameter
      value:
        code: FEE-0051
        title: Invalid page parameter
        message: Query parameter page is invalid. The page must be greater than 0.
    Error0004:
      summary: Internal Server Error
      value:
        code: FEE-0004
        title: Internal Server Error
        message: >-
          The server encountered an unexpected error. Please try again later or
          contact support.

````