Validation Logic
Thred validatesentity_type based on the business’s country:
- Restricted countries (GB, DE, NL, ES, BE): Must use predefined business entity type codes
- All other countries: Accept any string value for
entity_type
Business Entity Types by Country
For these countries, the API will reject requests with invalid business entity types (HTTP 400).- United Kingdom (GB)
- Germany (DE)
- Netherlands (NL)
- Spain (ES)
- Belgium (BE)
Valid business entity types:
Example:
| Code | Description |
|---|---|
limited | Ltd (Private Limited Company) |
sole_trader | Sole Trader |
llp | Limited Liability Partnership |
partnership | Partnership |
plc | Public Limited Company |
Validation Behavior
Cross-Field Validation
The API validatesentity_type against country in both create and update operations:
Create Business:
Error Response
Invalid business entity types return HTTP 400 with details:Edge Cases
Blank entity_type
Blank entity_type
The
entity_type field is optional (blank=True). Omitting it or passing an empty string is valid for all countries.Case sensitivity
Case sensitivity
Business entity type codes are case-insensitive. The API automatically normalizes them to lowercase:
- ✅
"limited"→ stored as"limited" - ✅
"Limited"→ stored as"limited" - ✅
"LIMITED"→ stored as"limited" - ✅
"GMBH"→ stored as"gmbh"
Updating country
Updating country
When updating a business’s country, the existing To change country, update both fields together with a valid business entity type for the target country.
entity_type is validated against the new country: