Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Emmanuel-Mtz-777/TechStore-Explorer/llms.txt

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

The Wishlist API lets authenticated users view, add, and remove products from their personal wishlist. Product data is sourced from the Platzi Fake Store API and stored locally in TechStore Explorer’s database. All three endpoints require a valid Laravel Sanctum Bearer token.
Every wishlist endpoint requires the Authorization: Bearer {token} header. Obtain a token by calling POST /api/login with valid credentials.

GET /api/wishlist

Returns all wishlist items belonging to the currently authenticated user. Each item includes the locally cached product details that were fetched from the Platzi Fake Store API at the time the product was added. Authentication: Required (auth:sanctum) Request body: None Success response — 200 OK
{
  "wishlist": [
    {
      "id": 1,
      "user_id": 2,
      "product_id": 5,
      "product_name": "Gaming Laptop",
      "product_image": "https://...",
      "product_price": 1299.99,
      "category_id": 3,
      "category_name": "Electronics",
      "created_at": "2024-01-01T12:00:00.000000Z",
      "updated_at": "2024-01-01T12:00:00.000000Z"
    }
  ]
}
wishlist
array
required
Array of wishlist item objects belonging to the authenticated user.
curl example
curl -s -X GET http://127.0.0.1:8000/api/wishlist \
  -H 'Authorization: Bearer {token}' \
  -H 'Accept: application/json'

POST /api/wishlist

Adds a product to the authenticated user’s wishlist. TechStore Explorer fetches the full product details from the Platzi Fake Store API (https://api.escuelajs.co/api/v1/products/{product_id}) and stores them locally so the wishlist remains populated even if the external API changes. After saving the record, a WishlistAddedMail notification is sent synchronously to the user’s email address via Mail::to(...)->send(...). Authentication: Required (auth:sanctum) Request body
product_id
integer
required
The numeric product ID from the Platzi Fake Store API. This value is used to fetch product details from https://api.escuelajs.co/api/v1/products/{product_id}.
Success response — 201 Created
{
  "message": "Producto agregado a wishlist",
  "wishlist": {
    "id": 4,
    "user_id": 2,
    "product_id": 5,
    "product_name": "Gaming Laptop",
    "product_image": "https://...",
    "product_price": 1299.99,
    "category_id": 3,
    "category_name": "Electronics",
    "created_at": "2024-01-01T12:00:00.000000Z",
    "updated_at": "2024-01-01T12:00:00.000000Z"
  }
}
message
string
Human-readable confirmation string: "Producto agregado a wishlist".
wishlist
object
The newly created wishlist record. Contains the same fields as described in the GET /api/wishlist response above.
curl example
curl -s -X POST http://127.0.0.1:8000/api/wishlist \
  -H 'Authorization: Bearer {token}' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{"product_id": 5}'

DELETE /api/wishlist

Removes a product from the authenticated user’s wishlist by matching the user_id and the supplied product_id. After deletion, a WishlistDeletedMail notification is sent synchronously to the user’s email address. Authentication: Required (auth:sanctum) Request body
product_id
integer
required
The ID of the product to remove from the wishlist. Must match a product that is currently in the authenticated user’s wishlist.
Success response — 200 OK
{
  "message": "Producto eliminado de wishlist"
}
message
string
Human-readable confirmation string: "Producto eliminado de wishlist".
curl example
curl -s -X DELETE http://127.0.0.1:8000/api/wishlist \
  -H 'Authorization: Bearer {token}' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{"product_id": 5}'

Build docs developers (and LLMs) love