Skip to content

Critical error on LLC business structures #213

Description

@justmobilize

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:

Image

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:

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

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.

Activity

  1. github-actions commented on Mar 31, 2026

    @github-actions

    PETOSS-924

  2. github-actions commented on Mar 31, 2026

    @github-actions

    Thanks for raising an issue, a ticket has been created to track your request

  3. CedricConday commented on Jul 2, 2026

    @CedricConday

    Same root cause as #203/#205/#206 — the SDK's hardcoded allowed_values rejects an enum value the Xero API legitimately returns, raising ValueError while deserializing an otherwise-valid response.

    My open PR #231 makes deserialize_model tolerant of exactly this: it tries the normal validating construction first and only on ValueError falls back to preserving the raw value — so an org with organisation_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) to allowed_values is 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions