Prepare your Stores Data

Prepare your stores data to match the required and optional fields.
  1. Before You Start
  2. Prepare stores data
  3. Required data
  4. Optional data
    1. types
    2. tags
    3. address
    4. contact
    5. openingHours
    6. userProperties

Before You Start

In order to implement Local Search or Recommendation in your website you have to organize and centralize your assets location data.

With Woosmap Data API manage, create or edit locations. The API is designed for developers, engineers, or anyone else who’s comfortable creating custom-coded solutions or integrating with RESTful APIs. If you think you may need some help integrating with the Woosmap Data API, connect with one of our experts to help develop a custom tool for you.

Prepare stores data

The Woosmap Data API only supports JSON. So you have to create a JSON file with your stores’ addresses and other information. You’ll need to convert, or geocode, the addresses in your file to latitude/longitude (lat / long) coordinates. Those coordinates will be used for local searches, for recommendations and for displaying markers on a map with Woosmap Javascript API.

Each asset should also have a unique identifier which you should use to update assets individually.

Required data

an asset element has the following minimal structure (More complete store example)

{
    "storeId": "unique identifier",
    "name": "Store Name",
    "location": {
        "lat": 43.600,
        "lng": 3.883
    }
}

storeId, name and location are mandatory, everything else is optional.

The storeId field must be a unique identifier for your store. And match the following regexp [A-Za-z0-9]+

Optional data

types

types : an array of string

{
    "types": ["book_store", "library"]
}

tags

tags: an array of string

{
    "tags": ["science", "comics"]
}

address

address

{
    "address": {
        "lines": ["Road name", "Another line of address"],
        "countryCode": "FR",
        "city": "Paris",
        "zipcode": "75000"
    }
}

contact

contact might contain website, phone and email values.

{
    "contact": {
        "website": "website url",
        "phone": "phone number",
        "email": "contact email"
    }
}

openingHours

In this example the store will be open between 8:30am and 19:30pm every day except sunday (7) where it’ll be closed. The december 24th 2015 the store will be open from 9:00am to 18:00pm and the december 25th 2015 the store will be closed.

For more details concerning Open Hours see the dedicated page Opening Hours.

{
    "openingHours": {
        "timezone": "Europe/Paris",
        "usual": {
            "7": [],
            "default": [{"start": "08:30", "end": "19:30"}]
        },
        "special": {
        "2015-12-24": [{"start": "09:00", "end": "18:00"}],
                    "2015-12-25": []}
    }
}

userProperties

userProperties might contain additional user-defined data.