Update the Assets

PUT
https://api.woosmap.com/stores

Used to update assets in batch. storeId must exists when using PUT method, if one asset does not exists, the batch will be refused.

Authorization

private_key
apiKey query

A Private key generated specifically to authenticate API requests on server side. Required for Data management API. See how to register a Private API Key.

Request Body

application/json

The request body of Stores Update must be formatted as JSON.

stores
object[] required

The Assets collection

Show 10 propertiesHide 10 properties
stores. location
object required

An object describing a specific location with Latitude and Longitude in decimal degrees.

Example:
JSON
        
{
"lat": 43.3,
"lng": 3.46
}
Show 2 propertiesHide 2 properties
stores.location. lat
number required

Latitude in decimal degrees

Example: 42.3
stores.location. lng
number required

Longitude in decimal degrees

Example: 3.46
stores. name
string required

The asset's name.

Example: My Cool Store
stores. storeId
string required

A textual identifier that uniquely identifies an Asset. It must matches the following regexp [A-Za-z0-9]+

Example: STORE_ID_12345
stores. address
object

An object containing the separate components applicable to this address.

Example:
JSON
        
{
"lines": [
"8 Southwark St"
],
"countryCode": "UK",
"city": "London",
"zipcode": "WC1E 7BT"
}
Show 4 propertiesHide 4 properties
stores.address. lines
string[]

An Array for lines of an Asset Address

Example:
JSON
        
[
"Building Centre",
"26 Store Street"
]
stores.address. countryCode
string | null

An ISO_3166-1 Country Code where the Asset is located (see https://en.wikipedia.org/wiki/ISO_3166-1 for full list)

Example: UK
stores.address. city
string

A City where belongs an Asset

Example: London
stores.address. zipcode
string

An Zipcode / Postal code of an Asset Address

Example: WC1E 7BT
stores. contact
object

An object containing the asset's contact available information.

Example:
JSON
        
{
"website": "https://www.woosmap.com",
"phone": "+44 20 7693 4000",
"email": "[email protected]"
}
Show 3 propertiesHide 3 properties
stores.contact. website
string

The website contact for this Asset, such as a business' homepage.

Example: https://www.woosmap.com
stores.contact. phone
string

Contains the Asset's phone number in its local format.

Example: +44 20 7693 4000
stores.contact. email
string

Contains the Asset's email contact.

stores. types
string[]

Contains an array of types describing the Asset.

Example:
JSON
        
[
"drive",
"click_and_collect"
]
stores. tags
string[]

Contains an array of tags describing the Asset. For example a list of available amenities.

Example:
JSON
        
[
"wifi",
"covered_parking"
]
stores. userProperties
object | null

Contains all additional information relative to an Asset. If not set it returns null value.

Example:
JSON
        
{
"some_user_properties": "some_value"
}
stores. localizedNames
object

Alternate names for your assets. These localized names are useful for multi-language integrations. Combined with our Autocomplete API endpoint you can let your users find your store in their native language.

Example:
JSON
        
{
"ar": "مركز فيليتزي التجاري",
"fr": "Centre Commercial Velizy",
"it": "Centro Commerciale Velizy",
"gb": "Velizy Shopping Center"
}
stores. openingHours
object | null

An object describing the opening hours of an Asset.

Example:
JSON
        
{
"timezone": "Europe/London",
"usual": {
"1": [],
"default": [
{
"start": "08:30",
"end": "22:00"
}
]
},
"special": {
"2015-02-07": [
{
"start": "08:00",
"end": "23:00"
}
]
}
}
Show 3 propertiesHide 3 properties
stores.openingHours. timezone
string

Timezone for the Opening Hours of an Asset. It is used to compute the open_now property of an asset. see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones

Example: Europe/London
stores.openingHours. usual
object

An object describing the usual opening hours of an Asset.

Show 8 propertiesHide 8 properties
stores.openingHours.usual. 1
object[]

The opening Hours for Monday

Show 2 propertiesHide 2 properties
stores.openingHours.usual.1. start
string required

Contains a time of day in 24-hour hh:mm format for the begin of opening period. Values are in the range 00:00–23:59

Example: 08:30
stores.openingHours.usual.1. end
string required

Contains a time of day in 24-hour hh:mm format for the end of opening period. Values are in the range 00:00–23:59

Example: 19:30
stores.openingHours.usual. 2
object[]

The opening Hours for Tuesday

Show 2 propertiesHide 2 properties
stores.openingHours.usual.2. start
string required

Contains a time of day in 24-hour hh:mm format for the begin of opening period. Values are in the range 00:00–23:59

Example: 08:30
stores.openingHours.usual.2. end
string required

Contains a time of day in 24-hour hh:mm format for the end of opening period. Values are in the range 00:00–23:59

Example: 19:30
stores.openingHours.usual. 3
object[]

The opening Hours for Wednesday

Show 2 propertiesHide 2 properties
stores.openingHours.usual.3. start
string required

Contains a time of day in 24-hour hh:mm format for the begin of opening period. Values are in the range 00:00–23:59

Example: 08:30
stores.openingHours.usual.3. end
string required

Contains a time of day in 24-hour hh:mm format for the end of opening period. Values are in the range 00:00–23:59

Example: 19:30
stores.openingHours.usual. 4
object[]

The opening Hours for Thursday

Show 2 propertiesHide 2 properties
stores.openingHours.usual.4. start
string required

Contains a time of day in 24-hour hh:mm format for the begin of opening period. Values are in the range 00:00–23:59

Example: 08:30
stores.openingHours.usual.4. end
string required

Contains a time of day in 24-hour hh:mm format for the end of opening period. Values are in the range 00:00–23:59

Example: 19:30
stores.openingHours.usual. 5
object[]

The opening Hours for Friday

Show 2 propertiesHide 2 properties
stores.openingHours.usual.5. start
string required

Contains a time of day in 24-hour hh:mm format for the begin of opening period. Values are in the range 00:00–23:59

Example: 08:30
stores.openingHours.usual.5. end
string required

Contains a time of day in 24-hour hh:mm format for the end of opening period. Values are in the range 00:00–23:59

Example: 19:30
stores.openingHours.usual. 6
object[]

The opening Hours for Saturday

Show 2 propertiesHide 2 properties
stores.openingHours.usual.6. start
string required

Contains a time of day in 24-hour hh:mm format for the begin of opening period. Values are in the range 00:00–23:59

Example: 08:30
stores.openingHours.usual.6. end
string required

Contains a time of day in 24-hour hh:mm format for the end of opening period. Values are in the range 00:00–23:59

Example: 19:30
stores.openingHours.usual. 7
object[]

The opening Hours for Sunday

Show 2 propertiesHide 2 properties
stores.openingHours.usual.7. start
string required

Contains a time of day in 24-hour hh:mm format for the begin of opening period. Values are in the range 00:00–23:59

Example: 08:30
stores.openingHours.usual.7. end
string required

Contains a time of day in 24-hour hh:mm format for the end of opening period. Values are in the range 00:00–23:59

Example: 19:30
stores.openingHours.usual. default
object[]

Contains the default opening hours to apply to all week days

Show 2 propertiesHide 2 properties
stores.openingHours.usual.default. start
string required

Contains a time of day in 24-hour hh:mm format for the begin of opening period. Values are in the range 00:00–23:59

Example: 08:30
stores.openingHours.usual.default. end
string required

Contains a time of day in 24-hour hh:mm format for the end of opening period. Values are in the range 00:00–23:59

Example: 19:30
stores.openingHours. special
object

An object describing the special opening hours of an Asset.

Show 2 propertiesHide 2 properties
stores.openingHours.special. 2015-02-07
object[]

The format for defining opening and closing hours for a particular day is the same as the usual. Instead of using numeric week day for keys you must use a date YYYY-MM-DD like "2015-03-08" (see ISO-8601).

Show 2 propertiesHide 2 properties
stores.openingHours.special.2015-02-07. start
string required

Contains a time of day in 24-hour hh:mm format for the begin of opening period. Values are in the range 00:00–23:59

Example: 08:30
stores.openingHours.special.2015-02-07. end
string required

Contains a time of day in 24-hour hh:mm format for the end of opening period. Values are in the range 00:00–23:59

Example: 19:30
stores.openingHours.special. 2015-02-08
object[]
Show 2 propertiesHide 2 properties
stores.openingHours.special.2015-02-08. start
string required

Contains a time of day in 24-hour hh:mm format for the begin of opening period. Values are in the range 00:00–23:59

Example: 08:30
stores.openingHours.special.2015-02-08. end
string required

Contains a time of day in 24-hour hh:mm format for the end of opening period. Values are in the range 00:00–23:59

Example: 19:30
Example
Stores data to update as JSON
JSON
        
{
"stores": [
{
"types": [
"drive",
"click_and_collect"
],
"tags": [
"wifi",
"covered_parking"
],
"location": {
"lat": 38.719,
"lng": -77.1067
},
"storeId": "STORE_ID_123456",
"name": "My Cool Store",
"address": {
"lines": [
"698-500",
" Lloyds Ln"
],
"countryCode": "US",
"city": "Alexandria",
"zipcode": "VA 22302"
},
"contact": {
"website": "https://www.woosmap.com",
"phone": "+44 20 7693 4000",
"email": "[email protected]"
},
"userProperties": {
"some_user_properties": "associated user value"
},
"openingHours": {
"timezone": "Europe/London",
"usual": {
"1": [],
"default": [
{
"start": "08:30",
"end": "22:00"
}
]
},
"special": {
"2015-02-07": [
{
"start": "08:00",
"end": "23:00"
}
]
}
}
}
]
}

Response

200 application/json

Assets successfully updated

status
string

the status of the 200 response

Example: success
value
string | integer

The value of request for this 200 response

Example: 129 stores

Errors

400

Invalid. The data is not a valid JSON.

application/json
status
string

the status of the 400 response

Example: error
value
string

the value of request causing the Error

Example: The request is invalid, the data is not a valid JSON.
401

Unauthorized. Incorrect authentication credentials.

application/json
detail
string

Details for the credentials error

Example: Incorrect authentication credentials. Please check or use a valid API Key
403

Forbidden. This Woosmap API is not enabled for this project.

application/json
detail
string

Details for the forbidden error message

Example: This Woosmap API is not enabled for this project.
        curl -L -X PUT 'https://api.woosmap.com/stores?private_key=YOUR_PRIVATE_API_KEY' \
-H 'content-type: application/json' \
--data-raw '{
  "stores": [
    {
      "types": [
        "drive",
        "click_and_collect"
      ],
      "tags": [
        "wifi",
        "covered_parking"
      ],
      "location": {
        "lat": 38.719,
        "lng": -77.1067
      },
      "storeId": "STORE_ID_123456",
      "name": "My Cool Store",
      "address": {
        "lines": [
          "698-500",
          " Lloyds Ln"
        ],
        "countryCode": "US",
        "city": "Alexandria",
        "zipcode": "VA 22302"
      },
      "contact": {
        "website": "https://www.woosmap.com",
        "phone": "+44 20 7693 4000",
        "email": "[email protected]"
      },
      "userProperties": {
        "some_user_properties": "associated user value"
      },
      "openingHours": {
        "timezone": "Europe/London",
        "usual": {
          "1": [],
          "default": [
            {
              "start": "08:30",
              "end": "22:00"
            }
          ]
        },
        "special": {
          "2015-02-07": [
            {
              "start": "08:00",
              "end": "23:00"
            }
          ]
        }
      }
    }
  ]
}'

    
        import requests
import json

url = "https://api.woosmap.com/stores?private_key=YOUR_PRIVATE_API_KEY"

payload = json.dumps({
    "stores": [
        {
            "types": [
                "drive",
                "click_and_collect"
            ],
            "tags": [
                "wifi",
                "covered_parking"
            ],
            "location": {
                "lat": 38.719,
                "lng": -77.1067
            },
            "storeId": "STORE_ID_123456",
            "name": "My Cool Store",
            "address": {
                "lines": [
                    "698-500",
                    " Lloyds Ln"
                ],
                "countryCode": "US",
                "city": "Alexandria",
                "zipcode": "VA 22302"
            },
            "contact": {
                "website": "https://www.woosmap.com",
                "phone": "+44 20 7693 4000",
                "email": "[email protected]"
            },
            "userProperties": {
                "some_user_properties": "associated user value"
            },
            "openingHours": {
                "timezone": "Europe/London",
                "usual": {
                    "1": [],
                    "default": [
                        {
                            "start": "08:30",
                            "end": "22:00"
                        }
                    ]
                },
                "special": {
                    "2015-02-07": [
                        {
                            "start": "08:00",
                            "end": "23:00"
                        }
                    ]
                }
            }
        }
    ]
})
headers = {
    'content-type': 'application/json'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)


    
        const axios = require('axios');
let data = JSON.stringify({
  "stores": [
    {
      "types": [
        "drive",
        "click_and_collect"
      ],
      "tags": [
        "wifi",
        "covered_parking"
      ],
      "location": {
        "lat": 38.719,
        "lng": -77.1067
      },
      "storeId": "STORE_ID_123456",
      "name": "My Cool Store",
      "address": {
        "lines": [
          "698-500",
          " Lloyds Ln"
        ],
        "countryCode": "US",
        "city": "Alexandria",
        "zipcode": "VA 22302"
      },
      "contact": {
        "website": "https://www.woosmap.com",
        "phone": "+44 20 7693 4000",
        "email": "[email protected]"
      },
      "userProperties": {
        "some_user_properties": "associated user value"
      },
      "openingHours": {
        "timezone": "Europe/London",
        "usual": {
          "1": [],
          "default": [
            {
              "start": "08:30",
              "end": "22:00"
            }
          ]
        },
        "special": {
          "2015-02-07": [
            {
              "start": "08:00",
              "end": "23:00"
            }
          ]
        }
      }
    }
  ]
});

let config = {
  method: 'put',
  maxBodyLength: Infinity,
  url: 'https://api.woosmap.com/stores?private_key=YOUR_PRIVATE_API_KEY',
  headers: { 
    'content-type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});


    
        
{
"status": "success",
"value": "1 stores"
}
        
{
"status": "error",
"value": "The request is invalid, the data is not a valid JSON."
}
        
{
"detail": "Incorrect authentication credentials. Please check or use a valid API Key"
}
        
{
"detail": "This Woosmap API is not enabled for this project."
}
Was this helpful?