feat(client): add list_fees and get_fee methods#47
Merged
Conversation
## Context
With FeeFilters, requests, and responses now defined in lago-types,
the client side needs query methods to actually hit Lago's `/fees`
endpoint.
## Description
Adds `LagoClient::list_fees` and `LagoClient::get_fee` in
`lago-client/src/queries/fee.rs`, registered via `queries.rs`. The list
method mirrors `list_invoices`: it composes pagination and filter
query params and dispatches a GET request. The detail method hits
`/fees/{lago_id}`.
## Context Each resource module ships with a runnable example demonstrating common operations against a real Lago account. Adding the fee example keeps the convention consistent and gives downstream consumers a quick reference for the new methods. ## Description Adds `lago-client/examples/fee.rs` showing four flows: a default list, filtering by FeeType::Subscription for MRR base fees, filtering by billable metric code for selected usage charges, and a single fee lookup by Lago ID. Registers the example in `lago-client/Cargo.toml`.
## Context CI step `cargo fmt --all -- --check` failed on the multi-line signature of `LagoClient::list_fees`. The signature fits within rustfmt's line budget on a single line. ## Description Collapses the `list_fees` signature to one line so `cargo fmt --check` passes. No behavioral change.
Aligns `get_fee` with the pattern established by `update_billable_metric` in #38 — wraps the constructed URL in `Url::parse` with explicit `LagoError::Configuration` mapping rather than passing a raw `format!` string to `make_request`. No behavioral change.
## Context `lago-types 0.1.23` was published to crates.io with the `/fees` endpoint types from #44. This commit consumes that release. ## Description - `lago-client/Cargo.toml`: version 0.1.24 → 0.1.25 (new release for the `list_fees` / `get_fee` methods added in this PR) - `lago-client/Cargo.toml`: dep `lago-types = "0.1.22"` → `"0.1.23"` - `Cargo.lock`: regenerated; lago-client now resolves lago-types from the crates.io registry at 0.1.23
sarkissianraffi
approved these changes
May 20, 2026
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two read-only client methods consuming the
/feesendpoint types that landed in #44 + were published aslago-types 0.1.23(via #45):LagoClient::list_fees(Option<ListFeesRequest>)— list withFeeFilters(fee_type, billable_metric_code, customer, subscription, currency, payment_status, created_at_from/to) plus paginationLagoClient::get_fee(GetFeeRequest)— single fee by Lago ID (UUID)Plus an
examples/fee.rsshowing the four common flows: default list, filter byFeeType::Subscription(MRR base), filter bybillable_metric_code(selected usage charges), single-fee lookup.Context
Downstream consumers — including the Lago Agent Toolkit MCP server need fee-level data access. Today the SDK exposes invoices but no way to drill into the fee breakdown. This PR closes that gap by adding the client methods on top of #44's types and #45's release.
Implementation notes
invoice.rsquery module patternget_feeusesUrl::parsewithLagoError::Configurationmapping, matching the convention fromupdate_billable_metric(feat(billable-metric): Add update_billable_metric client method #38)Version bumps
lago-client:0.1.24→0.1.25(this PR adds two new public methods)lago-client/Cargo.tomldep:lago-types = "0.1.22"→"0.1.23"(consumes Feat: add /fees endpoint support to lago-types and lago-client #44's fee modules via the chore: bump lago-types to 0.1.23 #45 publish)Cargo.lock: regenerated; lago-client now resolveslago-types 0.1.23from the registryTest plan
cargo fmt --all -- --checkcargo clippy --all-features -- -D warningscargo test --all-featurescargo build --release --all-featurescargo publish --dry-runfor bothlago-typesandlago-clientlist_feesandget_feeboth return correctly throughtools/call)Commits
Followups (separate PR)
getlago/lago-agent-toolkitaddinglist_fees/get_feeas MCP tools — branch is ready, blocked on this PR + alago-client 0.1.25publish.