Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ricpalomino/spring-boot/llms.txt

Use this file to discover all available pages before exploring further.

The get-by-ID endpoint retrieves a single product from the in-memory store using its numeric identifier. If the provided ID does not match any existing product, the API returns a 404 response with data set to null.

Path parameters

id
integer
required
The numeric ID of the product to retrieve. Must be a positive integer that corresponds to an existing product.

Request

curl --request GET \
  --url http://localhost:8080/api/v1/products/1

Response fields

responseCode
string
HTTP status code as a string (e.g., "200", "404").
responseMessage
string
Human-readable message describing the result.
data
object | null
The matched product object, or null when the product is not found.

Success response — 200

{
  "responseCode": "200",
  "responseMessage": "Producto obtenido correctamente",
  "data": {
    "id": 1,
    "name": "Laptop Pro 15",
    "price": 1299.99
  }
}

Not found response — 404

Returned when no product with the given ID exists in the store.
{
  "responseCode": "404",
  "responseMessage": "Producto no encontrado con id: 99",
  "data": null
}

Build docs developers (and LLMs) love