# Register via Firebase

## Register API with Firebase Token&#x20;

The Register API with Firebase Token allows users to create an account within the e-commerce application using their Firebase authentication token. The API securely processes the Firebase token to validate the user's identity and grant access to the registration process. The API also requires users to provide a mandatory name field and an optional email field. If the user provides an email address, the API initiates an OTP verification process to validate the authenticity of the email.

<figure><img src="https://3686328336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fd1Iq7THDAagTQzeC9rTN%2Fuploads%2FgtxeqAHXIDnTCGr9JVmd%2Fimage.png?alt=media&#x26;token=87e7c276-bae2-4e77-af25-206e345748a1" alt=""><figcaption><p><strong>Register interface</strong></p></figcaption></figure>

### Endpoint

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

### Method

* POST

### Request Parameters

* None

### **Request Body:**

```json
{
  "name": "name_examble"
  "email": "email@examble.com"
  "country_id": "countryid_examble"
  
}
```

### Response Format

The API responds with a JSON object containing the registration status and, if applicable, an OTP verification status.

```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-04T09:29:12.000000Z",
            "deleted_at": null,
            "email_verified": 0,
            "email_token": 649169,
            "email_token_expire_at": "2023-08-04T09:39:12.024361Z",
            "email_verified_at": null
        }
    }
}
```

### **Authorization**&#x20;

The API requires a valid Bearer token in the request headers to authorize the user.

### Features

* **User Registration**: The API facilitates user registration, creating an account for users within the e-commerce application.
* **Firebase Token Validation**: The API validates the authenticity and integrity of the Firebase token to ensure secure user identification.
* **Optional Email**: The API allows users to provide an email address, but it is not mandatory for account creation.
* **Email Verification**: If the user provides an email address, the API initiates an OTP verification process to ensure the email's authenticity.
