Skip to main content

Get All Stores

Retrieves a list of all stores in the system.

Response

Returns an array of store objects.
id
string
required
Unique identifier for the store
latitude
number
required
Geographic latitude coordinate of the store location
longitude
number
required
Geographic longitude coordinate of the store location
country
string
required
Country where the store is located
maxStockCapacity
integer
required
Maximum stock capacity of the store
expectedReturnRate
number
required
Expected return rate for products at this store (as a decimal)
remainingCapacity
integer
required
Current remaining capacity available at the store
demand
array
required
List of product items in demand
id
string
Unique identifier for the product item
productId
string
Product identifier
size
string
Product size
quantity
integer
Quantity demanded

Example Request

curl -X GET http://localhost:8080/api/stores

Example Response

[
  {
    "id": "STORE001",
    "latitude": 40.7128,
    "longitude": -74.0060,
    "country": "USA",
    "maxStockCapacity": 1000,
    "expectedReturnRate": 0.15,
    "remainingCapacity": 650,
    "demand": [
      {
        "id": "550e8400-e29b-41d4-a716-446655440001",
        "productId": "PROD001",
        "size": "M",
        "quantity": 50
      }
    ]
  }
]

Get Store By ID

Retrieves detailed information about a specific store.

Path Parameters

id
string
required
The unique identifier of the store to retrieve

Response

Returns a single store object with the same structure as shown in the Get All Stores endpoint.
id
string
required
Unique identifier for the store
latitude
number
required
Geographic latitude coordinate of the store location
longitude
number
required
Geographic longitude coordinate of the store location
country
string
required
Country where the store is located
maxStockCapacity
integer
required
Maximum stock capacity of the store
expectedReturnRate
number
required
Expected return rate for products at this store (as a decimal)
remainingCapacity
integer
required
Current remaining capacity available at the store
demand
array
required
List of product items in demand

Example Request

curl -X GET http://localhost:8080/api/stores/STORE001

Example Response

{
  "id": "STORE001",
  "latitude": 40.7128,
  "longitude": -74.0060,
  "country": "USA",
  "maxStockCapacity": 1000,
  "expectedReturnRate": 0.15,
  "remainingCapacity": 650,
  "demand": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440001",
      "productId": "PROD001",
      "size": "M",
      "quantity": 50
    }
  ]
}

Error Responses

Store Not Found (404)

Returned when the requested store ID does not exist.
{
  "error": "Store not found",
  "message": "Store with ID STORE001 does not exist"
}

Build docs developers (and LLMs) love