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

# List Packages

> Use this endpoint to retrieve all registered packages along with their associated fees.



## OpenAPI

````yaml /en/openapi/v3-current/fees-engine.yaml get /v1/packages
openapi: 3.1.0
info:
  title: Fees Engine
  description: ''
  version: 3.2.0
servers:
  - url: https://fees.sandbox.lerian.net
security: []
tags:
  - name: Fees Engine
paths:
  /v1/packages:
    get:
      tags:
        - Packages API
      summary: List Packages
      description: >-
        Use this endpoint to retrieve all registered packages along with their
        associated fees.
      parameters:
        - name: page
          in: query
          description: Page number to be returned.
          required: false
          example: 0
          schema:
            type: integer
        - name: limit
          in: query
          description: Number of records returned.
          required: false
          example: 1
          schema:
            type: integer
        - name: total
          in: query
          description: Number of items returned.
          required: false
          example: 10
          schema:
            type: integer
        - name: sortOrder
          in: query
          description: The order used to sort the results.
          required: false
          example: desc
          schema:
            type: string
        - name: transactionRoute
          in: query
          description: >-
            The main accounting route that defines the nature of the
            transaction. Helps group related operations in the ledger.
          required: false
          example: TED-DEBIT
          schema:
            type: string
        - name: enable
          in: query
          description: If `true` it indicates that the package is active.
          required: false
          example: true
          schema:
            type: boolean
        - name: startDate
          in: query
          description: >-
            The starting date of the period you want to retrieve. **Must also
            use the `end_date`**.
          required: false
          example: '2025-01-01'
          schema:
            type: string
        - name: endDate
          in: query
          description: >-
            The end date of the period you want to retrieve. **Must also use the
            `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: >-
            Indicates that the resource was successfully created and the
            operation was completed as expected.
          content:
            application/json:
              schema:
                type: object
                properties:
                  items:
                    type: array
                    items:
                      $ref: '#/components/schemas/CreatePackagesResponse'
                    description: List with the items returned.
                  page:
                    type: integer
                    description: Page number returned.
                  limit:
                    type: integer
                    description: Number of records returned.
                  total:
                    type: integer
                    description: Number of items returned.
              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: >-
        The authorization token in the 'Bearer <token>' format.  


        **Important:** This header is required if your environment has Access
        Manager enabled. For more information, refer to the [Access
        Manager](/en/access-manager) documentation.
      required: false
      schema:
        type: string
    LedgerId:
      name: ledgerId
      in: query
      description: Ledger identifier.
      required: false
      schema:
        type: string
        example: 019c96a0-0ac0-7de9-9f53-9cf842a2ee5a
    SegmentId:
      name: segmentId
      in: query
      description: >-
        Unique identifier of the product or category to which the taxes are
        linked. This field is associated with the Midaz Ledger.
      required: false
      schema:
        type: string
        example: 019c96a0-0b4e-7079-8be0-ab6bdccf975f
    ContentType:
      name: Content-Type
      in: header
      description: The type of media of the resource. Must be `application/json`.
      required: true
      schema:
        type: string
        example: application/json
    XOrganizationId:
      name: X-Organization-Id
      in: header
      description: The unique identifier of the Organization associated with the request.
      required: true
      schema:
        type: string
        example: 019c96a0-0a98-7287-9a31-786e0809c769
  schemas:
    CreatePackagesResponse:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the package, in UUIDv7 format.
        feeGroupLabel:
          type: string
          description: Name of the tax group, used to identify the configured tax package.
        description:
          type: string
          description: Short summary of for the package explaining what it covers.
        transactionRoute:
          type: string
          description: >-
            The main accounting route that defines the nature of the
            transaction. Helps group related operations in the ledger.
        segmentId:
          type: string
          description: >-
            Unique identifier of the Segment this Fee Package is linked to in
            the Midaz Ledger.
        ledgerId:
          type: string
          description: >-
            Unique identifier of the Ledger this Fee Package is linked to in the
            Midaz Ledger.
        minimumAmount:
          type: string
          description: >-
            Minimum transaction amount below which the fees in the package don't
            apply.
        maximumAmount:
          type: string
          description: >-
            Maximum transaction amount above which the fees in the package don't
            apply.
        waivedAccounts:
          type: array
          items:
            type: string
          description: >-
            List of accounts that are exempt from the taxes defined in the
            package.
        fees:
          description: >-
            Object containing custom-named tax rules. Each key is defined by the
            client (e.g., `admFee`, `iof`, and its value must follow the `Fee`
            object schema.
          type: object
          additionalProperties:
            $ref: '#/components/schemas/Fee'
        enable:
          type: boolean
          description: If `true` it indicates that the package is active.
        createdAt:
          type: string
          format: date-time
          description: Date when the package was created.
        updatedAt:
          type: string
          format: date-time
          description: Date when the package was last updated.
        deletedAt:
          type: string
          format: date-time
          description: Date when the package was deleted.
      required:
        - id
        - feeGroupLabel
        - ledgerId
        - minimumAmount
        - maximumAmount
        - enable
        - fees
    Error:
      type: object
      properties:
        code:
          type: string
          description: A unique, stable identifier for the error.
        title:
          type: string
          description: A brief summary of the issue.
        message:
          type: string
          description: Detailed guidance for resolving the error.
      required:
        - code
        - title
        - message
      description: The response message error.
    Fee:
      type: object
      description: >-
        Represents a tax rule defined under a custom key in the `fees` object.
        The key name (e.g., `admFee`, `iof`) is defined by the client and must
        follow `camelCase` formatting.
      required:
        - feeLabel
        - calculationModel
        - referenceAmount
        - priority
        - isDeductibleFrom
        - creditAccount
      properties:
        feeLabel:
          type: string
          description: Display name for the fee, like 'Administrative Fee' or 'IOF'.
        calculationModel:
          type: object
          description: Object that defines the calculation model for the fee.
          required:
            - applicationRule
            - calculations
          properties:
            applicationRule:
              type: string
              description: >-
                Defines how the fee is calculated. Options: `maxBetweenTypes`,
                `percentual`, or `flatFee`.
              enum:
                - maxBetweenTypes
                - percentual
                - flatFee
            calculations:
              type: array
              description: >-
                List of values to be applied according to the `applicationRule`
                field.
              items:
                type: object
                required:
                  - type
                  - value
                properties:
                  type:
                    type: string
                    description: Type of calculation used, like `flat` or `percentage`.
                  value:
                    type: string
                    description: Tax amount.
        referenceAmount:
          type: string
          description: Defines which amount to use as the base for tax calculation.
          enum:
            - originalAmount
            - afterFeesAmount
        priority:
          type: integer
          description: Sets the order in which fees are applied.
        isDeductibleFrom:
          type: boolean
          description: >-
            If `true`, it indicates that the fee is deducted from the base
            amount.
        creditAccount:
          type: string
          description: >-
            The alias of the account that will receive the credits generated by
            the fee.
        routeFrom:
          type: string
          description: Specifies the accounting route for the debit operation.
        routeTo:
          type: string
          description: Specifies the accounting route for the credit operation.
  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
    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.

````