Skip to main content

PostalCode

Represents a postal/zip code entry with geographic coordinates, timezone information, and optional custom values. Postal codes are scoped per organization and linked to Country and State entities.

Properties

PropertyTypeRequiredDescription
idintAutoPrimary key
organizationIdintYesOrganization scope
codestringYesThe postal/zip code value
countryCodestringYesISO country code (FK to Country)
placeNamestringYesPlace/city name for this postal code
stateCodestring?NoState/province code (FK to State)
accuracyAccuracyTypes?NoAccuracy level of the coordinates
timeZonestring?NoIANA timezone identifier (e.g., America/Chicago)
customValuesDictionary<string, object>?NoArbitrary key-value pairs (stored as jsonb)
locationPoint?NoGeographic coordinates (longitude, latitude) using WGS 84 (SRID 4326)
PropertyTypeDescription
countryCountry?Related Country entity
stateState?Related State entity

AccuracyTypes Enum

ValueNameDescription
1RegionRegion-level accuracy
2MunicipalityMunicipality-level accuracy
3NeighborhoodNeighborhood-level accuracy
4PlacePlace-level accuracy
5StreetStreet-level accuracy
6CentroidCentroid-level accuracy

GraphQL

Available via the postalCode GraphQL type. Exposes all properties including timeZone and customValues (as AnyType).

Mutations

The entity supports the following mutations via setter methods:

  • ChangeCode(code) — Update the postal code value
  • ChangePlaceName(placeName) — Update the place name
  • ChangeCoordinates(latitude, longitude, accuracy) — Update lat/lng and accuracy
  • ChangeCountry(country) / ChangeCountryCode(countryCode) — Update country reference
  • ChangeState(state) / ChangeStateCode(stateCode) — Update state reference
  • ChangeTimeZone(timeZone) — Update the IANA timezone identifier
  • ChangeCustomValues(customValues) — Merge custom key-value pairs
  • ChangeLatitude(latitude) / ChangeLongitude(longitude) — Update individual coordinates