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

Endpoint

GET /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 (e.g., RR-20260308143025123456789)

Response

Returns the details of a specific repair request including associated images.

Response Fields

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

Examples

curl -X GET https://api.yourservice.com/api/repair-request/RR-20260308143025123456789 \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Accept: application/json"

Response Example

{
  "success": true,
  "message": "Repair request retrieved 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": "in_progress",
      "repair_details": "Replacing LCD panel",
      "repair_price": "250.00",
      "received_at": "2026-03-08T14:30:25.000000Z",
      "repaired_at": null,
      "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-08T14:30:25.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"
}

Notes

  • The receipt_number is used as the unique identifier, not the database id
  • Images are automatically loaded with the repair request
  • Route binding automatically handles model lookup by receipt number

Build docs developers (and LLMs) love