Repository navigation
Critical error on LLC business structures #213
Copy link
Copy link
Open
Description
If a user selects any of the following business structures:
- CCORPORATIONLLC = LLC (C corporation)
- PARTNERSHIPLLC = LLC (Partnership)
- SCORPORATIONLLC = LLC (S corporation)
- SINGLEMEMBERLLC = LLC (Sole owner)
- UNSPECIFIED = Unspecified
from here:
Only these values:
- COMPANY = C corporation
- CHARITY = Exempt Organization
- NOTFORPROFIT = Nonprofit
- PARTNERSHIP = Partnership
- TRUST = Private Foundation
- SCORPORATION = S corporation
- SOLETRADER = Sole Proprietor
Are defined in:
xero-python/xero_python/accounting/models/organisation.py
Lines 423 to 438 in 5544d7d
| allowed_values = [ | |
| "ACCOUNTING_PRACTICE", | |
| "COMPANY", | |
| "CHARITY", | |
| "CLUB_OR_SOCIETY", | |
| "INDIVIDUAL", | |
| "LOOK_THROUGH_COMPANY", | |
| "NOT_FOR_PROFIT", | |
| "PARTNERSHIP", | |
| "S_CORPORATION", | |
| "SELF_MANAGED_SUPERANNUATION_FUND", | |
| "SOLE_TRADER", | |
| "SUPERANNUATION_FUND", | |
| "TRUST", | |
| "None", | |
| ] # noqa: E501 |
and
xero-python/xero_python/accounting/models/organisation.py
Lines 900 to 915 in 5544d7d
| allowed_values = [ | |
| "ACCOUNTING_PRACTICE", | |
| "COMPANY", | |
| "CHARITY", | |
| "CLUB_OR_SOCIETY", | |
| "INDIVIDUAL", | |
| "LOOK_THROUGH_COMPANY", | |
| "NOT_FOR_PROFIT", | |
| "PARTNERSHIP", | |
| "S_CORPORATION", | |
| "SELF_MANAGED_SUPERANNUATION_FUND", | |
| "SOLE_TRADER", | |
| "SUPERANNUATION_FUND", | |
| "TRUST", | |
| "None", | |
| ] # noqa: E501 |
I'm happy to open a pull request, but don't if there are others missing from non_US entity types.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon Mar 31, 2026
PETOSS-924
github-actions commentedon Mar 31, 2026
Thanks for raising an issue, a ticket has been created to track your request
CedricConday commentedon Jul 2, 2026
Same root cause as #203/#205/#206 — the SDK's hardcoded
allowed_valuesrejects an enum value the Xero API legitimately returns, raisingValueErrorwhile deserializing an otherwise-valid response.My open PR #231 makes
deserialize_modeltolerant of exactly this: it tries the normal validating construction first and only onValueErrorfalls back to preserving the raw value — so an org withorganisation_entity_type = SINGLEMEMBERLLC(or any future unknown enum) deserializes instead of crashing, which resolves the "critical error" generically.Adding the LLC values (
CCORPORATIONLLC,PARTNERSHIPLLC,SCORPORATIONLLC,SINGLEMEMBERLLC,UNSPECIFIED) toallowed_valuesis still worth doing as the complementary "make them first-class" fix — the two are orthogonal (tolerance prevents crashes; the enum list makes the values official). Happy to fold a regression test for the LLC case into #231 if that's useful.