Skip to content

feat(multientities): add billing_entity_id to payment_receipts and mailers #3648

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 15, 2025

Conversation

ancorcruz
Copy link
Contributor

Roadmap Task

👉 https://getlago.canny.io/feature-requests/p/support-billing-from-multiple-entities

Context

Users who invoice the same products across multiple entities face the challenge of managing separate Lago organizations.

This requires duplicating all billable metrics, plans, and setup, while also implementing additional logic to handle two different API keys and ensure the correct one is used for each affiliated entity. This process adds complexity and overhead to their billing operations.

Description

  • Add billing_entity_id to payment_receipts to identify the billing entity from which the payment receipt was issued.
  • Migrate all existing payment receipts to have a billing_entity_id.
  • Migrate payment receipts, payment requests, and credit notes mailers and templates to use the billing_entity as source of information.

…ilers

 ## Roadmap Task

👉 https://getlago.canny.io/feature-requests/p/support-billing-from-multiple-entities

 ## Context

Users who invoice the same products across multiple entities face the
challenge of managing separate Lago organizations.

This requires duplicating all billable metrics, plans, and setup, while
also implementing additional logic to handle two different API keys and
ensure the correct one is used for each affiliated entity. This process
adds complexity and overhead to their billing operations.

 ## Description

Add `billing_entity_id` to `payment_receipts` to identify the billing entity from which the payment receipt was issued.
Migrate all existing payment receipts to have a `billing_entity_id`.
Migrate payment receipts, payment requests, and credit notes mailers and templates to use the `billing_entity` as source of information.
@ancorcruz ancorcruz requested a review from annvelents May 15, 2025 09:04
@ancorcruz ancorcruz self-assigned this May 15, 2025
ancorcruz added 4 commits May 15, 2025 10:45
issues with references between resources in test setup, customer
belonged to a different organization and billing entity
@ancorcruz ancorcruz merged commit 30350d3 into main May 15, 2025
14 checks passed
@ancorcruz ancorcruz deleted the feat/multientities/migrate-mailers-and-templates branch May 15, 2025 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants