Using the API to fetch store data from Mapstore
Get Store Locations
Returns a paginated list of active store locations for your Shopify store.
xxxxxxxxxx
1
1
GET /apps/mapstore/api/locations
Security
- The API can only be called from your Shopify store domain (*.myshopify.com)
- Requests from unauthorized domains will receive a 403 error
Query Parameters
Parameter | Type | Required | Description |
Response Format
Returns a JSON array of location objects with the following properties:
xxxxxxxxxx
14
1
{
2
name: string
3
address: string
4
description: string
5
email: string
6
website: string
7
lat: number
8
lng: number
9
phone: string
10
filters: string[]
11
popupContent: string
12
popupCustomization: boolean
13
customMarkerImage: string
14
}
Example Request
xxxxxxxxxx
3
1
const response = await fetch('/apps/mapstore/api/locations');
2
3
const locations = await response.json();
Notes
- Results are paginated with 50 items per page
- Only active locations (status = true) are returned
- Results are sorted by creation date in descending order
- Response includes Cache-Control headers for optimal performance
Error Responses
- 400: Missing shop parameter
- 403: Unauthorized domain
- 405: Method not allowed (only GET is supported)
- 500: Server error