Skip to main content

How to use the REST API

Manage your StoreRocket locations programmatically using our REST API.

The REST API lets you create, read, update, and delete locations programmatically. It's available on the Business plan.

Getting your API token

  1. Go to API Tokens in your dashboard

  2. Click Create Token

  3. Copy it and store it securely. You won't be able to see it again.

Your token is tied to your account and gives access to all projects under it.

Full API documentation

The complete API reference with all endpoints, parameters, and example requests is here:

The reference includes request examples you can copy and run against your own account.

Quick start

All API requests go to https://storerocket.io/api/v2/. Include your token and request JSON responses with these headers:

Authorization: Bearer YOUR_API_TOKEN
Accept: application/json

V2 API errors always return JSON with the HTTP status and field details, including when Accept is omitted. For requests with a JSON body, also send Content-Type: application/json.

Here's a quick example to list all your projects:

curl https://storerocket.io/api/v2/projects \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json"

And to list all locations in a project:

curl https://storerocket.io/api/v2/projects/{PROJECT_ID}/locations \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json"

Replace {PROJECT_ID} with your project's ID, which you can find in the dashboard URL or by calling the projects endpoint above.

What you can do

  • Projects — list all projects under your account

  • Locations — list, create, update, and delete locations within a project

StoreRocket can geocode a location when coordinates are missing. You can also supply valid latitude and longitude directly.

Update only the fields you want to change

Use PATCH /api/v2/projects/{PROJECT_ID}/locations/{LOCATION_ID} to update an existing location. Your token needs the location:update permission.

curl -X PATCH https://storerocket.io/api/v2/projects/{PROJECT_ID}/locations/{LOCATION_ID} \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"phone":"555-0101"}'

This changes only the phone number. You do not need to resend the name, city, opening hours, filters, marker, or custom fields. Fields you leave out keep their existing values.

A successful update returns HTTP 200 and the updated location. Invalid input returns HTTP 422 with field errors and does not save any part of the update.

Locations without opening hours

Coming-soon locations can have no hours. When creating a location with POST, or updating with PUT or PATCH, omit hours or send "hours": {}. An empty hours object leaves an existing schedule unchanged and does not create a schedule for a new location.

With PATCH, you can also update individual days:

{
"hours": {
"mon": "09:00-17:00"
}
}

The other days keep their saved values. If the location has no schedule yet, unspecified days remain unset. Short day names (mon, tue, wed, thu, fri, sat, sun) and full weekday names are accepted.

To remove the entire schedule, send {"hours": null} with PATCH. To clear one day, send {"hours": {"mon": null}}. Use closed only when the location is actually closed that day. Send an object for hours, rather than an array such as [].

Other PATCH fields

  • Omitted fields stay unchanged. To clear phone, a social profile, or cover, send null.

  • name, city, and visible cannot be null. A supplied name or city must not be empty. false visibility and zero coordinates are valid values.

  • fields and callsToAction are named key-value objects. Supplied keys are added or updated, omitted keys stay attached, and a null value removes that key. An empty object does nothing; null for the whole object removes all entries from the location.

  • filters replaces the location's filter list. Use [] or null to clear it, or omit it to preserve it. A comma-separated string is also accepted.

  • location_type must name a type in the project, and marker_id must identify a marker in the project. Omit them to keep the current choices, or send null to restore the project defaults.

  • Address and display-address generation, and slug handling, retain the existing behavior. Clearing a generated address can regenerate it from the saved address components.

  • Use public API field names. Internal database fields such as project_id and location_type_id are ignored.

POST creates a location and PUT retains its existing update behavior. Both still require name and city. A nonempty hours object sent with POST or PUT must include all seven days; use PATCH for a partial week. With PUT, supplied fields and callsToAction objects replace their respective attachments, and omitted marker or location-type selections use the project defaults.

Rate limits

API requests are rate-limited to prevent abuse. If you hit the limit, you'll get a 429 response. Wait a moment and try again.

Need help?

If you run into any issues or have questions about a specific endpoint, message us on live chat and we'll help you out.

Did this answer your question?