Skip to content

Commit c111620

Browse files
committed
feat(multi-entity): expose billing_entity_code on subscription, wallet, invoice, and credit-note models
## Context The Lago API lets callers pin a subscription, wallet, or one-off invoice to a specific billing entity within a multi-entity organization, and returns the resolved entity on every resource response (subscription, wallet, invoice, credit note). The Python client's models did not carry the field, so callers couldn't set it on create/update or read it back from the parsed responses. ## Description Adds `billing_entity_code: Optional[str]` to the `Subscription` and `Wallet` request models (POST + PUT) and to their response models, to the `OneOffInvoice` and `InvoicePreview` request models for `POST /invoices` and `POST /invoices/preview`, and to `CreditNoteResponse` so the field is parsed from credit-note payloads. No changes are needed for the list endpoints: the `find_all` mixin already takes a generic `options: QueryPairs` dict that natively carries `billing_entity_codes[]` as a list value.
1 parent f943162 commit c111620

4 files changed

Lines changed: 7 additions & 0 deletions

File tree

lago_python_client/models/credit_note.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class CreditNoteAppliedTaxes(BaseResponseModel):
3939
class CreditNoteResponse(BaseResponseModel):
4040
lago_id: Optional[str]
4141
sequential_id: Optional[int]
42+
billing_entity_code: Optional[str]
4243
number: Optional[str]
4344
lago_invoice_id: Optional[str]
4445
invoice_number: Optional[str]

lago_python_client/models/invoice.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class OneOffInvoice(BaseModel):
5757
error_details: Optional[ErrorDetailsResponse]
5858
payment_method: Optional[PaymentMethod]
5959
invoice_custom_section: Optional[InvoiceCustomSectionInput]
60+
billing_entity_code: Optional[str]
6061

6162

6263
class InvoicePreview(BaseModel):
@@ -66,6 +67,7 @@ class InvoicePreview(BaseModel):
6667
coupons: Optional[CouponsList]
6768
customer: Optional[Customer]
6869
subscriptions: Optional[Subscriptions]
70+
billing_entity_code: Optional[str]
6971

7072

7173
class InvoiceAppliedTax(BaseResponseModel):

lago_python_client/models/subscription.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class Subscription(BaseModel):
2020
payment_method: Optional[PaymentMethod]
2121
invoice_custom_section: Optional[InvoiceCustomSectionInput]
2222
consolidate_invoice: Optional[bool]
23+
billing_entity_code: Optional[str]
2324

2425

2526
class Subscriptions(BaseModel):
@@ -57,6 +58,7 @@ class SubscriptionResponse(BaseResponseModel):
5758
payment_method: Optional[PaymentMethod]
5859
applied_invoice_custom_sections: Optional[AppliedInvoiceCustomSections]
5960
consolidate_invoice: Optional[bool]
61+
billing_entity_code: Optional[str]
6062

6163

6264
class SubscriptionsResponse(BaseResponseModel):

lago_python_client/models/wallet.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ class Wallet(BaseModel):
7979
metadata: Optional[Dict[str, Optional[str]]]
8080
payment_method: Optional[PaymentMethod]
8181
invoice_custom_section: Optional[InvoiceCustomSectionInput]
82+
billing_entity_code: Optional[str]
8283

8384

8485
class WalletResponse(BaseResponseModel):
@@ -111,3 +112,4 @@ class WalletResponse(BaseResponseModel):
111112
metadata: Optional[Dict[str, Optional[str]]]
112113
payment_method: Optional[PaymentMethod]
113114
applied_invoice_custom_sections: Optional[AppliedInvoiceCustomSections]
115+
billing_entity_code: Optional[str]

0 commit comments

Comments
 (0)