create
POST
/api/v1/accounts/:account_id/locations
Create a location
Creates a new physical location for the store. The provided address is automatically geocoded to latitude and longitude coordinates in the background.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
account_id
|
Must be a Integer | Required |
Parent store ID |
location
|
Must be a Hash | Required |
Location attributes |
location[name]
|
Must be a String | Required |
Location name (e.g. ‘High Street Branch’) |
location[address]
|
Must be a String | Required |
Full street address – automatically geocoded to lat/lng |
Error Codes
| Code | Description |
|---|---|
401
|
Unauthorized – invalid or missing API token |
404
|
Store not found or not accessible |
422
|
Validation failed – check the `errors` object for details |
Returns
Code: 201
The newly created location object
| Name | Type | Required | Description |
|---|---|---|---|
id
|
Must be a Integer | Required |
Unique location ID |
account_id
|
Must be a Integer | Required |
Parent store ID |
name
|
Must be a String | Required |
Location name (e.g. ‘Downtown Branch’) |
address
|
Must be a String | Required |
Full street address |
latitude
|
Must be a Float | Required |
Geocoded latitude (auto-derived from address) (nil allowed) |
longitude
|
Must be a Float | Required |
Geocoded longitude (auto-derived from address) (nil allowed) |
created_at
|
Must be a String | Required |
ISO 8601 creation timestamp |
updated_at
|
Must be a String | Required |
ISO 8601 last-update timestamp |