GET /customer/profile
Retrieve the authenticated customer’s profile.
Authentication
Requires Bearer token (auth:customer_api).
| Header | Value | Required |
|---|
| Authorization | Bearer | 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
| Status | Description |
|---|
| 401 | Customer not authenticated |
PATCH /customer/profile
Update the authenticated customer’s profile.
Authentication
Requires Bearer token (auth:customer_api).
| Header | Value | Required |
|---|
| Authorization | Bearer | Yes |
| Content-Type | application/json | Yes |
Body Parameters
| Parameter | Type | Required | Description |
|---|
| firstName | string | Yes | Customer first name |
| lastName | string | Yes | Customer last name |
| email | string | Yes | Customer 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
| Status | Description |
|---|
| 401 | Customer not authenticated |
| 422 | Validation 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).
| Header | Value | Required |
|---|
| Authorization | Bearer | 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.