Overview

The Locations v5 API has been designed with scale in mind, allowing a client to have many thousands of locations while maintaining performance.

The endpoints for v5 locations

v5 location registry

v5/location/registry returns a small subset of location details for all locations related to the app ID your accessToken or SSO tokens are linked to.

curl "https://api.flypaythis.com/v5/location/registry?accessToken={accessToken}"

This endpoint also accepts a latitude - longitude query parameters. If they're provided the returned locations will be in proximity order.

curl "https://api.flypaythis.com/v5/location/registry?accessToken={accessToken}&lat=51.531916&lng=-0.118430"

The response for the previous endpoints will be:

{
  "locations": [
    {
      "revision": "15656892-b415-41b6-aaeb-8c385b630cb4",
      "id": "755",
      "services": [
        "3"
      ]
    },
    {
      "revision": "96c17529-7c4f-4c30-8921-8431c31f89d5",
      "id": "727",
      "services": [
        "3"
      ]
    },
    {
      "revision": "a7601772-211a-4ad0-b70a-d0489e4b2337",
      "id": "879",
      "services": [
        "3"
      ]
    }
  ]
}

v5 location

v5/location returns a more detailed location object, always related to the app ID your accessToken or SSO tokens are linked to.

## get locations filtered by ids
curl "https://api.flypaythis.com/v5/location?accessToken={accessToken}"

This endpoint consents to filter the location by id using a query parameter:

curl "https://api.flypaythis.com/v5/location?accessToken={accessToken}&ids=755,756"

The response for the previous endpoints will be:

{
  "locations": [
    {
      "revision": "72bc620a-fdda-47e5-85f4-f258e579f826",
      "businessId": 79,
      "businessName": "Nando's",
      "longDescription": null,
      "id": "755",
      "name": "High Street Kensington",
      "locationReference": "N027",
      "locationStatus": "online",
      "address": {
        "line1": "229 - 231 High Street Kensington",
        "line2": "",
        "city": "London",
        "postCode": "W8 6SA",
        "latLng": {
          "lat": 51.4992404,
          "lng": -0.1975098
        },
        "country": "United Kingdom",
        "countryCodeId": 221,
        "countryCode": "GB"
      },
      "openingHours": {
        "regular": {
          "monday": [
            {
              "open": "11:45",
              "close": "22:40"
            }
          ],
          "tuesday": [
            {
              "open": "11:45",
              "close": "22:40"
            }
          ],
          "wednesday": [
            {
              "open": "11:45",
              "close": "22:40"
            }
          ],
          "thursday": [
            {
              "open": "11:45",
              "close": "22:40"
            }
          ],
          "friday": [
            {
              "open": "11:45",
              "close": "22:40"
            }
          ],
          "saturday": [
            {
              "open": "11:45",
              "close": "22:40"
            }
          ],
          "sunday": [
            {
              "open": "11:45",
              "close": "22:40"
            }
          ]
        },
        "special": {}
      },
      "gallery": [],
      "contactNumber": "020 1234 1234",
      "timeZone": "Europe\/London",
      "unacceptedCardTypes": [],
      "alternativePrimaryName": null,
      "alternativeSecondaryName": null,
      "paymentDetails": {
        "supportsApplePay": true
      },
      "logos": [],
      "brandColor": null,
      "channelLocationReference": null,
      "description": "",
      "services": [
        {
          "uniqueId": "3",
          "name": "Just Eat Whitelabel Delivery",
          "status": "online"
        }
      ]
    },
    {
      "id": "756",
      [...]
    }
  ]
}

Where the service status can map to "online" or "offline" only.

Basic workflow

  1. Call the v5/location/registry endpoint to get your full list of available locations.

  2. Call the v5/location endpoint with all or a subset of the location IDs from the response of the previous one.

  3. Once you have your location data from v5/location you can query v5/location/registry to check to see if the revision of any of your locations has changed and request only ones that have.

v4 business

v4/business will return the business info which is related to the app ID that your accessToken or SSO tokens are linked to.

curl "https://api.flypaythis.com/v4/business?accessToken={accessToken}"

The response for the previous endpoints will be:

{
  "businesses": {
    "79": {
      "id": "79",
      "name": "Nando's",
      "logos": []
    }
  }
}