Account
List projects
Find the public project IDs available to your account.
GET
/
api
/
v2
/
projects
curl 'https://storerocket.io/api/v2/projects' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Accept: application/json'
const token = process.env.STOREROCKET_TOKEN;
if (!token) throw new Error("Set STOREROCKET_TOKEN first.");
const url = new URL(`https://storerocket.io/api/v2/projects`);
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.");
$url = 'https://storerocket.io/api/v2/projects';
$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": "PROJECT_ID",
"name": "My Project",
"locations": 12,
"status": "active",
"plan": "Business"
}
]
}
Returns projects that the authenticated user belongs to. Use the returned
A successful request returns
id in location URLs.
JavaScript examples run in Node.js 22 or later; PHP examples require PHP 8.2 or later with cURL. Both read STOREROCKET_TOKEN from your environment. See the quickstart for setup.
curl 'https://storerocket.io/api/v2/projects' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Accept: application/json'
const token = process.env.STOREROCKET_TOKEN;
if (!token) throw new Error("Set STOREROCKET_TOKEN first.");
const url = new URL(`https://storerocket.io/api/v2/projects`);
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.");
$url = 'https://storerocket.io/api/v2/projects';
$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": "PROJECT_ID",
"name": "My Project",
"locations": 12,
"status": "active",
"plan": "Business"
}
]
}
200. An invalid token returns 401. Location operations additionally check API access for the selected project.⌘I
curl 'https://storerocket.io/api/v2/projects' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Accept: application/json'
const token = process.env.STOREROCKET_TOKEN;
if (!token) throw new Error("Set STOREROCKET_TOKEN first.");
const url = new URL(`https://storerocket.io/api/v2/projects`);
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.");
$url = 'https://storerocket.io/api/v2/projects';
$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": "PROJECT_ID",
"name": "My Project",
"locations": 12,
"status": "active",
"plan": "Business"
}
]
}