# Profile Screen

\
**Profile APIs**
----------------

The Profile APIs manage user profiles on the e-commerce platform, allowing users to view and update their personal information. These APIs handle profile details such as name, email, country, and language preferences.

<figure><img src="https://3686328336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fd1Iq7THDAagTQzeC9rTN%2Fuploads%2FkqztQvK8x3xPz1GJqM5p%2Fimage.png?alt=media&#x26;token=18885513-4b13-47ff-80a3-0afa17ed7480" alt=""><figcaption><p><strong>Profile apis</strong></p></figcaption></figure>

### **1. Get Profile API**&#x20;

The Get Profile API retrieves the user's profile information from the e-commerce platform.

### **Endpoint**

* `{{baseurl}}/api/v1/customer/profile`

### **Method**

* **GET**

### **Request Parameters:**

None

### **Request Body:**

None

### **Authorization:**

The API requires a bearer token in the request header for authentication. Users must include their valid bearer token in the "Authorization" header of the HTTP request to access their profile information.

### **Response Format:**

The API responds with a JSON object containing the user's profile details, including name, email, country ID, and language ID.

```json
{
    "status": true,
    "message": "User details",
    "data": {
        "user": {
            "id": 17,
            "name": "i1344",
            "phone": "+919633038429",
            "email": "shijus1995@gmail.com",
            "avatar": null,
            "is_guest": null,
            "status": 1,
            "firebase_id": 11,
            "default_shipping_address": null,
            "default_billing_address": null,
            "country_id": 10,
            "decimal":2,
            "lang_id": 1,
            "remember_token": null,
            "created_at": "2023-05-18T11:31:24.000000Z",
            "updated_at": "2023-08-04T15:11:00.000000Z",
            "deleted_at": null,
            "email_verified": 0,
            "email_token": 180984,
            "email_token_expire_at": "2023-08-04 20:51:00",
            "email_verified_at": "2023-08-04 17:17:40",
            "default_country": "IN",
            "currency_symbol": "₹",
            "symbol_position": "left",
            "default_language": "EN",
            "country_name": "India"
        }
    }
}
```

###

###

###

### **2. Update Profile API**&#x20;

The Update Profile API allows users to modify their profile information, such as name, email, country, and language preferences.

### **Endpoint**

* `{{baseurl}}/api/v1/customer/profile-update`

### **Method**

* **POST**

### **Request Parameters:**

None

### **Request Body:**

The request body should include the updated profile details, such as name, email, country ID, and language ID, as follows:

```json
jsonCopy code{
    "name": "Updated Name",
    "email": "updated_email@example.com",
    "country_id": "US",
    "language_id": "en"
}
```

### **Authorization:**

The API requires a bearer token in the request header for authentication. Users must include their valid bearer token in the "Authorization" header of the HTTP request to update their profile.

### **Response Format:**

The API responds with a JSON object indicating the status of the profile update request. If the email has been changed, the API may return a message indicating that email verification is required.

```json
{
    "status": true,
    "message": "Profile updation successfully completed",
    "data": {
        "user": {
            "id": 87,
            "name": "shiju s",
            "phone": "+919946210988",
            "email": null,
            "avatar": null,
            "is_guest": null,
            "status": 1,
            "firebase_id": 83,
            "default_shipping_address": null,
            "default_billing_address": null,
            "country_id": 10,
            "lang_id": 1,
            "remember_token": null,
            "created_at": "2023-07-27T05:13:29.000000Z",
            "updated_at": "2023-08-07T07:11:25.000000Z",
            "deleted_at": null,
            "email_verified": 0,
            "email_token": 236405,
            "email_token_expire_at": "2023-08-07T07:21:25.727863Z",
            "email_verified_at": null
        }
    }
}
```

### **Features:**

* The Get Profile API enables users to view their profile information, including name, email, country, and language preferences.
* The Update Profile API allows users to modify their profile details, such as name, email, country, and language preferences.
* If the email is changed during profile update, the API triggers an email verification process for added security.

### **Usage:**

* The Get Profile API is used to display the user's current profile details, providing a personalized experience.
* The Update Profile API is called when users want to update their profile information, such as changing the name or updating the email address.
