---
title: Location by Postal Code
slug: api-documentation/location-by-postal-code
docTags: 
createdAt: 2026-08-27T16:56:29.420Z
---

{
  "id": "nJqWVLhyqlf5qShQhsAHN",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.upstartcommerce.com/v1/location/search/postalcode2",
    "servers": [
      {
        "url": "https://api.upstartcommerce.com/v1/location/search/postalcode2"
      }
    ],
    "name": "Location by Postal Code",
    "description": "<p>Warning: Deprecated\nThis endpoint returns a set of locations-ordered by proximity to the postal code provided.</p>\n<p>Authorized permissions:</p>\n<ul>\n<li><code>location.read</code></li>\n</ul>\n<p>Authorized roles:</p>\n<ul>\n<li>customer.default</li>\n<li>customer.anonymous</li>\n</ul>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "x-upstart-tenant",
          "type": "string",
          "description": "Tenant identifier associated with the site this call is for."
        },
        {
          "kind": "optional",
          "name": "x-upstart-site",
          "type": "string",
          "description": "Unique identifier for the site."
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "<p>The request body should contain the postal code to search on as well as any other terms/filters.</p>",
          "customType": "SearchByPostalCodeQuery",
          "schema": [
            {
              "name": "filter",
              "kind": "required",
              "type": "object",
              "description": "Restricts results to locations within a distance of a postal code.",
              "modelRef": "#/components/schemas/PostalCodeFilter",
              "customType": "PostalCodeFilter",
              "schema": [],
              "complexType": "allOf",
              "complexItems": [
                {
                  "name": "TermDistanceFilter",
                  "description": "",
                  "modelRef": "#/components/schemas/TermDistanceFilter",
                  "schema": [
                    {
                      "name": "term",
                      "kind": "optional",
                      "type": "object",
                      "description": "<p>A node in a search expression: a condition, or a combination of nested terms.</p>",
                      "modelRef": "#/components/schemas/SearchTerm",
                      "customType": "SearchTerm",
                      "schema": [],
                      "complexType": "allOf",
                      "complexItems": [
                        {
                          "name": "SearchConditionTerm",
                          "description": "",
                          "modelRef": "#/components/schemas/SearchConditionTerm",
                          "schema": [
                            {
                              "name": "cond",
                              "kind": "optional",
                              "type": "object",
                              "description": "<p>A condition on one property: the property, the comparator and the value to compare against.</p>",
                              "modelRef": "#/components/schemas/SearchCondition",
                              "customType": "SearchCondition",
                              "schema": [
                                {
                                  "name": "property",
                                  "kind": "optional",
                                  "type": "string",
                                  "description": ""
                                },
                                {
                                  "name": "comparator",
                                  "kind": "optional",
                                  "type": "string",
                                  "description": "<p>How a search condition compares values: greater than, greater or equal, less than, less or equal, or equal.</p>",
                                  "modelRef": "#/components/schemas/SearchComparator",
                                  "customType": "SearchComparator",
                                  "schema": [
                                    {
                                      "name": "",
                                      "description": "",
                                      "customType": "Max depth limit reached"
                                    }
                                  ]
                                },
                                {
                                  "name": "value",
                                  "kind": "optional",
                                  "type": "object",
                                  "description": "",
                                  "complexType": "oneOf",
                                  "complexItems": [],
                                  "schema": []
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name": "SearchAndTerm",
                          "description": "",
                          "modelRef": "#/components/schemas/SearchAndTerm",
                          "schema": [
                            {
                              "name": "and",
                              "kind": "optional",
                              "type": "object",
                              "description": "<p>A node in a search expression: a condition, or a combination of nested terms.</p>",
                              "modelRef": "#/components/schemas/SearchTerm",
                              "customType": "SearchTerm[]",
                              "schema": [],
                              "complexType": "allOf",
                              "complexItems": [
                                {
                                  "name": "SearchConditionTerm",
                                  "description": "",
                                  "modelRef": "#/components/schemas/SearchConditionTerm",
                                  "schema": [
                                    {
                                      "name": "",
                                      "description": "",
                                      "customType": "Max depth limit reached"
                                    }
                                  ]
                                },
                                {
                                  "name": "SearchAndTerm",
                                  "description": "",
                                  "modelRef": "#/components/schemas/SearchAndTerm",
                                  "schema": [
                                    {
                                      "name": "",
                                      "description": "",
                                      "customType": "Max depth limit reached"
                                    }
                                  ]
                                },
                                {
                                  "name": "SearchOrTerm",
                                  "description": "",
                                  "modelRef": "#/components/schemas/SearchOrTerm",
                                  "schema": [
                                    {
                                      "name": "",
                                      "description": "",
                                      "customType": "Max depth limit reached"
                                    }
                                  ]
                                },
                                {
                                  "name": "SearchNotTerm",
                                  "description": "",
                                  "modelRef": "#/components/schemas/SearchNotTerm",
                                  "schema": [
                                    {
                                      "name": "",
                                      "description": "",
                                      "customType": "Max depth limit reached"
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "name": "SearchOrTerm",
                          "description": "",
                          "modelRef": "#/components/schemas/SearchOrTerm",
                          "schema": [
                            {
                              "name": "",
                              "description": "",
                              "customType": "Max depth limit reached"
                            }
                          ]
                        },
                        {
                          "name": "SearchNotTerm",
                          "description": "",
                          "modelRef": "#/components/schemas/SearchNotTerm",
                          "schema": [
                            {
                              "name": "",
                              "description": "",
                              "customType": "Max depth limit reached"
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "name": "distance",
                      "kind": "optional",
                      "type": "object",
                      "description": "<p>A distance, with the unit it is expressed in.</p>",
                      "modelRef": "#/components/schemas/DistanceFilter",
                      "customType": "DistanceFilter",
                      "schema": [
                        {
                          "name": "value",
                          "kind": "required",
                          "type": "number<double>",
                          "description": "",
                          "format": "double"
                        },
                        {
                          "name": "unit",
                          "kind": "optional",
                          "type": "string",
                          "description": "An enumeration of the supported distance measurements.",
                          "modelRef": "#/components/schemas/DistanceUnits",
                          "customType": "DistanceUnits",
                          "schema": []
                        }
                      ]
                    }
                  ]
                },
                {
                  "name": "object",
                  "description": "",
                  "schema": [
                    {
                      "name": "country",
                      "kind": "required",
                      "type": "string",
                      "description": ""
                    },
                    {
                      "name": "postalCode",
                      "kind": "required",
                      "type": "string",
                      "description": ""
                    }
                  ]
                }
              ]
            },
            {
              "name": "orders",
              "kind": "optional",
              "type": "array",
              "description": "<p>An ordering to apply to results: the property to sort on and whether it is ascending.</p>",
              "modelRef": "#/components/schemas/SearchOrder",
              "customType": "SearchOrder[]",
              "schema": [
                {
                  "name": "property",
                  "kind": "required",
                  "type": "string",
                  "description": ""
                },
                {
                  "name": "asc",
                  "kind": "required",
                  "type": "boolean",
                  "description": "",
                  "default": true
                }
              ]
            },
            {
              "name": "page",
              "kind": "required",
              "type": "integer<int32>",
              "description": "",
              "example": 2,
              "format": "int32"
            },
            {
              "name": "pageSize",
              "kind": "required",
              "type": "integer<int32>",
              "description": "",
              "example": 4,
              "format": "int32"
            },
            {
              "name": "returnEmptyFacets",
              "kind": "optional",
              "type": "boolean",
              "description": "",
              "default": false
            }
          ],
          "modelRef": "#/components/schemas/SearchByPostalCodeQuery",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "NoChannelPortalAccess",
          "name": "NoChannelPortalAccess",
          "kind": "optional",
          "type": "http",
          "description": "<p>This authentication is required for clients to interact with any of the management APIs. Similar to 'LoggedIn', it indicates that the user has actually logged into the system, but in this case with a management role.</p>",
          "scheme": "bearer"
        },
        {
          "id": "AnonymousAuth",
          "name": "AnonymousAuth",
          "kind": "optional",
          "type": "http",
          "description": "This is the most basic authentication. The minimum requirement for access is a token representing the user as an anonymous client.",
          "scheme": "bearer"
        },
        {
          "id": "LoggedIn",
          "name": "LoggedIn",
          "kind": "optional",
          "type": "http",
          "description": "The presence of this token indicates that the user is a known consumer that has previously logged into the platform.",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "<p>Success-set of locations returned.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>The results of an address-based location search, with facet counts.</p>",
            "customType": "LocationAddressSearchResponse",
            "schema": [
              {
                "name": "items",
                "kind": "required",
                "type": "array",
                "description": "A location together with how far it is from the point that was searched from.",
                "modelRef": "#/components/schemas/LocationWithDistance",
                "customType": "LocationWithDistance[]",
                "schema": [
                  {
                    "name": "address",
                    "kind": "required",
                    "type": "object",
                    "description": "<p>A postal address, broken into street, city, county, state or region, postal code and country.</p>",
                    "modelRef": "#/components/schemas/Address",
                    "customType": "Address",
                    "schema": [
                      {
                        "name": "city",
                        "kind": "required",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "country",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The country associated with the location, applying the <a href=\"https://en.wikipedia.org/wiki/Two-letter_country_codes\" target=\"_blank\">2-character country code</a>.</p>",
                        "pattern": "^[A-Z]{2}$"
                      },
                      {
                        "name": "county",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "postalCode",
                        "kind": "required",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "stateOrRegion",
                        "kind": "required",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "street1",
                        "kind": "required",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "street2",
                        "kind": "optional",
                        "type": "string",
                        "description": ""
                      }
                    ]
                  },
                  {
                    "name": "avgRating",
                    "kind": "optional",
                    "type": "number<double>",
                    "description": "An optional rating provided by an external ratings and reviews framework.",
                    "format": "double"
                  },
                  {
                    "name": "siteIds",
                    "kind": "optional",
                    "type": "array",
                    "description": "A set of identifiers for the sites that this location is available on.",
                    "modelRef": "#/components/schemas/SiteId",
                    "customType": "SiteId[]",
                    "schema": []
                  },
                  {
                    "name": "contactInformation",
                    "kind": "required",
                    "type": "map",
                    "description": "<p>This allows for a set of key-value pairs to provide contact information (e.g. phoneNumber: 8885551212)</p>",
                    "example": "",
                    "customType": "map<string, string>",
                    "schema": []
                  },
                  {
                    "name": "content",
                    "kind": "optional",
                    "type": "array",
                    "description": "A place to hold a set of content associated with the location.",
                    "modelRef": "#/components/schemas/Content",
                    "customType": "Content[]",
                    "schema": [
                      {
                        "name": "content",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The raw content-body to be displayed (HTML is acceptable).</p>"
                      },
                      {
                        "name": "endDateTime",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "description": "<p>This allows for filtering a content item out based on an expiration date/time.</p>",
                        "format": "date-time"
                      },
                      {
                        "name": "identifier",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>The key that should be used to reference this content item (e.g. HomePageBannerText)</p>"
                      },
                      {
                        "name": "startDateTime",
                        "kind": "optional",
                        "type": "string<date-time>",
                        "description": "This allows for filtering the content item out based on active date.",
                        "format": "date-time"
                      }
                    ]
                  },
                  {
                    "name": "coordinates",
                    "kind": "required",
                    "type": "object",
                    "description": "<p>Latitude/longitude-based coordinates.</p>",
                    "modelRef": "#/components/schemas/Coordinates",
                    "customType": "Coordinates",
                    "schema": [
                      {
                        "name": "latitude",
                        "kind": "required",
                        "type": "number<double>",
                        "description": "",
                        "format": "double",
                        "minimum": -90,
                        "maximum": 90
                      },
                      {
                        "name": "longitude",
                        "kind": "required",
                        "type": "number<double>",
                        "description": "",
                        "format": "double",
                        "minimum": -180,
                        "maximum": 180
                      }
                    ]
                  },
                  {
                    "name": "dateOriginallyOpened",
                    "kind": "optional",
                    "type": "string<date>",
                    "description": "Date on which the location first opened.",
                    "format": "date"
                  },
                  {
                    "name": "deliveryAvailable",
                    "kind": "required",
                    "type": "boolean",
                    "description": "This flag allows for the location to be identified as having a delivery option.",
                    "default": false
                  },
                  {
                    "name": "directionsSummary",
                    "kind": "optional",
                    "type": "string",
                    "description": "<p>This should be mark up text with a summary of how to reach the location (e.g. driving directions).</p>"
                  },
                  {
                    "name": "distance",
                    "kind": "optional",
                    "type": "object",
                    "description": "This defines a generic distance.",
                    "modelRef": "#/components/schemas/Distance",
                    "customType": "Distance",
                    "schema": [
                      {
                        "name": "value",
                        "kind": "optional",
                        "type": "number<double>",
                        "description": "The numeric portion of the distance.",
                        "example": 157.75,
                        "format": "double"
                      },
                      {
                        "name": "unit",
                        "kind": "optional",
                        "type": "string",
                        "description": "An enumeration of the supported distance measurements.",
                        "modelRef": "#/components/schemas/DistanceUnits",
                        "customType": "DistanceUnits",
                        "schema": []
                      }
                    ]
                  },
                  {
                    "name": "dynamicProperties",
                    "kind": "optional",
                    "type": "object",
                    "description": "<p>This allows for a set of predefined custom fields to be created unique to a given client/tenant.</p>",
                    "example": "",
                    "schema": []
                  },
                  {
                    "name": "externalApplicationReferences",
                    "kind": "optional",
                    "type": "map",
                    "description": "<p>This map allows for the location to have a defined set of references to an external application (e.g. a unique URL to an appointment-scheduling app or to a specific Facebook page).</p>",
                    "example": "",
                    "customType": "map<string, string>",
                    "schema": []
                  },
                  {
                    "name": "hoursOfOperation",
                    "kind": "optional",
                    "type": "array",
                    "description": "An array with one entry for each day of the week.",
                    "modelRef": "#/components/schemas/NormalHoursOfOperation",
                    "customType": "NormalHoursOfOperation[]",
                    "schema": [
                      {
                        "name": "closed",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>The local time at which the location closes in 24-hour notation.</p>",
                        "example": 1200,
                        "pattern": "[0-2][0-9]:[0-5][0-9]"
                      },
                      {
                        "name": "day",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>A reference to the day/s of the week that these hours apply to.</p>",
                        "modelRef": "#/components/schemas/DayOfWeek",
                        "customType": "DayOfWeek",
                        "schema": []
                      },
                      {
                        "name": "isOpen",
                        "kind": "required",
                        "type": "boolean",
                        "description": "<p>This flag indicates whether the location is open; to be set for each day of the week. If true, set open and closed hours.</p>",
                        "example": false
                      },
                      {
                        "name": "open",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>The local time at which the location opens in 24-hour notation.</p>",
                        "example": "08:00",
                        "pattern": "[0-2][0-9]:[0-5][0-9]"
                      }
                    ]
                  },
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "string",
                    "description": "Identifier of a location.",
                    "modelRef": "#/components/schemas/LocationId",
                    "customType": "LocationId",
                    "schema": []
                  },
                  {
                    "name": "locationType",
                    "kind": "required",
                    "type": "string",
                    "description": "<p>A string indicating the type of location this is (e.g. kiosk, store, warehouse etc.).</p>"
                  },
                  {
                    "name": "media",
                    "kind": "optional",
                    "type": "map",
                    "description": "",
                    "example": "",
                    "customType": "map<string, MediaValue>",
                    "schema": []
                  },
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "<p>A user-friendly name for this location.</p>"
                  },
                  {
                    "name": "numReviews",
                    "kind": "optional",
                    "type": "integer<int32>",
                    "description": "<p>In the case that this location has reviews associated with it, this is the total number of reviews.</p>",
                    "format": "int32",
                    "minimum": 0
                  },
                  {
                    "name": "operational",
                    "kind": "required",
                    "type": "boolean",
                    "description": "<p>This flag indicates whether the location is currently operational (i.e. active, not related to opening hours).</p>"
                  },
                  {
                    "name": "operationHoursExceptions",
                    "kind": "optional",
                    "type": "array",
                    "description": "<p>A set of exceptions to the normal business hours (e.g. holidays).</p>",
                    "modelRef": "#/components/schemas/OperationHoursException",
                    "customType": "OperationHoursException[]",
                    "schema": [
                      {
                        "name": "closed",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>The local time at which the location closes in 24-hour notation.</p>",
                        "example": 1200,
                        "pattern": "[0-2][0-9]:[0-5][0-9]"
                      },
                      {
                        "name": "exceptionType",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>Categorization of the reason for the exception to normal hours (e.g. holiday, private event).</p>"
                      },
                      {
                        "name": "isOpen",
                        "kind": "required",
                        "type": "boolean",
                        "description": "This flag indicates whether the location is open."
                      },
                      {
                        "name": "name",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>A user-friendly name for this exception.</p>",
                        "example": "Memorial Day"
                      },
                      {
                        "name": "open",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>The local time at which the location opens in 24-hour notation.</p>",
                        "example": "08:00",
                        "pattern": "[0-2][0-9]:[0-5][0-9]"
                      }
                    ]
                  },
                  {
                    "name": "pickupAvailable",
                    "kind": "required",
                    "type": "boolean",
                    "description": "This flag indicates whether a consumer can use this location to pick up their order.",
                    "default": false
                  },
                  {
                    "name": "pricingZone",
                    "kind": "optional",
                    "type": "string",
                    "description": "This identifies which pricing zone should be used for calculating prices when the consumer is shopping this location.",
                    "default": "NTL"
                  },
                  {
                    "name": "public",
                    "kind": "required",
                    "type": "boolean",
                    "description": "<p>This flag indicates whether the location is available to the consumer (e.g. a store as opposed to a warehouse)</p>"
                  },
                  {
                    "name": "remodelDates",
                    "kind": "optional",
                    "type": "array",
                    "description": "",
                    "example": "[\"2019-05-29\"]",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "2019-05-29",
                    "itemDefault": ""
                  }
                ]
              },
              {
                "name": "page",
                "kind": "required",
                "type": "integer<int32>",
                "description": "The current page number",
                "format": "int32"
              },
              {
                "name": "pageSize",
                "kind": "required",
                "type": "integer<int32>",
                "description": "The number of items per page",
                "format": "int32"
              },
              {
                "name": "count",
                "kind": "required",
                "type": "integer<int32>",
                "description": "The total count of items",
                "format": "int32"
              },
              {
                "name": "queryId",
                "kind": "required",
                "type": "string",
                "description": "The query identifier"
              },
              {
                "name": "facetCounts",
                "kind": "optional",
                "type": "object",
                "description": "<p>The facet counts for a search, by property and by range.</p>",
                "modelRef": "#/components/schemas/FacetCounts",
                "customType": "FacetCounts",
                "schema": [
                  {
                    "name": "properties",
                    "kind": "required",
                    "type": "array",
                    "description": "Counts of how many results carry each value of one property.",
                    "modelRef": "#/components/schemas/PropertyFacet",
                    "customType": "PropertyFacet[]",
                    "schema": [
                      {
                        "name": "property",
                        "kind": "required",
                        "type": "string",
                        "description": "The name of the property being faceted"
                      },
                      {
                        "name": "propertyType",
                        "kind": "required",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "counts",
                        "kind": "required",
                        "type": "array",
                        "description": "How many results carry one particular property value.",
                        "modelRef": "#/components/schemas/PropertyFacetCount",
                        "customType": "PropertyFacetCount[]",
                        "schema": [
                          {
                            "name": "value",
                            "kind": "required",
                            "type": "string",
                            "description": "The value of the property"
                          },
                          {
                            "name": "count",
                            "kind": "required",
                            "type": "integer<int32>",
                            "description": "The count for the value",
                            "format": "int32"
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "ranges",
                    "kind": "required",
                    "type": "array",
                    "description": "<p>Counts of how many results fall into each range of one property, with the range bounds and step.</p>",
                    "modelRef": "#/components/schemas/RangeFacet",
                    "customType": "RangeFacet[]",
                    "schema": [
                      {
                        "name": "property",
                        "kind": "required",
                        "type": "string",
                        "description": "The name of property being faceted"
                      },
                      {
                        "name": "propertyType",
                        "kind": "required",
                        "type": "string",
                        "description": ""
                      },
                      {
                        "name": "counts",
                        "kind": "required",
                        "type": "array",
                        "description": "How many results fall into one particular range.",
                        "modelRef": "#/components/schemas/RangeFacetCount",
                        "customType": "RangeFacetCount[]",
                        "schema": [
                          {
                            "name": "value",
                            "kind": "required",
                            "type": "string",
                            "description": "The value of the range"
                          },
                          {
                            "name": "count",
                            "kind": "required",
                            "type": "integer<int32>",
                            "description": "The count for the range",
                            "format": "int32"
                          }
                        ]
                      },
                      {
                        "name": "start",
                        "kind": "required",
                        "type": "string",
                        "description": "The start of the range"
                      },
                      {
                        "name": "end",
                        "kind": "required",
                        "type": "string",
                        "description": "The end of the range"
                      },
                      {
                        "name": "gap",
                        "kind": "required",
                        "type": "string",
                        "description": "The gap between range segments"
                      }
                    ]
                  }
                ]
              },
              {
                "name": "redirects",
                "kind": "required",
                "type": "array",
                "description": "List of redirects",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              }
            ],
            "modelRef": "#/components/schemas/LocationAddressSearchResponse",
            "complexItems": [
              {
                "name": "object",
                "schema": [
                  {
                    "name": "items",
                    "kind": "required",
                    "type": "array",
                    "description": "A location together with how far it is from the point that was searched from.",
                    "modelRef": "#/components/schemas/LocationWithDistance",
                    "customType": "LocationWithDistance[]",
                    "schema": [
                      {
                        "name": "address",
                        "kind": "required",
                        "type": "object",
                        "description": "<p>A postal address, broken into street, city, county, state or region, postal code and country.</p>",
                        "modelRef": "#/components/schemas/Address",
                        "customType": "Address",
                        "schema": [
                          {
                            "name": "city",
                            "kind": "required",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "country",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The country associated with the location, applying the <a href=\"https://en.wikipedia.org/wiki/Two-letter_country_codes\" target=\"_blank\">2-character country code</a>.</p>",
                            "pattern": "^[A-Z]{2}$"
                          },
                          {
                            "name": "county",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "postalCode",
                            "kind": "required",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "stateOrRegion",
                            "kind": "required",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "street1",
                            "kind": "required",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "street2",
                            "kind": "optional",
                            "type": "string",
                            "description": ""
                          }
                        ]
                      },
                      {
                        "name": "avgRating",
                        "kind": "optional",
                        "type": "number<double>",
                        "description": "An optional rating provided by an external ratings and reviews framework.",
                        "format": "double"
                      },
                      {
                        "name": "siteIds",
                        "kind": "optional",
                        "type": "array",
                        "description": "A set of identifiers for the sites that this location is available on.",
                        "modelRef": "#/components/schemas/SiteId",
                        "customType": "SiteId[]",
                        "schema": []
                      },
                      {
                        "name": "contactInformation",
                        "kind": "required",
                        "type": "map",
                        "description": "<p>This allows for a set of key-value pairs to provide contact information (e.g. phoneNumber: 8885551212)</p>",
                        "example": "",
                        "customType": "map<string, string>",
                        "schema": []
                      },
                      {
                        "name": "content",
                        "kind": "optional",
                        "type": "array",
                        "description": "A place to hold a set of content associated with the location.",
                        "modelRef": "#/components/schemas/Content",
                        "customType": "Content[]",
                        "schema": [
                          {
                            "name": "content",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The raw content-body to be displayed (HTML is acceptable).</p>"
                          },
                          {
                            "name": "endDateTime",
                            "kind": "optional",
                            "type": "string<date-time>",
                            "description": "<p>This allows for filtering a content item out based on an expiration date/time.</p>",
                            "format": "date-time"
                          },
                          {
                            "name": "identifier",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>The key that should be used to reference this content item (e.g. HomePageBannerText)</p>"
                          },
                          {
                            "name": "startDateTime",
                            "kind": "optional",
                            "type": "string<date-time>",
                            "description": "This allows for filtering the content item out based on active date.",
                            "format": "date-time"
                          }
                        ]
                      },
                      {
                        "name": "coordinates",
                        "kind": "required",
                        "type": "object",
                        "description": "<p>Latitude/longitude-based coordinates.</p>",
                        "modelRef": "#/components/schemas/Coordinates",
                        "customType": "Coordinates",
                        "schema": [
                          {
                            "name": "latitude",
                            "kind": "required",
                            "type": "number<double>",
                            "description": "",
                            "format": "double",
                            "minimum": -90,
                            "maximum": 90
                          },
                          {
                            "name": "longitude",
                            "kind": "required",
                            "type": "number<double>",
                            "description": "",
                            "format": "double",
                            "minimum": -180,
                            "maximum": 180
                          }
                        ]
                      },
                      {
                        "name": "dateOriginallyOpened",
                        "kind": "optional",
                        "type": "string<date>",
                        "description": "Date on which the location first opened.",
                        "format": "date"
                      },
                      {
                        "name": "deliveryAvailable",
                        "kind": "required",
                        "type": "boolean",
                        "description": "This flag allows for the location to be identified as having a delivery option.",
                        "default": false
                      },
                      {
                        "name": "directionsSummary",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>This should be mark up text with a summary of how to reach the location (e.g. driving directions).</p>"
                      },
                      {
                        "name": "distance",
                        "kind": "optional",
                        "type": "object",
                        "description": "This defines a generic distance.",
                        "modelRef": "#/components/schemas/Distance",
                        "customType": "Distance",
                        "schema": [
                          {
                            "name": "value",
                            "kind": "optional",
                            "type": "number<double>",
                            "description": "The numeric portion of the distance.",
                            "example": 157.75,
                            "format": "double"
                          },
                          {
                            "name": "unit",
                            "kind": "optional",
                            "type": "string",
                            "description": "An enumeration of the supported distance measurements.",
                            "modelRef": "#/components/schemas/DistanceUnits",
                            "customType": "DistanceUnits",
                            "schema": []
                          }
                        ]
                      },
                      {
                        "name": "dynamicProperties",
                        "kind": "optional",
                        "type": "object",
                        "description": "<p>This allows for a set of predefined custom fields to be created unique to a given client/tenant.</p>",
                        "example": "",
                        "schema": []
                      },
                      {
                        "name": "externalApplicationReferences",
                        "kind": "optional",
                        "type": "map",
                        "description": "<p>This map allows for the location to have a defined set of references to an external application (e.g. a unique URL to an appointment-scheduling app or to a specific Facebook page).</p>",
                        "example": "",
                        "customType": "map<string, string>",
                        "schema": []
                      },
                      {
                        "name": "hoursOfOperation",
                        "kind": "optional",
                        "type": "array",
                        "description": "An array with one entry for each day of the week.",
                        "modelRef": "#/components/schemas/NormalHoursOfOperation",
                        "customType": "NormalHoursOfOperation[]",
                        "schema": [
                          {
                            "name": "closed",
                            "kind": "optional",
                            "type": "string",
                            "description": "<p>The local time at which the location closes in 24-hour notation.</p>",
                            "example": 1200,
                            "pattern": "[0-2][0-9]:[0-5][0-9]"
                          },
                          {
                            "name": "day",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>A reference to the day/s of the week that these hours apply to.</p>",
                            "modelRef": "#/components/schemas/DayOfWeek",
                            "customType": "DayOfWeek",
                            "schema": []
                          },
                          {
                            "name": "isOpen",
                            "kind": "required",
                            "type": "boolean",
                            "description": "<p>This flag indicates whether the location is open; to be set for each day of the week. If true, set open and closed hours.</p>",
                            "example": false
                          },
                          {
                            "name": "open",
                            "kind": "optional",
                            "type": "string",
                            "description": "<p>The local time at which the location opens in 24-hour notation.</p>",
                            "example": "08:00",
                            "pattern": "[0-2][0-9]:[0-5][0-9]"
                          }
                        ]
                      },
                      {
                        "name": "id",
                        "kind": "required",
                        "type": "string",
                        "description": "Identifier of a location.",
                        "modelRef": "#/components/schemas/LocationId",
                        "customType": "LocationId",
                        "schema": []
                      },
                      {
                        "name": "locationType",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>A string indicating the type of location this is (e.g. kiosk, store, warehouse etc.).</p>"
                      },
                      {
                        "name": "media",
                        "kind": "optional",
                        "type": "map",
                        "description": "",
                        "example": "",
                        "customType": "map<string, MediaValue>",
                        "schema": []
                      },
                      {
                        "name": "name",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>A user-friendly name for this location.</p>"
                      },
                      {
                        "name": "numReviews",
                        "kind": "optional",
                        "type": "integer<int32>",
                        "description": "<p>In the case that this location has reviews associated with it, this is the total number of reviews.</p>",
                        "format": "int32",
                        "minimum": 0
                      },
                      {
                        "name": "operational",
                        "kind": "required",
                        "type": "boolean",
                        "description": "<p>This flag indicates whether the location is currently operational (i.e. active, not related to opening hours).</p>"
                      },
                      {
                        "name": "operationHoursExceptions",
                        "kind": "optional",
                        "type": "array",
                        "description": "<p>A set of exceptions to the normal business hours (e.g. holidays).</p>",
                        "modelRef": "#/components/schemas/OperationHoursException",
                        "customType": "OperationHoursException[]",
                        "schema": [
                          {
                            "name": "closed",
                            "kind": "optional",
                            "type": "string",
                            "description": "<p>The local time at which the location closes in 24-hour notation.</p>",
                            "example": 1200,
                            "pattern": "[0-2][0-9]:[0-5][0-9]"
                          },
                          {
                            "name": "exceptionType",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>Categorization of the reason for the exception to normal hours (e.g. holiday, private event).</p>"
                          },
                          {
                            "name": "isOpen",
                            "kind": "required",
                            "type": "boolean",
                            "description": "This flag indicates whether the location is open."
                          },
                          {
                            "name": "name",
                            "kind": "required",
                            "type": "string",
                            "description": "<p>A user-friendly name for this exception.</p>",
                            "example": "Memorial Day"
                          },
                          {
                            "name": "open",
                            "kind": "optional",
                            "type": "string",
                            "description": "<p>The local time at which the location opens in 24-hour notation.</p>",
                            "example": "08:00",
                            "pattern": "[0-2][0-9]:[0-5][0-9]"
                          }
                        ]
                      },
                      {
                        "name": "pickupAvailable",
                        "kind": "required",
                        "type": "boolean",
                        "description": "This flag indicates whether a consumer can use this location to pick up their order.",
                        "default": false
                      },
                      {
                        "name": "pricingZone",
                        "kind": "optional",
                        "type": "string",
                        "description": "This identifies which pricing zone should be used for calculating prices when the consumer is shopping this location.",
                        "default": "NTL"
                      },
                      {
                        "name": "public",
                        "kind": "required",
                        "type": "boolean",
                        "description": "<p>This flag indicates whether the location is available to the consumer (e.g. a store as opposed to a warehouse)</p>"
                      },
                      {
                        "name": "remodelDates",
                        "kind": "optional",
                        "type": "array",
                        "description": "",
                        "example": "",
                        "itemType": "string",
                        "customType": "string[]",
                        "itemExample": "2019-05-29",
                        "itemDefault": ""
                      }
                    ]
                  }
                ],
                "modelRef": "#/components/schemas/LocationAddressSearchResponseItems",
                "customType": "LocationAddressSearchResponseItems"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "page",
                    "kind": "required",
                    "type": "integer<int32>",
                    "description": "The current page number",
                    "format": "int32"
                  },
                  {
                    "name": "pageSize",
                    "kind": "required",
                    "type": "integer<int32>",
                    "description": "The number of items per page",
                    "format": "int32"
                  },
                  {
                    "name": "count",
                    "kind": "required",
                    "type": "integer<int32>",
                    "description": "The total count of items",
                    "format": "int32"
                  },
                  {
                    "name": "queryId",
                    "kind": "required",
                    "type": "string",
                    "description": "The query identifier"
                  },
                  {
                    "name": "facetCounts",
                    "kind": "optional",
                    "type": "object",
                    "description": "<p>The facet counts for a search, by property and by range.</p>",
                    "modelRef": "#/components/schemas/FacetCounts",
                    "customType": "FacetCounts",
                    "schema": [
                      {
                        "name": "properties",
                        "kind": "required",
                        "type": "array",
                        "description": "Counts of how many results carry each value of one property.",
                        "modelRef": "#/components/schemas/PropertyFacet",
                        "customType": "PropertyFacet[]",
                        "schema": [
                          {
                            "name": "property",
                            "kind": "required",
                            "type": "string",
                            "description": "The name of the property being faceted"
                          },
                          {
                            "name": "propertyType",
                            "kind": "required",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "counts",
                            "kind": "required",
                            "type": "array",
                            "description": "How many results carry one particular property value.",
                            "modelRef": "#/components/schemas/PropertyFacetCount",
                            "customType": "PropertyFacetCount[]",
                            "schema": [
                              {
                                "name": "value",
                                "kind": "required",
                                "type": "string",
                                "description": "The value of the property"
                              },
                              {
                                "name": "count",
                                "kind": "required",
                                "type": "integer<int32>",
                                "description": "The count for the value",
                                "format": "int32"
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "ranges",
                        "kind": "required",
                        "type": "array",
                        "description": "<p>Counts of how many results fall into each range of one property, with the range bounds and step.</p>",
                        "modelRef": "#/components/schemas/RangeFacet",
                        "customType": "RangeFacet[]",
                        "schema": [
                          {
                            "name": "property",
                            "kind": "required",
                            "type": "string",
                            "description": "The name of property being faceted"
                          },
                          {
                            "name": "propertyType",
                            "kind": "required",
                            "type": "string",
                            "description": ""
                          },
                          {
                            "name": "counts",
                            "kind": "required",
                            "type": "array",
                            "description": "How many results fall into one particular range.",
                            "modelRef": "#/components/schemas/RangeFacetCount",
                            "customType": "RangeFacetCount[]",
                            "schema": [
                              {
                                "name": "value",
                                "kind": "required",
                                "type": "string",
                                "description": "The value of the range"
                              },
                              {
                                "name": "count",
                                "kind": "required",
                                "type": "integer<int32>",
                                "description": "The count for the range",
                                "format": "int32"
                              }
                            ]
                          },
                          {
                            "name": "start",
                            "kind": "required",
                            "type": "string",
                            "description": "The start of the range"
                          },
                          {
                            "name": "end",
                            "kind": "required",
                            "type": "string",
                            "description": "The end of the range"
                          },
                          {
                            "name": "gap",
                            "kind": "required",
                            "type": "string",
                            "description": "The gap between range segments"
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "redirects",
                    "kind": "required",
                    "type": "array",
                    "description": "List of redirects",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  }
                ]
              }
            ],
            "complexType": "allOf",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "The request contained information that the server was unable to process. Appropriate errors are provided in the response body.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>Error payload returned when a request fails validation, identifying the offending input by name, code and detail.</p>",
            "customType": "ValidationErrorResponse",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/ValidationErrorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "The provided credentials were not valid for this endpoint. It may be that they are expired or that the user's roles are insufficient.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>Standard error payload identifying a failure by name, code and detail, with an optional machine-readable reason.</p>",
            "customType": "ErrorResponse",
            "schema": [
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "code",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "detail",
                "kind": "required",
                "type": "string",
                "description": ""
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string",
                "description": ""
              }
            ],
            "modelRef": "#/components/schemas/ErrorResponse",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "deprecated": true,
    "examples": {
      "languages": [
        {
          "id": "IYHm3aLVofPBwqeCCPOPY",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.upstartcommerce.com/v1/location/search/postalcode2 \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'x-upstart-tenant: string' \\\n     --data '{\n     \"filter\": {\n     \"term\": {\n     \"and\": {}\n     },\n     \"distance\": {\n     \"value\": \"\"\n     },\n     \"country\": \"\",\n     \"postalCode\": \"\"\n     },\n     \"orders\": [\n     {\n     \"property\": \"\",\n     \"asc\": true\n     }\n     ],\n     \"page\": 2,\n     \"pageSize\": 4\n     }'"
        },
        {
          "id": "dCduuJvOOfGdctqqv669P",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-upstart-tenant\", \"string\");\n\nvar raw = JSON.stringify({\n   \"filter\": {\n      \"term\": {\n         \"and\": {}\n      },\n      \"distance\": {\n         \"value\": \"\"\n      },\n      \"country\": \"\",\n      \"postalCode\": \"\"\n   },\n   \"orders\": [\n      {\n         \"property\": \"\",\n         \"asc\": true\n      }\n   ],\n   \"page\": 2,\n   \"pageSize\": 4\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.upstartcommerce.com/v1/location/search/postalcode2\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "A_phm_53C3NkawVRNQkIJ",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.upstartcommerce.com/v1/location/search/postalcode2\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-upstart-tenant\"] = \"string\"\nrequest.body = JSON.dump({\n   \"filter\": {\n      \"term\": {\n         \"and\": {}\n      },\n      \"distance\": {\n         \"value\": \"\"\n      },\n      \"country\": \"\",\n      \"postalCode\": \"\"\n   },\n   \"orders\": [\n      {\n         \"property\": \"\",\n         \"asc\": true\n      }\n   ],\n   \"page\": 2,\n   \"pageSize\": 4\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "E6nZgWsk0pBhKRJxWw8cL",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.upstartcommerce.com/v1/location/search/postalcode2\"\n\npayload = json.dumps({\n   \"filter\": {\n      \"term\": {\n         \"and\": {}\n      },\n      \"distance\": {\n         \"value\": \"\"\n      },\n      \"country\": \"\",\n      \"postalCode\": \"\"\n   },\n   \"orders\": [\n      {\n         \"property\": \"\",\n         \"asc\": True\n      }\n   ],\n   \"page\": 2,\n   \"pageSize\": 4\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-upstart-tenant': 'string'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "IYHm3aLVofPBwqeCCPOPY"
    },
    "results": {
      "languages": [
        {
          "id": "4enIfiBYeckA50KpmHiU2",
          "language": "200",
          "code": "// Success-set of locations returned.\n{\n  \"items\": [\n    {\n      \"address\": {\n        \"city\": \"\",\n        \"country\": \"\",\n        \"county\": \"\",\n        \"postalCode\": \"\",\n        \"stateOrRegion\": \"\",\n        \"street1\": \"\",\n        \"street2\": \"\"\n      },\n      \"avgRating\": \"\",\n      \"siteIds\": [\n        \"\"\n      ],\n      \"contactInformation\": \"\",\n      \"content\": [\n        {\n          \"content\": \"\",\n          \"endDateTime\": \"\",\n          \"identifier\": \"\",\n          \"startDateTime\": \"\"\n        }\n      ],\n      \"coordinates\": {\n        \"latitude\": \"\",\n        \"longitude\": \"\"\n      },\n      \"dateOriginallyOpened\": \"\",\n      \"deliveryAvailable\": false,\n      \"directionsSummary\": \"\",\n      \"distance\": {\n        \"value\": 157.75,\n        \"unit\": \"\"\n      },\n      \"dynamicProperties\": {},\n      \"externalApplicationReferences\": \"\",\n      \"hoursOfOperation\": [\n        {\n          \"closed\": 1200,\n          \"day\": \"\",\n          \"isOpen\": false,\n          \"open\": \"08:00\"\n        }\n      ],\n      \"id\": \"\",\n      \"locationType\": \"\",\n      \"media\": \"\",\n      \"name\": \"\",\n      \"numReviews\": \"\",\n      \"operational\": false,\n      \"operationHoursExceptions\": [\n        {\n          \"closed\": 1200,\n          \"exceptionType\": \"\",\n          \"isOpen\": false,\n          \"name\": \"Memorial Day\",\n          \"open\": \"08:00\"\n        }\n      ],\n      \"pickupAvailable\": false,\n      \"pricingZone\": \"\",\n      \"public\": false,\n      \"remodelDates\": [\n        \"2019-05-29\"\n      ]\n    }\n  ],\n  \"page\": \"\",\n  \"pageSize\": \"\",\n  \"count\": \"\",\n  \"queryId\": \"\",\n  \"facetCounts\": {\n    \"properties\": [\n      {\n        \"property\": \"\",\n        \"propertyType\": \"\",\n        \"counts\": [\n          {\n            \"value\": \"\",\n            \"count\": \"\"\n          }\n        ]\n      }\n    ],\n    \"ranges\": [\n      {\n        \"property\": \"\",\n        \"propertyType\": \"\",\n        \"counts\": [\n          {\n            \"value\": \"\",\n            \"count\": \"\"\n          }\n        ],\n        \"start\": \"\",\n        \"end\": \"\",\n        \"gap\": \"\"\n      }\n    ]\n  },\n  \"redirects\": [\n    \"\"\n  ]\n}"
        },
        {
          "id": "62WFIMAddDubTOJA8f71t",
          "language": "400",
          "code": "// The request contained information that the server was unable to process. Appropriate errors are provided in the response body.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\"\n}"
        },
        {
          "id": "sHJV60MNIfY_VsJ6a8nkU",
          "language": "401",
          "code": "// The provided credentials were not valid for this endpoint. It may be that they are expired or that the user's roles are insufficient.\n{\n  \"name\": \"\",\n  \"code\": \"\",\n  \"detail\": \"\",\n  \"reason\": \"\"\n}"
        }
      ],
      "selectedLanguageId": "4enIfiBYeckA50KpmHiU2"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}