Locations .: List by Merchant

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

Schema

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.