List Locations

Provider Enablement / Endpoints

List Locations by Merchant

For a given merchant (identified by the appropriate merchant identifier received in the list merchants call), return all locations belonging to that merchant. The provider_id returned here will be passed to subsequent calls that require a location provider ID.

LevelUp will hit this endpoint to get the locations list for a given merchant.

Note that the the id here is not LevelUp’s internal id but rather your location ID as the provider. In short, it’s the ID that you return to us in the locations endpoint above.

The endpoint should return information about each location, including address, hours, phone # etc…

Request Endpoint

GET /merchants/:provider_merchant_id/locations

Example Response Body

{
  "updated_at": "2016-08-17T12:45:03",
  "locations": [
    {
      "location": {
        "accepts_tips": true,
        "extended_address": "Suite 100",
        "hours": [
          {
            "sunday": [
              {
                "opens_at": "11:00",
                "closes_at": "15:00"
              }
            ]
          },
          {
            "monday": [
              {
                "opens_at": "7:30",
                "closes_at": "15:00"
              },
              {
                "opens_at": "17:00",
                "closes_at": "23:00"
              }
            ]
          },
          {
            "tuesday": [
              {
                "opens_at": "09:00",
                "closes_at": "22:00"
              }
            ]
          },
          {
            "wednesday": [
              {
                "opens_at": "09:00",
                "closes_at": "22:00"
              }
            ]
          },
          {
            "thursday": [
              {
                "opens_at": "09:00",
                "closes_at": "22:00"
              }
            ]
          },
          {
            "friday": [
              {
                "opens_at": "09:00",
                "closes_at": "22:00"
              }
            ]
          },
          {
            "saturday": [
              {
                "opens_at": "11:00",
                "closes_at": "15:00"
              }
            ]
          }
        ],
        "locality": "Boston",
        "name": "Five Guys Summer St.",
        "phone": "3459131235",
        "postal_code": "02210",
        "provider_id": "12345",
        "region": "MA",
        "street_address": "58 Summer St."
      }
    },
    {
      "location": {
        "accepts_tips": "false",
        "hours": [
          {
            "sunday": [
              {
                "opens_at": "11:00",
                "closes_at": "15:00"
              }
            ]
          },
          {
            "monday": [
              {
                "opens_at": "09:00",
                "closes_at": "22:00"
              }
            ]
          },
          {
            "tuesday": [
              {
                "opens_at": "09:00",
                "closes_at": "22:00"
              }
            ]
          },
          {
            "wednesday": [
              {
                "opens_at": "09:00",
                "closes_at": "22:00"
              }
            ]
          },
          {
            "thursday": [
              {
                "opens_at": "09:00",
                "closes_at": "22:00"
              }
            ]
          },
          {
            "friday": [
              {
                "opens_at": "09:00",
                "closes_at": "22:00"
              }
            ]
          },
          {
            "saturday": [
              {
                "opens_at": "11:00",
                "closes_at": "15:00"
              }
            ]
          }
        ],
        "locality": "Cambridge",
        "name": "Five Guys Mass. Ave.",
        "phone": "9786431567",
        "postal_code": "02139",
        "provider_id": "946283",
        "region": "MA",
        "street_address": "860 Mass. Ave."
      }
    }
  ]
}

Example Response Schema

{
  "type": "object",
  "properties": {
    "updated_at": {
      "description": "An iso8601 datestamp in UTC of when the location list was last refreshed",
      "type": "string"
    },
    "locations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "location": {
            "type": "object",
            "properties": {
              "accepts_tips": {
                "description": "Whether or not the location accepts tips on orders",
                "type": "boolean"
              },
              "extended_address": {
                "description": "Additional address information, e.g. 'Suite 100'",
                "type": "string"
              },
              "hours": {
                "type": "object",
                "properties": {
                  "sunday": {
                    "type": "array",
                    "description": "An array containing zero or more objects containing opens_at and closes_at timestamp properties",
                    "items": {
                      "type": "object",
                      "description": "An object containing opens_at and closes_at timestamps",
                      "items": {
                        "opens_at": {
                          "description": "The time (HH:MM) at which the location opens in local timezone",
                          "type": "timestamp"
                        },
                        "closes_at": {
                          "description": "The time (HH:MM) at which the location closes in local timezone",
                          "type": "timestamp"
                        }
                      },
                      "required": [
                        "closes_at",
                        "opens_at"
                      ]
                    }
                  },
                  "monday": {
                    "type": "array",
                    "description": "An array containing zero or more objects containing opens_at and closes_at timestamp properties",
                    "items": {
                      "type": "object",
                      "description": "An object containing opens_at and closes_at timestamps",
                      "items": {
                        "opens_at": {
                          "description": "The time (HH:MM) at which the location opens in local timezone",
                          "type": "timestamp"
                        },
                        "closes_at": {
                          "description": "The time (HH:MM) at which the location closes in local timezone",
                          "type": "timestamp"
                        }
                      },
                      "required": [
                        "closes_at",
                        "opens_at"
                      ]
                    }
                  },
                  "tuesday": {
                    "type": "array",
                    "description": "An array containing zero or more objects containing opens_at and closes_at timestamp properties",
                    "items": {
                      "type": "object",
                      "description": "An object containing opens_at and closes_at timestamps",
                      "items": {
                        "opens_at": {
                          "description": "The time (HH:MM) at which the location opens in local timezone",
                          "type": "timestamp"
                        },
                        "closes_at": {
                          "description": "The time (HH:MM) at which the location closes in local timezone",
                          "type": "timestamp"
                        }
                      },
                      "required": [
                        "closes_at",
                        "opens_at"
                      ]
                    }
                  },
                  "wednesday": {
                    "type": "array",
                    "description": "An array containing zero or more objects containing opens_at and closes_at timestamp properties",
                    "items": {
                      "type": "object",
                      "description": "An object containing opens_at and closes_at timestamps",
                      "items": {
                        "opens_at": {
                          "description": "The time (HH:MM) at which the location opens in local timezone",
                          "type": "timestamp"
                        },
                        "closes_at": {
                          "description": "The time (HH:MM) at which the location closes in local timezone",
                          "type": "timestamp"
                        }
                      },
                      "required": [
                        "closes_at",
                        "opens_at"
                      ]
                    }
                  },
                  "thursday": {
                    "type": "array",
                    "description": "An array containing zero or more objects containing opens_at and closes_at timestamp properties",
                    "items": {
                      "type": "object",
                      "description": "An object containing opens_at and closes_at timestamps",
                      "items": {
                        "opens_at": {
                          "description": "The time (HH:MM) at which the location opens in local timezone",
                          "type": "timestamp"
                        },
                        "closes_at": {
                          "description": "The time (HH:MM) at which the location closes in local timezone",
                          "type": "timestamp"
                        }
                      },
                      "required": [
                        "closes_at",
                        "opens_at"
                      ]
                    }
                  },
                  "friday": {
                    "type": "array",
                    "description": "An array containing zero or more objects containing opens_at and closes_at timestamp properties",
                    "items": {
                      "type": "object",
                      "description": "An object containing opens_at and closes_at timestamps",
                      "items": {
                        "opens_at": {
                          "description": "The time (HH:MM) at which the location opens in local timezone",
                          "type": "timestamp"
                        },
                        "closes_at": {
                          "description": "The time (HH:MM) at which the location closes in local timezone",
                          "type": "timestamp"
                        }
                      },
                      "required": [
                        "closes_at",
                        "opens_at"
                      ]
                    }
                  },
                  "saturday": {
                    "type": "array",
                    "description": "An array containing zero or more objects containing opens_at and closes_at timestamp properties",
                    "items": {
                      "type": "object",
                      "description": "An object containing opens_at and closes_at timestamps",
                      "items": {
                        "opens_at": {
                          "description": "The time (HH:MM) at which the location opens in local timezone",
                          "type": "timestamp"
                        },
                        "closes_at": {
                          "description": "The time (HH:MM) at which the location closes in local timezone",
                          "type": "timestamp"
                        }
                      },
                      "required": [
                        "closes_at",
                        "opens_at"
                      ]
                    }
                  }
                },
                "required": [
                  "sunday",
                  "monday",
                  "tuesday",
                  "wednesday",
                  "thursday",
                  "friday",
                  "saturday"
                ]
              },
              "provider_id": {
                "description": "The ID for the location that we will pass to you when ordering",
                "type": "string"
              },
              "locality": {
                "description": "The city/region of the location, e.g. 'Boston'",
                "type": "string"
              },
              "name": {
                "description": "The name of the location, e.g. 'Five Guys Summer St.'",
                "type": "string"
              },
              "phone": {
                "description": "The phone number for the location",
                "type": "string"
              },
              "postal_code": {
                "description": "The postal code for the location",
                "type": "string"
              },
              "region": {
                "description": "The state the location is in",
                "type": "string"
              },
              "street_address": {
                "description": "",
                "type": "string"
              }
            },
            "required": [
              "accepts_tips",
              "locality",
              "name",
              "provider_id",
              "region",
              "street_address"
            ]
          }
        }
      }
    }
  },
  "required": [
    "locations",
    "updated_at"
  ]
}

If a location has multiple open and close times, return an array of each open and close time as in this example. If open/closed hours span midnight, they should be split into two separate segments, one for each actual day. So if a location is open on Tuesday night from 6 pm to 2 am, we should represent that like this:

{
  "hours": {
    "tuesday": [{
      "opens_at": "18:00",
      "closes_at": "24:00"
    }],
    "wednesday": [{
      "opens_at": "0:00",
      "closes_at": "2:00"
    }]
  }
}

If a location’s hours for a particular day are not known as given from provider, return the hours attribute with a value of nil.

Ex: only Tuesdays and Wednesdays of a particular merchant are not known:

{
  "hours": {
    "monday": [{
      "opens _at": "18:00",
      "closes_at": "22:00"
    }],
    "tuesday": nil,
    "wednesday": nil
  }
}

However, if they are known to be closed return with a value of “closed”. Ex: Monday hours are not known. Tuesdays and Wednesdays are explicitly closed as given by provider

{
  "hours": {
    "monday": nil,
    "tuesday": "closed",
    "wednesday": "closed"
  }
}

Your response should always include all days of the week, even if some are nil, indicating the hours are unknown or not recorded.