GET /customer/profile
Retrieve the authenticated customer’s profile.Authentication
Requires Bearer token (auth:customer_api).
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer | Yes |
Example Request
curl "https://front.rmz.gg/api/customer/profile" \
-H "Authorization: Bearer 1|abc123xyz..."
const response = await fetch("https://front.rmz.gg/api/customer/profile", {
headers: { "Authorization": "Bearer 1|abc123xyz..." }
});
const data = await response.json();
response = requests.get("https://front.rmz.gg/api/customer/profile", headers={
"Authorization": "Bearer 1|abc123xyz..."
})
data = response.json()
$response = Http::withToken("1|abc123xyz...")->get("https://front.rmz.gg/api/customer/profile");
$data = $response->json();
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).
Headers
| 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 |
| 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"
}'
const response = await fetch("https://front.rmz.gg/api/customer/profile", {
method: "PATCH",
headers: {
"Authorization": "Bearer 1|abc123xyz...",
"Content-Type": "application/json"
},
body: JSON.stringify({
firstName: "Ahmed",
lastName: "Ali",
email: "ahmed.updated@example.com"
})
});
const data = await response.json();
response = requests.patch("https://front.rmz.gg/api/customer/profile",
headers={"Authorization": "Bearer 1|abc123xyz..."},
json={
"firstName": "Ahmed",
"lastName": "Ali",
"email": "ahmed.updated@example.com"
}
)
data = response.json()
$response = Http::withToken("1|abc123xyz...")->patch("https://front.rmz.gg/api/customer/profile", [
"firstName" => "Ahmed",
"lastName" => "Ali",
"email" => "ahmed.updated@example.com"
]);
$data = $response->json();
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).
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer | Yes |
Example Request
curl -X POST "https://front.rmz.gg/api/customer/logout" \
-H "Authorization: Bearer 1|abc123xyz..."
const response = await fetch("https://front.rmz.gg/api/customer/logout", {
method: "POST",
headers: { "Authorization": "Bearer 1|abc123xyz..." }
});
const data = await response.json();
response = requests.post("https://front.rmz.gg/api/customer/logout", headers={
"Authorization": "Bearer 1|abc123xyz..."
})
data = response.json()
$response = Http::withToken("1|abc123xyz...")->post("https://front.rmz.gg/api/customer/logout");
$data = $response->json();
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.

