Skip to main content

GET /customer/profile

Retrieve the authenticated customer’s profile.

Authentication

Requires Bearer token (auth:customer_api).

Headers

HeaderValueRequired
AuthorizationBearer Yes

Example Request

curl "https://front.rmz.gg/api/customer/profile" \
  -H "Authorization: Bearer 1|abc123xyz..."

Response

Success (200)

{
  "success": true,
  "data": {
    "id": 123,
    "first_name": "Ahmed",
    "last_name": "Ali",
    "full_name": "Ahmed Ali",
    "email": "ahmed@example.com",
    "phone": "501234567",
    "country_code": "966",
    "full_phone": "+966501234567",
    "avatar": null,
    "is_banned": false,
    "created_at": "2024-06-01T00:00:00.000000Z",
    "updated_at": "2024-06-15T10:30:00.000000Z"
  }
}

Error Responses

StatusDescription
401Customer not authenticated

PATCH /customer/profile

Update the authenticated customer’s profile.

Authentication

Requires Bearer token (auth:customer_api).

Headers

HeaderValueRequired
AuthorizationBearer Yes
Content-Typeapplication/jsonYes

Body Parameters

ParameterTypeRequiredDescription
firstNamestringYesCustomer first name
lastNamestringYesCustomer last name
emailstringYesCustomer email (must be unique per store)

Example Request

curl -X PATCH "https://front.rmz.gg/api/customer/profile" \
  -H "Authorization: Bearer 1|abc123xyz..." \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Ahmed",
    "lastName": "Ali",
    "email": "ahmed.updated@example.com"
  }'

Response

Success (200)

{
  "success": true,
  "data": {
    "id": 123,
    "first_name": "Ahmed",
    "last_name": "Ali",
    "full_name": "Ahmed Ali",
    "email": "ahmed.updated@example.com",
    "phone": "501234567",
    "country_code": "966",
    "full_phone": "+966501234567",
    "avatar": null,
    "is_banned": false,
    "created_at": "2024-06-01T00:00:00.000000Z",
    "updated_at": "2024-06-15T12:00:00.000000Z"
  },
  "message": "Profile updated successfully"
}

Error Responses

StatusDescription
401Customer not authenticated
422Validation error (email already in use, missing required fields)

POST /customer/logout

Revoke the current access token and log out.

Authentication

Requires Bearer token (auth:customer_api).

Headers

HeaderValueRequired
AuthorizationBearer Yes

Example Request

curl -X POST "https://front.rmz.gg/api/customer/logout" \
  -H "Authorization: Bearer 1|abc123xyz..."

Response

Success (200)

{
  "success": true,
  "data": null,
  "message": "Logged out successfully"
}
After logging out, discard the Bearer token on the client side. The token is permanently revoked and cannot be reused.