Skip to content

Products API

Manage products and warranties.

List Products

GET /api/products

Get all products for the authenticated user.

Request:

http
GET /api/products HTTP/1.1
Authorization: Bearer YOUR_TOKEN

Response (200 OK):

json
[
  {
    "id": 1,
    "name": "iPhone 15 Pro",
    "brand": "Apple",
    "category": "Electronics",
    "store": "Apple Store",
    "purchaseDate": "2024-01-15T00:00:00+00:00",
    "warrantyPeriodMonths": 12,
    "warrantyStatus": "active",
    "warrantyExpiresAt": "2025-01-15T00:00:00+00:00",
    "hasActiveClaim": false
  }
]

Create Product

POST /api/products

Create a new product with warranty information.

Request:

http
POST /api/products HTTP/1.1
Authorization: Bearer YOUR_TOKEN
Content-Type: application/json

{
  "name": "iPhone 15 Pro",
  "brand": "Apple",
  "category": "Electronics",
  "store": "Apple Store",
  "purchaseDate": "2024-01-15",
  "warrantyPeriodMonths": 12,
  "price": 1199.00,
  "serialNumber": "ABC123XYZ"
}

Response (201 Created):

json
{
  "id": 1,
  "name": "iPhone 15 Pro",
  "warrantyStatus": "active",
  "warrantyExpiresAt": "2025-01-15T00:00:00+00:00"
}

Get Product

GET /api/products/{id}

Get a specific product.

Response (200 OK):

json
{
  "id": 1,
  "name": "iPhone 15 Pro",
  "brand": "Apple",
  "receipts": [
    {
      "id": 1,
      "fileName": "receipt_abc123.pdf",
      "fileType": "pdf"
    }
  ],
  "claims": []
}

Update Product

PUT /api/products/{id}

Update product details.

Delete Product

DELETE /api/products/{id}

Delete a product and all associated data.

MyWarranties - Warranty Management System