Skip to content

feat(wallets): Move wallets API under customers#366

Open
vankiru wants to merge 8 commits intomainfrom
feat/move-wallets-api-to-customer-wallets
Open

feat(wallets): Move wallets API under customers#366
vankiru wants to merge 8 commits intomainfrom
feat/move-wallets-api-to-customer-wallets

Conversation

@vankiru
Copy link
Contributor

@vankiru vankiru commented Feb 11, 2026

Context

The PR implements api for /customers/:customer_external_id/wallets and /customers/:customer_external_id/wallets/:code/metadata endpoints.

Related PR: getlago/lago-api#4995

Description

The new customer wallets and metadata API looks like this 👇

# GET /customers/:customer_id/wallets
client.customers.wallets.get_all(customer_id)
client.customers.wallets.get_all(customer_id, options={"page": 1, "per_page": 100})

# POST /customers/:customer_id/wallets
client.customers.wallets.create(customer_id, params)

# GET /customers/:customer_id/wallets/:wallet_code
client.customers.wallets.get(customer_id, wallet_code)

# PATCH /customers/:customer_id/wallets/:wallet_code
client.customers.wallets.update(customer_id, wallet_code, params)

# DELETE /customers/:customer_id/wallets/:wallet_code
client.customers.wallets.destroy(customer_id, wallet_code)

And for the metadata:

# POST /customers/:customer_id/wallets/:wallet_code/metadata
client.customers.wallets.metadata.replace(customer_id, wallet_code, metadata)

# PATCH /customers/:customer_id/wallets/:wallet_code/metadata
client.customers.wallets.merge(customer_id, wallet_code, metadata)

# DELETE /customers/:customer_id/wallets/:wallet_code/metadata
client.customers.wallets.delete_all(customer_id, wallet_code)

# DELETE /customers/:customer_id/wallets/:wallet_code/metadata/:key
client.customers.wallets.delete_key(customer_id, wallet_code, key)

Nested Commands

Similar to Ruby, this PR introduces a few new nested mixins that add support for nested resources. They're pretty close to the single-resource mixins, with a couple of differences:

  • update takes the resource ids first, and then the params as the last argument,
client.customers.wallets.update(customer_id, wallet_code, params)
# vs
client.customers.update(params, customer_id)
  • the timeout option for all methods, and options for find_all, have to be passed as keyword arguments only
client.customers.wallets.get(customer_id, wallet_code, timeout=1.0)
client.customers.wallets.get_all(customer_id, options={"page": 1})

@vankiru vankiru changed the title eat(wallets): Move wallets API under customers feat(wallets): Move wallets API under customers Feb 12, 2026
@vankiru vankiru marked this pull request as ready for review February 12, 2026 11:43
@vankiru vankiru force-pushed the feat/move-wallets-api-to-customer-wallets branch from 6196069 to f834aad Compare February 17, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments