Location

Use the Location class to associate location information with an Item. It serves use cases such as filtering products based on availability in specific areas.

The Location class is intended solely for use with items and is not applicable to other entities or functionalities.

FieldDescriptionModifier and Type
cityName of the city.java.lang.String
latitudeLatitudinal coordinate of the location, should be from -90 to 90.java.lang.Double
longitudeLongitudinal coordinate of the location, should be from -180 to 180.java.lang.Double
postalCodePostal code of the location.java.lang.String
stateProvinceCodeName of the state or province.java.lang.String

Latitudinal coordinate of the location, should be from -90 to 90.

Longitudinal coordinate of the location, should be from -180 to 180.

Name of the city.

Name of the state or province.

Postal code of the location.

Creates a location with geographic coordinates.

Parameters:

ParameterDescription
latitudeLatitudinal coordinate, should be from -90 to 90
longitudeLongitudinal coordinate, should be from -180 to 180

Creates a location with city and state.

Parameters:

ParameterDescription
cityCity name
stateProvinceCodeState or Province Code (e.g. MA)

Creates a location with postal code.

Parameters:

ParameterDescription
postalCodePostal code
MethodModifier and Type
fromJSONObject(org.json.JSONObject json)static Location