The API can be accessed by making HTTPS requests to the endpoints URL, which has GET and POST methods based on the API functionality, these methods will allow you to communicate to the API to get or save information. It is a must to access the endpoint via SSL-enabled HTTPS protocol.
The base URL of our API endpoint is:
https://svr.wpmaps.net/v1/
To make a complete API URL, it will be like this.
POST https://svr.wpmaps.net/v1/products/get/{product_id}?access_token={Your Acess Token}&client_id={Your Client ID}&lang=en_US
Language Parameter #
The default language for all requests will be the United States English en_US, so in case you want send to send API for some other language, you will append the language as the query parameter in the URL.
POST https://svr.wpmaps.net/v1/products/get/{product_id}?access_token={Your Acess Token}&client_id={Your Client ID}&lang={Language Code}
Requests #
Below are the details of the available API endpoints from our API, all these requests must be made through HTTPS request and the payload will be in the JSON format.
Create Product #
To create one or more products in a single HTTPS POST request.
POST products/save?access_token={Your Acess Token}&client_id={Your Client ID}&lang=en_US
Request
Parameter | Type | Required? | Description |
---|---|---|---|
client_id | String | required | The client id of the account. |
acccess_token | String | required | the generated access token of the account |
data | Array | required | The payload of the request, an array of one or more products that are needed to be saved. |
The payload for the data parameter
{
"data": [{
"brand": "covergirl",
"title": "CoverGirl Outlast Longwear Lipstick",
"price": "10.99",
"images": "https://d3t32hsnjxo7q6.cloudfront.net/i/2d46e82f21b11f658a4378abcbd1c31b_ra,w158,h184_pa,w158,h184.png",
"url": "https://well.ca/products/covergirl-outlast-longwear-lipstick_105803.html",
"description": "With CoverGirl Outlast Longwear Lipstick you get both moisture and colour.",
"categories": "Lipstick"
}]
}
Response
{
"products": [
{
"title": "CoverGirl Outlast Longwear Lipstick",
"description": "With CoverGirl Outlast Longwear Lipstick you get both moisture and colour.",
"price": "10.99",
"url": "https://well.ca/products/covergirl-outlast-longwear-lipstick_105803.html",
"brand": "covergirl",
"categories": [],
"stores": [],
"id": 26,
"created_at": "2020-01-21 18:09:56"
}
],
"results": "1 product is added successfully"
}
Additional attributes of the WP Maps that can be passed with each product can be the tab, product type, and the online retailer links such as these.
Parameter | Type | Required? | Description |
---|---|---|---|
tab | String | required | The tab to which the product will be assigned |
ptype | String | required | The ID of the product type to which the product will be assigned |
affs | Array | required | The array of the online retailer links of the product |
Example of Payload
{
"data": [{
"brand": "covergirl",
"title": "CoverGirl Outlast Longwear Lipstick",
"price": "10.99",
"images": "https://d3t32hsnjxo7q6.cloudfront.net/i/2d46e82f21b11f658a4378abcbd1c31b_ra,w158,h184_pa,w158,h184.png",
"url": "https://well.ca/products/covergirl-outlast-longwear-lipstick_105803.html",
"description": "With CoverGirl Outlast Longwear Lipstick you get both moisture and colour.",
"ptype": "1",
"tab": "Makeup",
"affs": {
"amazon": 'https://amazon.com/the-complete-url-of-the-product',
"target": 'https://target.com/the-complete-url-of-the-product'
}
}]
}
Update Product #
To update one or more products in a single HTTPS POST request, all you need is to use the same code for creating a product, the id parameter in the product data object will determine if it is a request or insert request to create a new record.
POST products/save?access_token={Your Acess Token}&client_id={Your Client ID}&lang=en_US
Request
Parameter | Type | Required? | Description |
---|---|---|---|
client_id | String | required | The client id of the account. |
acccess_token | String | required | the generated access token of the account |
data | Array | required | The payload of the request, an array of one or more products that are needed to be saved. |
The payload for the data parameter
{
"data": [{
"id": 26,
"brand": "covergirl",
"title": "CoverGirl Outlast Longwear Lipstick",
"price": "10.99",
"images": "https://d3t32hsnjxo7q6.cloudfront.net/i/2d46e82f21b11f658a4378abcbd1c31b_ra,w158,h184_pa,w158,h184.png",
"url": "https://well.ca/products/covergirl-outlast-longwear-lipstick_105803.html",
"description": "With CoverGirl Outlast Longwear Lipstick you get both moisture and colour.",
"categories": "Lipstick"
}]
}
Response
{
"products": [
{
"title": "CoverGirl Outlast Longwear Lipstick",
"description": "With CoverGirl Outlast Longwear Lipstick you get both moisture and colour! No need to choose!This long lasting lipstick doesn’t flake or \ncrumble because it’s super-powered with moisture.",
"price": "10.99",
"url": "https://well.ca/products/covergirl-outlast-longwear-lipstick_105803.html",
"brand": "covergirl",
"categories": [],
"stores": [],
"id": 26,
"created_at": "2020-01-21 18:09:56"
}
],
"results": "1 product is updated successfully"
}
Get Product #
To get one or more product data in a single HTTPS GET request.
GET products/get/{product_id}?access_token={Your Acess Token}&client_id={Your Client ID}&lang=en_US
Request
Parameter | Type | Required? | Description |
---|---|---|---|
client_id | String | required | The client id of the account. |
acccess_token | String | required | the generated access token of the account |
product_id | String | required | Product Id that needs to be fetched. |
Response
{
"product": {
"title": "CoverGirl Outlast Longwear Lipstick",
"description": "With CoverGirl Outlast Longwear Lipstick you get both moisture and colour! No need to choose!This long lasting lipstick doesn’t flake or \ncrumble because it’s super-powered with moisture.",
"price": "10.99",
"url": "https://well.ca/products/covergirl-outlast-longwear-lipstick_105803.html",
"brand": "covergirl",
"categories": [],
"stores": [],
"id": 26
}
}
Delete Product #
To delete one or more product data in a single HTTPS POST request.
POST products/delete?access_token={Your Acess Token}&client_id={Your Client ID}&lang=en_US
Be careful in calling the request as it may result in deleting your records.
Request
Parameter | Type | Required? | Description |
---|---|---|---|
client_id | String | required | The client id of the account. |
acccess_token | String | required | the generated access token of the account |
ids | Array | required | An array of product Ids need to be deleted. |
The payload for delete request
{"ids": [26]}
Response
{"success":true,"message":"Product has been deleted successfully"}
Get All Products #
To get all product data in a single HTTPS GET request.
GET products/all?access_token={Your Acess Token}&client_id={Your Client ID}&lang=en_US
Request
Parameter | Type | Required? | Description |
---|---|---|---|
client_id | String | required | The client id of the account. |
acccess_token | String | required | the generated access token of the account |
Response
{
"data":[...],
"header":["id","title","description","price","url"....,"categories","images","tab"]
}
Create Store #
To create one or more stores in a single HTTPS POST request.
POST stores/save?access_token={Your Acess Token}&client_id={Your Client ID}&lang=en_US
Request
Parameter | Type | Required? | Description |
---|---|---|---|
client_id | String | required | The client id of the account. |
acccess_token | String | required | the generated access token of the account |
geocoder | String | optional | The geocoder service to get the coordinates, default is ‘google_maps’, other options are ‘google_maps’, ‘mapbox’ and ‘arcgis_online’ |
data | Array | required | The payload of the request, an array of one or more stores that are needed to be saved. |
The payload for the data parameter
{
"data": [{
"title": "Hair Saloon",
"description": "Some details about it",
"url": null,
"disable": null,
"street": "1491 Lincoln Ave",
"city": "Calistoga",
"state": "CA",
"postal_code": null,
"country": "United States",
"lat": 38.5803165,
"lng": -122.5790298,
"phone": "123 888 1111",
"email": null
}],
'geocoder': 'google_maps'
}
Response
{
"stores": [
{
"id": 20,
"title": "Hair Saloon",
"description": "Some details about it",
"url": null,
"disable": null,
"street": "1491 Lincoln Ave",
"city": "Calistoga",
"state": "CA",
"postal_code": null,
"country": "United States",
"lat": 38.5803165,
"lng": -122.5790298,
"phone": "123 888 1111",
"email": null
}
],
"results": "1 store is added successfully"
}
Update Store #
To update one or more stores in a single HTTPS POST request, all you need is to use the same code for creating a store, the id parameter in the store data object will determine if it is a request or insert request to create a new record.
POST stores/save?access_token={Your Acess Token}&client_id={Your Client ID}&lang=en_US
Request
Parameter | Type | Required? | Description |
---|---|---|---|
client_id | String | required | The client id of the account. |
acccess_token | String | required | the generated access token of the account |
geocoder | String | optional | The geocoder service to get the coordinates, default is ‘google_maps’, other options are ‘google_maps’, ‘mapbox’ and ‘arcgis_online’ |
data | Array | required | The payload of the request, an array of one or more stores that are needed to be saved. |
The payload for the data parameter
{
"data": [{
"id": 20,
"title": "Hair Saloon",
"description": "Some details about it",
"url": null,
"disable": null,
"street": "1491 Lincoln Ave",
"city": "Calistoga",
"state": "CA",
"postal_code": null,
"country": "United States",
"lat": 38.5803165,
"lng": -122.5790298,
"phone": "123 888 1111",
"email": null
}],
'geocoder': 'google_maps'
}
Response
{
"stores": [
{
"id": 20,
"title": "Hair Saloon",
"description": "Some details about it",
"url": null,
"disable": null,
"street": "1491 Lincoln Ave",
"city": "Calistoga",
"state": "CA",
"postal_code": null,
"country": "United States",
"lat": 38.5803165,
"lng": -122.5790298,
"phone": "123 888 1111",
"email": null
}
],
"results": "1 store is updated successfully"
}
Get Store #
To get one or more stores data in a single HTTPS GET request.
GET stores/get/{store_id}?access_token={Your Acess Token}&client_id={Your Client ID}&lang=en_US
Request
Parameter | Type | Required? | Description |
---|---|---|---|
client_id | String | required | The client id of the account. |
acccess_token | String | required | the generated access token of the account |
store_id | String | required | Store Id that needs to be fetched. |
Response
{
"store": {
"id": 20,
"title": "Hair Saloon",
"description": "Some details about it",
"url": null,
"disable": null,
"street": "1491 Lincoln Ave",
"city": "Calistoga",
"state": "CA",
"postal_code": null,
"country": "United States",
"lat": 38.5803165,
"lng": -122.5790298,
"phone": "123 888 1111",
"email": null
}
}
Delete Store #
To delete one or more stores data in a single HTTPS POST request.
POST stores/delete?access_token={Your Acess Token}&client_id={Your Client ID}&lang=en_US
Be careful in calling the request as it may result in deleting your records.
Request
Parameter | Type | Required? | Description |
---|---|---|---|
client_id | String | required | The client id of the account. |
acccess_token | String | required | the generated access token of the account |
ids | Array | required | An array of store Ids that need to be deleted. |
The payload for delete request
{"ids": [26]}
Response
{"success":true,"message":"Store has been deleted successfully"}
Get All Stores #
To get all store data in a single HTTPS GET request.
GET stores/all?access_token={Your Acess Token}&client_id={Your Client ID}&lang=en_US
Request
Parameter | Type | Required? | Description |
---|---|---|---|
client_id | String | required | The client id of the account. |
acccess_token | String | required | the generated access token of the account |
Response
{
"data":[...],
"header":["id","title","description","url","disable","street","city","state","postal_code","country","lat","lng","phone","email",...]
}