Skip to main content

Create Review

curl -X POST https://your-domain.com/api/cliente/calificar \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "producto_id": 8,
    "pedido_id": 15,
    "estrellas": 5,
    "comentario": "Excelente producto, muy recomendado"
  }'
Creates a new review for a product. Customers can only review products from delivered orders.

Headers

Authorization
string
required
Bearer token for authentication

Body Parameters

producto_id
integer
required
ID of the product to review
pedido_id
integer
required
ID of the order containing the product
estrellas
integer
required
Rating from 1 to 5 stars
comentario
string
Review comment (max 255 characters)

Response

message
string
Success message: “Calificación guardada correctamente”

Error Responses

message
string
Error message when:
  • Already reviewed this product (403)
  • Product or order not found (422)
Customers can only review products from orders that belong to them.

Get My Reviews

curl -X GET https://your-domain.com/api/cliente/mis-calificaciones \
  -H "Authorization: Bearer {token}" \
  -H "Accept: application/json"
Retrieves all reviews created by the authenticated customer, ordered by most recent first.

Headers

Authorization
string
required
Bearer token for authentication

Response

calificaciones
array
Array of review objects

Update Review

curl -X PATCH https://your-domain.com/api/cliente/calificaciones/7 \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "estrellas": 4,
    "comentario": "Buen producto, actualizo mi reseña"
  }'
Updates an existing review. Only the review owner can update it.

Headers

Authorization
string
required
Bearer token for authentication

Path Parameters

id
integer
required
ID of the review to update

Body Parameters

estrellas
integer
required
Updated rating from 1 to 5 stars
comentario
string
Updated comment text

Response

message
string
Success message: “Reseña actualizada correctamente”

Error Responses

message
string
Error message when:
  • Review not found or doesn’t belong to user (404)
  • Invalid star rating (422)

Delete Review

curl -X DELETE https://your-domain.com/api/cliente/calificaciones/7 \
  -H "Authorization: Bearer {token}" \
  -H "Accept: application/json"
Deletes a review. Only the review owner can delete it.

Headers

Authorization
string
required
Bearer token for authentication

Path Parameters

id
integer
required
ID of the review to delete

Response

message
string
Success message: “Reseña eliminada correctamente”

Error Responses

message
string
Error message when review not found or doesn’t belong to user (404)

Get Product Reviews (Public)

curl -X GET https://your-domain.com/api/productos/8/calificaciones \
  -H "Accept: application/json"
Retrieves all reviews for a specific product. This endpoint is public and does not require authentication.

Path Parameters

id
integer
required
ID of the product

Response

calificaciones
array
Array of review objects ordered by most recent first
This endpoint does not expose sensitive user information, only the user’s ID and name.

Build docs developers (and LLMs) love