---
title: Get Distances and Duration for Closest Locations
slug: api-documentation/get-distances-and-duration-for-closest-locations
docTags: 
createdAt: 2026-08-27T16:56:29.420Z
---

{
  "id": "H2dGFDvRJDnrw-5wrxdCp",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://api.upstartcommerce.com/v1/location/closestLocationsWithDistancesAndDuration",
    "servers": [
      {
        "url": "https://api.upstartcommerce.com/v1/location/closestLocationsWithDistancesAndDuration"
      }
    ],
    "name": "Get Distances and Duration for Closest Locations",
    "description": "<p>This endpoint returns the closest locations with several distances and duration based on the coordinates and distance provided by parameter. These data are received by calling Google API.</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": "The origin coordinates and the locations to measure distance and travel time to.",
          "customType": "LocationByCoordinatesReq",
          "schema": [
            {
              "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": "distance",
              "kind": "required",
              "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": "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": "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": "Circular-Reference"
                            }
                          ]
                        },
                        {
                          "name": "SearchAndTerm",
                          "description": "",
                          "modelRef": "#/components/schemas/SearchAndTerm",
                          "schema": [
                            {
                              "name": "",
                              "description": "",
                              "customType": "Circular-Reference"
                            }
                          ]
                        },
                        {
                          "name": "SearchOrTerm",
                          "description": "",
                          "modelRef": "#/components/schemas/SearchOrTerm",
                          "schema": [
                            {
                              "name": "or",
                              "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": "Circular-Reference"
                                    }
                                  ]
                                },
                                {
                                  "name": "SearchAndTerm",
                                  "description": "",
                                  "modelRef": "#/components/schemas/SearchAndTerm",
                                  "schema": [
                                    {
                                      "name": "",
                                      "description": "",
                                      "customType": "Circular-Reference"
                                    }
                                  ]
                                },
                                {
                                  "name": "SearchOrTerm",
                                  "description": "",
                                  "modelRef": "#/components/schemas/SearchOrTerm",
                                  "schema": [
                                    {
                                      "name": "",
                                      "description": "",
                                      "customType": "Circular-Reference"
                                    }
                                  ]
                                },
                                {
                                  "name": "SearchNotTerm",
                                  "description": "",
                                  "modelRef": "#/components/schemas/SearchNotTerm",
                                  "schema": [
                                    {
                                      "name": "not",
                                      "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": "SearchNotTerm",
                          "description": "",
                          "modelRef": "#/components/schemas/SearchNotTerm",
                          "schema": [
                            {
                              "name": "not",
                              "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": "or",
                      "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": "Circular-Reference"
                            }
                          ]
                        },
                        {
                          "name": "SearchAndTerm",
                          "description": "",
                          "modelRef": "#/components/schemas/SearchAndTerm",
                          "schema": [
                            {
                              "name": "",
                              "description": "",
                              "customType": "Circular-Reference"
                            }
                          ]
                        },
                        {
                          "name": "SearchOrTerm",
                          "description": "",
                          "modelRef": "#/components/schemas/SearchOrTerm",
                          "schema": [
                            {
                              "name": "",
                              "description": "",
                              "customType": "Circular-Reference"
                            }
                          ]
                        },
                        {
                          "name": "SearchNotTerm",
                          "description": "",
                          "modelRef": "#/components/schemas/SearchNotTerm",
                          "schema": [
                            {
                              "name": "not",
                              "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": "SearchNotTerm",
                  "description": "",
                  "modelRef": "#/components/schemas/SearchNotTerm",
                  "schema": [
                    {
                      "name": "not",
                      "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"
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ],
          "modelRef": "#/components/schemas/LocationByCoordinatesReq",
          "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"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "<p>Object with filtered locations, including several distances and duration data from specified coordinates.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "<p>The distances from one set of coordinates to a set of locations, using Google routing data.</p>",
            "customType": "LocationDistances",
            "schema": [
              {
                "name": "coordinatesFrom",
                "kind": "optional",
                "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": "locationsWithGoogleData",
                "kind": "required",
                "type": "array",
                "description": "An array with locations and specific distances and duration received from google api.",
                "modelRef": "#/components/schemas/LocationDistance",
                "customType": "LocationDistance[]",
                "schema": [
                  {
                    "name": "location",
                    "kind": "required",
                    "type": "object",
                    "description": "<p>A physical location, with its addresses, contact details, opening hours and the sites it serves.</p>",
                    "modelRef": "#/components/schemas/Location",
                    "customType": "Location",
                    "schema": [
                      {
                        "name": "id",
                        "kind": "required",
                        "type": "string",
                        "description": "Identifier of a location.",
                        "modelRef": "#/components/schemas/LocationId",
                        "customType": "LocationId",
                        "schema": []
                      },
                      {
                        "name": "name",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>A user-friendly name for this location.</p>"
                      },
                      {
                        "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": "locationType",
                        "kind": "required",
                        "type": "string",
                        "description": "<p>A string indicating the type of location this is (e.g. kiosk, store, warehouse etc.).</p>"
                      },
                      {
                        "name": "public",
                        "kind": "required",
                        "type": "boolean",
                        "description": "<p>This flag indicates whether the location is available to the public (e.g. a store as opposed to a warehouse).</p>",
                        "example": true
                      },
                      {
                        "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>",
                        "example": true
                      },
                      {
                        "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": "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": "contactInformation",
                        "kind": "required",
                        "type": "map",
                        "description": "<p>This allows for a set of key-value pairs to provide contact information (e.g. phone number: 8885551212).</p>",
                        "example": "",
                        "customType": "map<string, string>",
                        "schema": []
                      },
                      {
                        "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": "pickupHoursExceptions",
                        "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": "dateOriginallyOpened",
                        "kind": "optional",
                        "type": "string<date>",
                        "description": "Date on which the location first opened.",
                        "format": "date"
                      },
                      {
                        "name": "remodelDates",
                        "kind": "optional",
                        "type": "array",
                        "description": "",
                        "example": "[\"2019-05-29\"]",
                        "itemType": "string",
                        "customType": "string[]",
                        "itemExample": "2019-05-29",
                        "itemDefault": ""
                      },
                      {
                        "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": "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": "dynamicProperties",
                        "kind": "optional",
                        "type": "object",
                        "description": "<p>This allows for a set of predefined custom fields to be created that are unique to a given client/tenant.</p>",
                        "example": "",
                        "schema": []
                      },
                      {
                        "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": "pickupAvailable",
                        "kind": "optional",
                        "type": "boolean",
                        "description": "This flag indicates whether a consumer can use this location to pick up their order.",
                        "default": false
                      },
                      {
                        "name": "deliveryAvailable",
                        "kind": "optional",
                        "type": "boolean",
                        "description": "This flag allows for the location to be identified as having a delivery option.",
                        "default": false
                      },
                      {
                        "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": "avgRating",
                        "kind": "optional",
                        "type": "number<double>",
                        "description": "An optional rating provided by an external ratings and reviews framework.",
                        "format": "double"
                      },
                      {
                        "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": "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": "pickupHours",
                        "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": "media",
                        "kind": "optional",
                        "type": "map",
                        "description": "",
                        "example": "",
                        "customType": "map<string, MediaValue>",
                        "schema": []
                      }
                    ]
                  },
                  {
                    "name": "directDistance",
                    "kind": "required",
                    "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": "roadDistance",
                    "kind": "required",
                    "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": "durationInSeconds",
                    "kind": "required",
                    "type": "number",
                    "description": ""
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/LocationDistances",
            "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,
    "examples": {
      "languages": [
        {
          "id": "CCAgn2cpOGiLw0mgaVT7l",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.upstartcommerce.com/v1/location/closestLocationsWithDistancesAndDuration \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'x-upstart-tenant: string' \\\n     --data '{\n     \"coordinates\": {\n     \"latitude\": \"\",\n     \"longitude\": \"\"\n     },\n     \"distance\": {\n     \"value\": \"\"\n     },\n     \"term\": {\n     \"and\": {\n     \"or\": {\n     \"not\": {}\n     },\n     \"not\": {}\n     },\n     \"or\": {\n     \"not\": {}\n     },\n     \"not\": {}\n     }\n     }'"
        },
        {
          "id": "rZ3E_Nhda9HTRcDaW7TOL",
          "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   \"coordinates\": {\n      \"latitude\": \"\",\n      \"longitude\": \"\"\n   },\n   \"distance\": {\n      \"value\": \"\"\n   },\n   \"term\": {\n      \"and\": {\n         \"or\": {\n            \"not\": {}\n         },\n         \"not\": {}\n      },\n      \"or\": {\n         \"not\": {}\n      },\n      \"not\": {}\n   }\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/closestLocationsWithDistancesAndDuration\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "gZSwr8DyzN0e1vqRKfdFp",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.upstartcommerce.com/v1/location/closestLocationsWithDistancesAndDuration\")\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   \"coordinates\": {\n      \"latitude\": \"\",\n      \"longitude\": \"\"\n   },\n   \"distance\": {\n      \"value\": \"\"\n   },\n   \"term\": {\n      \"and\": {\n         \"or\": {\n            \"not\": {}\n         },\n         \"not\": {}\n      },\n      \"or\": {\n         \"not\": {}\n      },\n      \"not\": {}\n   }\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "WlmUDJ9dPCHGQe2QEcZQb",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.upstartcommerce.com/v1/location/closestLocationsWithDistancesAndDuration\"\n\npayload = json.dumps({\n   \"coordinates\": {\n      \"latitude\": \"\",\n      \"longitude\": \"\"\n   },\n   \"distance\": {\n      \"value\": \"\"\n   },\n   \"term\": {\n      \"and\": {\n         \"or\": {\n            \"not\": {}\n         },\n         \"not\": {}\n      },\n      \"or\": {\n         \"not\": {}\n      },\n      \"not\": {}\n   }\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": "CCAgn2cpOGiLw0mgaVT7l"
    },
    "results": {
      "languages": [
        {
          "id": "Sh8Q7PtadJpzlkJWk_29l",
          "language": "200",
          "code": "// Object with filtered locations, including several distances and duration data from specified coordinates.\n{\n  \"coordinatesFrom\": {\n    \"latitude\": \"\",\n    \"longitude\": \"\"\n  },\n  \"locationsWithGoogleData\": [\n    {\n      \"location\": {\n        \"id\": \"\",\n        \"name\": \"\",\n        \"siteIds\": [\n          \"\"\n        ],\n        \"locationType\": \"\",\n        \"public\": true,\n        \"operational\": true,\n        \"address\": {\n          \"city\": \"\",\n          \"country\": \"\",\n          \"county\": \"\",\n          \"postalCode\": \"\",\n          \"stateOrRegion\": \"\",\n          \"street1\": \"\",\n          \"street2\": \"\"\n        },\n        \"coordinates\": {\n          \"latitude\": \"\",\n          \"longitude\": \"\"\n        },\n        \"contactInformation\": \"\",\n        \"operationHoursExceptions\": [\n          {\n            \"closed\": 1200,\n            \"exceptionType\": \"\",\n            \"isOpen\": false,\n            \"name\": \"Memorial Day\",\n            \"open\": \"08:00\"\n          }\n        ],\n        \"pickupHoursExceptions\": [\n          {\n            \"closed\": 1200,\n            \"exceptionType\": \"\",\n            \"isOpen\": false,\n            \"name\": \"Memorial Day\",\n            \"open\": \"08:00\"\n          }\n        ],\n        \"dateOriginallyOpened\": \"\",\n        \"remodelDates\": [\n          \"2019-05-29\"\n        ],\n        \"externalApplicationReferences\": \"\",\n        \"content\": [\n          {\n            \"content\": \"\",\n            \"endDateTime\": \"\",\n            \"identifier\": \"\",\n            \"startDateTime\": \"\"\n          }\n        ],\n        \"dynamicProperties\": {},\n        \"pricingZone\": \"\",\n        \"pickupAvailable\": false,\n        \"deliveryAvailable\": false,\n        \"numReviews\": \"\",\n        \"avgRating\": \"\",\n        \"directionsSummary\": \"\",\n        \"hoursOfOperation\": [\n          {\n            \"closed\": 1200,\n            \"day\": \"\",\n            \"isOpen\": false,\n            \"open\": \"08:00\"\n          }\n        ],\n        \"pickupHours\": [\n          {\n            \"closed\": 1200,\n            \"day\": \"\",\n            \"isOpen\": false,\n            \"open\": \"08:00\"\n          }\n        ],\n        \"media\": \"\"\n      },\n      \"directDistance\": {\n        \"value\": 157.75,\n        \"unit\": \"\"\n      },\n      \"roadDistance\": {\n        \"value\": 157.75,\n        \"unit\": \"\"\n      },\n      \"durationInSeconds\": 0\n    }\n  ]\n}"
        },
        {
          "id": "AMqCITLncAZDR6cOYufn4",
          "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": "JdjIbt_lnDfaeCcW_lD1B",
          "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": "Sh8Q7PtadJpzlkJWk_29l"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}