Locations
Get a location
Read one location and its optional attached information.
GET
/
api
/
v2
/
projects
/
{project_id}
/
locations
/
{location_id}
curl --get 'https://storerocket.io/api/v2/projects/PROJECT_ID/locations/LOCATION_ID' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Accept: application/json' \
--data-urlencode 'includeHours=1' \
--data-urlencode 'includeFilters=1' \
--data-urlencode 'includeFields=1' \
--data-urlencode 'includeCallsToAction=1'
const token = process.env.STOREROCKET_TOKEN;
if (!token) throw new Error("Set STOREROCKET_TOKEN first.");
const projectId = "PROJECT_ID";
const locationId = "LOCATION_ID";
const url = new URL(`https://storerocket.io/api/v2/projects/${encodeURIComponent(projectId)}/locations/${encodeURIComponent(locationId)}`);
url.searchParams.set("includeHours", "1");
url.searchParams.set("includeFilters", "1");
url.searchParams.set("includeFields", "1");
url.searchParams.set("includeCallsToAction", "1");
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${token}`,
Accept: "application/json",
},
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) throw new Error(`HTTP ${response.status}: ${text}`);
console.log(JSON.parse(text));
<?php
$token = getenv("STOREROCKET_TOKEN") ?: throw new RuntimeException("Set STOREROCKET_TOKEN first.");
$projectId = "PROJECT_ID";
$locationId = "LOCATION_ID";
$url = 'https://storerocket.io/api/v2/projects/' . rawurlencode($projectId) . '/locations/' . rawurlencode($locationId);
$url .= "?" . http_build_query([
'includeHours' => 1,
'includeFilters' => 1,
'includeFields' => 1,
'includeCallsToAction' => 1,
], "", "&", PHP_QUERY_RFC3986);
$curl = curl_init($url);
curl_setopt_array($curl, [
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $token",
"Accept: application/json",
],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 5,
CURLOPT_TIMEOUT => 30,
]);
$text = curl_exec($curl);
$error = curl_error($curl);
$status = (int) curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($text === false) {
throw new RuntimeException("Request failed: $error");
}
if ($status < 200 || $status >= 300) {
throw new RuntimeException("HTTP $status: $text");
}
$data = json_decode($text, false, 512, JSON_THROW_ON_ERROR);
echo json_encode($data, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR), PHP_EOL;
{
"data": {
"id": "LOCATION_ID",
"name": "Downtown Store",
"address": "123 Main St, Seattle, WA 98101",
"city": "Seattle",
"postcode": "98101",
"phone": "555-0101",
"lat": 47.6062,
"lng": -122.3321,
"marker_id": null,
"marker_url": null,
"location_type": "Standard",
"cover_image_url": null,
"hours": {
"name": "Store hours",
"mon": "09:00-17:00",
"tue": "09:00-17:00",
"wed": "09:00-17:00",
"thu": "09:00-17:00",
"fri": "09:00-17:00",
"sat": "10:00-14:00",
"sun": "closed"
},
"filters": [],
"fields": [{"id":"FIELD_ID","name":"Manager","value":"Sam"}],
"callsToAction": [{"id":"CTA_ID","title":"Book","value":"https://example.com/book"}]
}
}
Requires
JavaScript examples run in Node.js 22 or later; PHP examples require PHP 8.2 or later with cURL. Both read
The full resource also includes
location:read and project API access. The location must belong to the project in the URL.
string
required
The public project ID.
string
required
The public location ID.
number
Send
1 to include opening hours.number
Send
1 to include filters.number
Send
1 to include custom fields.number
Send
1 to include calls to action.STOREROCKET_TOKEN from your environment. See the quickstart for setup.
curl --get 'https://storerocket.io/api/v2/projects/PROJECT_ID/locations/LOCATION_ID' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Accept: application/json' \
--data-urlencode 'includeHours=1' \
--data-urlencode 'includeFilters=1' \
--data-urlencode 'includeFields=1' \
--data-urlencode 'includeCallsToAction=1'
const token = process.env.STOREROCKET_TOKEN;
if (!token) throw new Error("Set STOREROCKET_TOKEN first.");
const projectId = "PROJECT_ID";
const locationId = "LOCATION_ID";
const url = new URL(`https://storerocket.io/api/v2/projects/${encodeURIComponent(projectId)}/locations/${encodeURIComponent(locationId)}`);
url.searchParams.set("includeHours", "1");
url.searchParams.set("includeFilters", "1");
url.searchParams.set("includeFields", "1");
url.searchParams.set("includeCallsToAction", "1");
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${token}`,
Accept: "application/json",
},
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) throw new Error(`HTTP ${response.status}: ${text}`);
console.log(JSON.parse(text));
<?php
$token = getenv("STOREROCKET_TOKEN") ?: throw new RuntimeException("Set STOREROCKET_TOKEN first.");
$projectId = "PROJECT_ID";
$locationId = "LOCATION_ID";
$url = 'https://storerocket.io/api/v2/projects/' . rawurlencode($projectId) . '/locations/' . rawurlencode($locationId);
$url .= "?" . http_build_query([
'includeHours' => 1,
'includeFilters' => 1,
'includeFields' => 1,
'includeCallsToAction' => 1,
], "", "&", PHP_QUERY_RFC3986);
$curl = curl_init($url);
curl_setopt_array($curl, [
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $token",
"Accept: application/json",
],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 5,
CURLOPT_TIMEOUT => 30,
]);
$text = curl_exec($curl);
$error = curl_error($curl);
$status = (int) curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($text === false) {
throw new RuntimeException("Request failed: $error");
}
if ($status < 200 || $status >= 300) {
throw new RuntimeException("HTTP $status: $text");
}
$data = json_decode($text, false, 512, JSON_THROW_ON_ERROR);
echo json_encode($data, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR), PHP_EOL;
Response format
Successful reads and writes return200 with a data object. The example below shows selected fields with illustrative values.
{
"data": {
"id": "LOCATION_ID",
"name": "Downtown Store",
"address": "123 Main St, Seattle, WA 98101",
"city": "Seattle",
"postcode": "98101",
"phone": "555-0101",
"lat": 47.6062,
"lng": -122.3321,
"marker_id": null,
"marker_url": null,
"location_type": "Standard",
"cover_image_url": null,
"hours": {
"name": "Store hours",
"mon": "09:00-17:00",
"tue": "09:00-17:00",
"wed": "09:00-17:00",
"thu": "09:00-17:00",
"fri": "09:00-17:00",
"sat": "10:00-14:00",
"sun": "closed"
},
"filters": [],
"fields": [{"id":"FIELD_ID","name":"Manager","value":"Sam"}],
"callsToAction": [{"id":"CTA_ID","title":"Book","value":"https://example.com/book"}]
}
}
slug, visible, display_address, address components, timezone, email, url, and social fields. location_type is a name or null; marker IDs are integers or null. Read cover_image_url for the cover, and send cover when writing it.
hours, filters, fields, and callsToAction are included on GET only when requested with their include flags. No schedule returns hours: null. A write response includes these relationships automatically.
Custom fields and calls to action are arrays in responses, even though writes use named objects. Location responses do not include created_at or updated_at.
Errors: 401 authentication, 403 access/permission, 404 inaccessible project or location, 429 rate limit. See errors.⌘I
curl --get 'https://storerocket.io/api/v2/projects/PROJECT_ID/locations/LOCATION_ID' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Accept: application/json' \
--data-urlencode 'includeHours=1' \
--data-urlencode 'includeFilters=1' \
--data-urlencode 'includeFields=1' \
--data-urlencode 'includeCallsToAction=1'
const token = process.env.STOREROCKET_TOKEN;
if (!token) throw new Error("Set STOREROCKET_TOKEN first.");
const projectId = "PROJECT_ID";
const locationId = "LOCATION_ID";
const url = new URL(`https://storerocket.io/api/v2/projects/${encodeURIComponent(projectId)}/locations/${encodeURIComponent(locationId)}`);
url.searchParams.set("includeHours", "1");
url.searchParams.set("includeFilters", "1");
url.searchParams.set("includeFields", "1");
url.searchParams.set("includeCallsToAction", "1");
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${token}`,
Accept: "application/json",
},
signal: AbortSignal.timeout(30_000),
});
const text = await response.text();
if (!response.ok) throw new Error(`HTTP ${response.status}: ${text}`);
console.log(JSON.parse(text));
<?php
$token = getenv("STOREROCKET_TOKEN") ?: throw new RuntimeException("Set STOREROCKET_TOKEN first.");
$projectId = "PROJECT_ID";
$locationId = "LOCATION_ID";
$url = 'https://storerocket.io/api/v2/projects/' . rawurlencode($projectId) . '/locations/' . rawurlencode($locationId);
$url .= "?" . http_build_query([
'includeHours' => 1,
'includeFilters' => 1,
'includeFields' => 1,
'includeCallsToAction' => 1,
], "", "&", PHP_QUERY_RFC3986);
$curl = curl_init($url);
curl_setopt_array($curl, [
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $token",
"Accept: application/json",
],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CONNECTTIMEOUT => 5,
CURLOPT_TIMEOUT => 30,
]);
$text = curl_exec($curl);
$error = curl_error($curl);
$status = (int) curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
if ($text === false) {
throw new RuntimeException("Request failed: $error");
}
if ($status < 200 || $status >= 300) {
throw new RuntimeException("HTTP $status: $text");
}
$data = json_decode($text, false, 512, JSON_THROW_ON_ERROR);
echo json_encode($data, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR), PHP_EOL;
{
"data": {
"id": "LOCATION_ID",
"name": "Downtown Store",
"address": "123 Main St, Seattle, WA 98101",
"city": "Seattle",
"postcode": "98101",
"phone": "555-0101",
"lat": 47.6062,
"lng": -122.3321,
"marker_id": null,
"marker_url": null,
"location_type": "Standard",
"cover_image_url": null,
"hours": {
"name": "Store hours",
"mon": "09:00-17:00",
"tue": "09:00-17:00",
"wed": "09:00-17:00",
"thu": "09:00-17:00",
"fri": "09:00-17:00",
"sat": "10:00-14:00",
"sun": "closed"
},
"filters": [],
"fields": [{"id":"FIELD_ID","name":"Manager","value":"Sam"}],
"callsToAction": [{"id":"CTA_ID","title":"Book","value":"https://example.com/book"}]
}
}