Skip to main content
ADMIN role required — This endpoint requires administrator privileges. Non-admin users will receive a 403 Forbidden error.

Endpoint

PUT /api/repair-request/{receipt_number}

Authentication

This endpoint requires a valid JWT Bearer token with ADMIN role.
Authorization: Bearer YOUR_JWT_TOKEN

Path Parameters

receipt_number
string
required
The unique receipt number of the repair request to update (e.g., RR-20260308143025123456789)

Request Body

Partial updates supported — Only the fields you want to update need to be included. The repair_status field is required.
article_serialnumber
string
Serial number of the article (optional, minimum 6 characters if provided)
article_accesories
string
Accessories included with the article (optional, minimum 3 characters if provided)
repair_status
string
required
Current status of the repair. Must be one of:
  • pending - Pending review
  • in_progress - Under repair
  • waiting_parts - Waiting for parts
  • completed - Repaired
  • delivered - Delivered to the client
  • canceled - Canceled
repair_details
string
Details about the repair work (optional, minimum 3 characters if provided)
repair_price
number
Price of the repair (optional, must be numeric)
repaired_at
string
Date when the repair was completed (optional, date format: YYYY-MM-DD)

Response

Returns the updated repair request with associated images.

Response Fields

success
boolean
required
Indicates if the request was successful
message
string
required
Success message
data
object
required

Examples

curl -X PUT https://api.yourservice.com/api/repair-request/RR-20260308143025123456789 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "repair_status": "completed",
    "repair_details": "LCD panel replaced successfully. All functionality tested.",
    "repair_price": 250.00,
    "repaired_at": "2026-03-10"
  }'

Response Example

{
  "success": true,
  "message": "Repair request updated successfully",
  "data": {
    "repairRequest": {
      "id": 1,
      "receipt_number": "RR-20260308143025123456789",
      "customer_name": "John Doe",
      "customer_phone": "+1234567890",
      "customer_email": "[email protected]",
      "article_name": "Laptop",
      "article_type": "Electronics",
      "article_brand": "Dell",
      "article_model": "XPS 15",
      "article_serialnumber": "SN123456",
      "article_accesories": "Charger, Case",
      "article_problem": "Screen not turning on",
      "repair_status": "completed",
      "repair_details": "LCD panel replaced successfully. All functionality tested.",
      "repair_price": "250.00",
      "received_at": "2026-03-08T00:00:00.000000Z",
      "repaired_at": "2026-03-10T00:00:00.000000Z",
      "images": [
        {
          "id": 1,
          "path": "repair_requests/repair_request_image_RR-20260308143025123456789_1.jpg",
          "imageable_type": "App\\Models\\RepairRequest",
          "imageable_id": "RR-20260308143025123456789"
        }
      ],
      "created_at": "2026-03-08T14:30:25.000000Z",
      "updated_at": "2026-03-10T15:45:30.000000Z",
      "deleted_at": null
    }
  }
}

Error Responses

401 Unauthorized

{
  "success": false,
  "message": "Unauthenticated"
}

403 Forbidden

Returned when the authenticated user does not have ADMIN role.
{
  "success": false,
  "message": "This action is unauthorized"
}

404 Not Found

Returned when the repair request with the specified receipt number does not exist.
{
  "success": false,
  "message": "Repair request not found"
}

422 Validation Error

Returned when the request data fails validation.
{
  "success": false,
  "message": "The given data was invalid",
  "errors": {
    "repair_status": [
      "The repair status field is required."
    ],
    "repair_price": [
      "The repair price must be a number."
    ],
    "article_serialnumber": [
      "The article serialnumber must be at least 6 characters."
    ]
  }
}

Notes

  • Customer information (name, phone, email) and article details (name, type, brand, model, problem) cannot be updated through this endpoint
  • Only the following fields can be updated:
    • article_serialnumber
    • article_accesories
    • repair_status (required)
    • repair_details
    • repair_price
    • repaired_at
  • The receipt_number in the URL is used to identify the repair request, not the database id
  • The updated_at timestamp is automatically updated
  • Images associated with the repair request are loaded but cannot be modified through this endpoint

Build docs developers (and LLMs) love