Skip to main content

REST API: Common Errors and How to Fix Them

Troubleshooting guide for 422, 401, and 404 errors when using the StoreRocket REST API.

Updated yesterday

If you're using the StoreRocket REST API to manage locations programmatically, here are the most common errors you'll run into and how to fix them.

API access requires the Business plan. You can generate API tokens from your API Tokens page.

422 Unprocessable Entity

A 422 means StoreRocket understood your request but the data didn't pass validation. Common causes:

Hours format wrong

Hours must be in 24-hour format: 09:00-17:00. Not 9am-5pm, not 9:00 AM - 5:00 PM. Use closed for days the store is closed.

{
  "monday": "09:00-17:00",
  "tuesday": "09:00-17:00",
  "saturday": "closed"
}

Missing required fields

At minimum, a location needs a name and an address. Either provide full_address or the split fields (address_line_1, city, state, postcode, country).

Invalid field values

Check that numeric fields are numbers, not strings. Check that latitude and longitude are valid coordinates (latitude: -90 to 90, longitude: -180 to 180).

401 Unauthorized

Your API token is missing or invalid.

Fix: Make sure you're including the Authorization: Bearer YOUR_TOKEN header in every request. Generate a new token from the API Tokens page if needed.

404 Not Found

The location or resource doesn't exist, or you're using the wrong endpoint.

Fix: Double check the URL and the location ID. Make sure you're using the correct API version (/api/v1/ or /api/v2/).

429 Too Many Requests

You've hit the rate limit. Slow down your requests and add a small delay between API calls.

Location created but not showing on map

If you create a location via API and it doesn't appear on the map:

  1. Check geocoding: If you didn't provide latitude/longitude, StoreRocket geocodes the address in the background. Give it a minute.

  2. Check visibility: Make sure the location's visible field is set to true (or 1).

  3. Check the address: If the address couldn't be geocoded, the location is automatically hidden. Provide valid lat/lng coordinates to bypass geocoding.

Full address not updating after address change

When you update an address via API, the full_address field is regenerated from the individual address components. If you only update city but not address_line_1, the full address will still contain the old street. Update all relevant fields together.

Also note: after updating an address, StoreRocket will re-geocode the location. The old coordinates are replaced with new ones based on the updated address.

API documentation

For the full API reference, check the REST API article or contact us on live chat for specific endpoint questions.

Questions? Hit us up on live chat.

Did this answer your question?