From 58212a900eee5cca687528c51029decaf6f60d3e Mon Sep 17 00:00:00 2001 From: Vincent Pochet Date: Thu, 19 Mar 2026 10:55:38 +0100 Subject: [PATCH] misc(customer): Expose error_details on API --- lago_python_client/models/customer.py | 2 ++ lago_python_client/models/error_detail.py | 2 +- tests/fixtures/customer.json | 24 +++++++++++++---------- tests/fixtures/invoice.json | 11 ++++++++--- 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/lago_python_client/models/customer.py b/lago_python_client/models/customer.py index 2b979127..8919b98a 100644 --- a/lago_python_client/models/customer.py +++ b/lago_python_client/models/customer.py @@ -3,6 +3,7 @@ from lago_python_client.base_model import BaseModel from ..base_model import BaseResponseModel +from .error_detail import ErrorDetailsResponse from .invoice_custom_section import InvoiceCustomSectionsResponseList from .tax import TaxesResponse @@ -145,3 +146,4 @@ class CustomerResponse(BaseResponseModel): skip_invoice_custom_sections: Optional[bool] applicable_invoice_custom_sections: Optional[InvoiceCustomSectionsResponseList] billing_entity_code: Optional[str] + error_details: Optional[ErrorDetailsResponse] diff --git a/lago_python_client/models/error_detail.py b/lago_python_client/models/error_detail.py index b6666967..d095678b 100644 --- a/lago_python_client/models/error_detail.py +++ b/lago_python_client/models/error_detail.py @@ -6,7 +6,7 @@ class ErrorDetailResponse(BaseModel): - organization_id: str + lago_id: str error_code: str details: Optional[Dict[str, Any]] diff --git a/tests/fixtures/customer.json b/tests/fixtures/customer.json index 74b9b0c7..87908257 100644 --- a/tests/fixtures/customer.json +++ b/tests/fixtures/customer.json @@ -36,10 +36,7 @@ "provider_customer_id": "cus_12345", "sync_with_provider": true, "document_locale": "fr", - "provider_payment_methods": [ - "card", - "sepa_debit" - ] + "provider_payment_methods": ["card", "sepa_debit"] }, "shipping_address": { "city": "Paris", @@ -84,12 +81,19 @@ ], "applicable_invoice_custom_sections": [ { - "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90", - "name": "custom_section_name", - "code": "custom_section_code", - "description": "custom_section_description", - "details": "custom_section_details", - "display_name": "custom_section_display_name" + "lago_id": "1a901a90-1a90-1a90-1a90-1a901a901a90", + "name": "custom_section_name", + "code": "custom_section_code", + "description": "custom_section_description", + "details": "custom_section_details", + "display_name": "custom_section_display_name" + } + ], + "error_details": [ + { + "lago_id": "4c904c90-4c90-4c90-4c90-4c904c904c90", + "error_code": "tax_error", + "details": { "tax_error": ["customerAddressCouldNotResolve: Service failure"] } } ] } diff --git a/tests/fixtures/invoice.json b/tests/fixtures/invoice.json index d0d2fd21..a9720db3 100644 --- a/tests/fixtures/invoice.json +++ b/tests/fixtures/invoice.json @@ -144,9 +144,7 @@ "name": "User Seats", "invoice_display_name": "charge_invoice_display_name", "filters": { - "region": [ - "us-east-1" - ] + "region": ["us-east-1"] } }, "amount_cents": 100, @@ -184,6 +182,13 @@ "name": "Free Beer" } } + ], + "error_details": [ + { + "lago_id": "4c904c90-4c90-4c90-4c90-4c904c904c90", + "error_code": "tax_error", + "details": { "tax_error": ["customerAddressCouldNotResolve: Service failure"] } + } ] } }