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

Endpoint

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

Response

Returns a success message confirming the deletion.

Response Fields

success
boolean
required
Indicates if the request was successful
message
string
required
Success message confirming the deletion

Examples

curl -X DELETE 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 deleted successfully"
}

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"
}

500 Internal Server Error

Returned when there’s an error during the deletion process.
{
  "success": false,
  "message": "Repair request deletion failed",
  "errors": {
    "exception": "Error message details"
  }
}

Notes

  • This endpoint performs a soft delete — the record is marked as deleted but not permanently removed from the database
  • The deleted_at timestamp is set to the current date and time
  • Associated images are also deleted from both storage and the database
  • The deletion operation is wrapped in a database transaction to ensure data integrity
  • If the transaction fails (e.g., image deletion error), all changes are rolled back
  • Soft-deleted repair requests will not appear in list or get endpoints
  • The receipt_number is used to identify the repair request, not the database id

Build docs developers (and LLMs) love