Class: Ledger::Sdk::Models::Fee

Inherits:
Base
  • Object
show all
Defined in:
lib/ledger/sdk/models/fee.rb

Overview

Represents the collection of fees attached to a container from the Ledger API.

Fees are always accessed in the context of a container via /containers/:container_id/fees. Unlike most of the SDK, fees are writable: they can be created, updated and destroyed.

Examples:

List fees for a container

fees = Ledger::Sdk.Container(42).fees.list

Filter fees by kind and as-of date

Ledger::Sdk.Container(42).fees.list { { filters: { kind: 'financial_management', as_of: '2026-01-01' } } }

Create a fee

fee = Ledger::Sdk.Container(42).fees.create(kind: 'financial_management', rate: 0.01)

Defined Under Namespace

Classes: Instance

Instance Method Summary collapse

Methods inherited from Base

#initialize, #list

Constructor Details

This class inherits a constructor from Ledger::Sdk::Models::Base

Instance Method Details

#create(attributes) ⇒ Instance

Creates a fee for the parent container.

Parameters:

  • attributes (Hash)

    the fee attributes, e.g. { kind: 'financial_management', rate: 0.01 }

Returns:

  • (Instance)

    the created fee instance