Appearance
Claims API
Manage warranty claims.
List Claims
GET /api/claims
Get all claims for the authenticated user.
Response:
json
[
{
"id": 1,
"type": "claim",
"productId": 1,
"productName": "iPhone 15 Pro",
"productBrand": "Apple",
"customerId": 1,
"customerEmail": "customer@example.com",
"status": "open",
"description": "Screen not working",
"createdAt": "2024-01-20T10:30:00+00:00",
"messageCount": 3
}
]Create Claim
POST /api/claims
Create a warranty claim for a product.
Request:
json
{
"productId": 1,
"description": "The screen suddenly stopped responding to touch"
}Response (201 Created):
json
{
"id": 1,
"status": "open",
"productName": "iPhone 15 Pro",
"createdAt": "2024-01-20T10:30:00+00:00"
}Get Claim Details
GET /api/claims/{id}
Get detailed claim information including messages.
Response:
json
{
"id": 1,
"status": "in_progress",
"description": "Screen not working",
"product": {
"id": 1,
"name": "iPhone 15 Pro",
"brand": "Apple"
},
"customerId": 1,
"supplierId": 2,
"messages": [
{
"id": 1,
"senderId": 1,
"message": "The screen stopped working",
"createdAt": "2024-01-20T10:30:00+00:00"
}
]
}Close Claim
POST /api/claims/{id}/close
Close a resolved claim.
Response (200 OK):
json
{
"id": 1,
"status": "closed"
}Claim Statuses
| Status | Description |
|---|---|
open | Claim created, waiting for supplier |
in_progress | Supplier is handling the claim |
resolved | Issue has been resolved |
closed | Claim is closed |
