Skip to content

The Xero API returned a contact with tax_number_type set to "TAXNUMBERTYPE/SSN", but the Python SDK only accepts these exact values: 'SSN' 'EIN' 'ITIN' 'ATIN' 'None' #205

@hiselitelordship

Description

@hiselitelordship

I have been forced to monkey patch the SDK. Xero team can contact me to get the Tenant ID that generates this error.

original_setter = contact.Contact.tax_number_type.fset
def patched_setter(self, tax_number_type):
"""Setter that handles malformed tax_number_type from Xero API."""
if tax_number_type and isinstance(tax_number_type, str) and "TAXNUMBERTYPE/" in tax_number_type:
tax_number_type = tax_number_type.replace("TAXNUMBERTYPE/", "")
original_setter(self, tax_number_type)

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