Skip to main content
GET
/
v1
/
locations
List Locations
curl --request GET \
  --url https://{cluster}.voucherify.io/v1/locations \
  --header 'Authorization: Bearer <token>' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>'
{
  "object": "list",
  "data_ref": "data",
  "data": [
    {
      "id": "loc_NoMGXmHO9OUs7iz9mGWpamma",
      "object": "location",
      "name": "Belleville",
      "shape": {
        "type": "circle",
        "format": "distance",
        "distance": {
          "center": "geo:40.79372699823857,-74.15092132694554",
          "radius": "1.54 km"
        }
      },
      "created_at": "2022-07-15T06:04:36.924Z",
      "updated_at": null
    },
    {
      "id": "loc_ae2gKWpAFMsuRhyMqGx2FZFF",
      "object": "location",
      "name": "New York",
      "shape": {
        "type": "polygon",
        "format": "geojson",
        "geojson": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                -74.016167,
                40.703186
              ],
              [
                -74.008687,
                40.750656
              ],
              [
                -73.943597,
                40.851838
              ],
              [
                -73.928559,
                40.845285
              ],
              [
                -73.936152,
                40.8356
              ],
              [
                -73.934298,
                40.810015
              ],
              [
                -73.92711,
                40.795145
              ],
              [
                -73.978623,
                40.710432
              ],
              [
                -74.013201,
                40.701619
              ],
              [
                -74.016167,
                40.703186
              ]
            ]
          ]
        }
      },
      "created_at": "2022-07-15T05:37:45.299Z",
      "updated_at": null
    },
    {
      "id": "loc_f5HqjVaiq7g9ISlmivpytxSf",
      "object": "location",
      "name": "Germany",
      "shape": {
        "type": "circle",
        "format": "distance",
        "distance": {
          "center": "geo:51.303908897065064,10.222253628401518",
          "radius": "192.37 km"
        }
      },
      "created_at": "2022-07-14T15:51:39.265Z",
      "updated_at": null
    },
    {
      "id": "loc_RcYz537sV07e1t5aG5tIH9FD",
      "object": "location",
      "name": "Poland",
      "shape": {
        "type": "polygon",
        "format": "geojson",
        "geojson": {
          "type": "Polygon",
          "coordinates": [
            [
              [
                18.553923,
                50.559107
              ],
              [
                18.528805,
                51.087437
              ],
              [
                19.591667,
                50.832424
              ],
              [
                19.425109,
                50.497984
              ],
              [
                19.375814,
                50.330652
              ],
              [
                19.398107,
                50.111652
              ],
              [
                18.73906,
                49.981498
              ],
              [
                18.272477,
                50.088707
              ],
              [
                18.553923,
                50.559107
              ]
            ]
          ]
        }
      },
      "created_at": "2022-07-14T15:21:55.085Z",
      "updated_at": null
    }
  ],
  "total": 4,
  "has_more": false
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Query Parameters

limit
integer

Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.

Required range: 1 <= x <= 100
order
enum<string>

Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.

Available options:
created_at,
-created_at,
updated_at,
-updated_at
filters
object

Filter the locations using one of the available filters.

end_date
string<date-time>

A filter on the list based on the end date. This will filter out all locations whose end date falls before the specified date and time. A date value must be presented in the ISO 8601 format (2016-11-16T14:14:31Z or 2016-11-16).

Example:

"2023-12-22T10:13:06.487Z"

Response

200 - application/json

Returns a dictionary that contains an array of locations. Each entry in the array is a separate location object. If no more locations are available, the resulting array will be empty. The result can be narrowed down according to specified (or default) filters.

Response schema for listing locations using GET v1/locations.

object
string
default:list

The type of the object represented by JSON. This object stores information about locations in a dictionary.

data_ref
string
default:data

Identifies the name of the attribute that contains the array of metadata schema objects.

data
Location object · object[]

Array of location objects.

total
integer

Total number of locations.

has_more
boolean

As query results are always limited (by the limit parameter), the has_more flag indicates if there are more records for given filter parameters. This lets you know if you can run another request (with a different end date filter) to get more records returned in the results.

I