Get Authenticated Customer Profile
2/7/25Less than 1 minute
Description
The Get Authenticated Customer Profile API retrieves the details of the currently authenticated customer. This endpoint requires a valid JWT token and X-MerchantApiKey header.
Endpoint
GET /v1/customers/profile
Required Headers
{
"Authorization": "Bearer JWT_TOKEN",
"X-MerchantApiKey": "MERCHANT_API_KEY",
"Content-Type": "application/json"
}
Example API Call (Fetch or Axios)
fetch('https://api.shopsynch.com/v1/customers/profile', {
method: 'GET',
headers: {
"Authorization": "Bearer JWT_TOKEN",
"X-MerchantApiKey": "MERCHANT_API_KEY",
"Content-Type": "application/json"
}
})
.then(response => response.json())
.then(data => console.log(data));
📤 Sample 200 Response (Success)
{
"status": true,
"message": "User profile retrieved",
"data": {
"id": "67a5ff5cb6ac842d1241d096",
"email": "customer@yopmail.com",
"fullName": null,
"phoneNumber": null,
"address": null,
"role": {
"name": "Customer",
"slug": "customer",
"permissions": null
},
"tenantId": "YourTenantId"
}
}
❌ Sample 401 Response (Unauthorized)
{
"status": false,
"message": "Unauthorized. Missing or invalid token."
}