# Authenticate

Authenticate User

## Endpoint => /user/authenticate

<mark style="color:green;">`POST`</mark> `/`user/`authenticate`

An admin credentials will be created and shared with you once your organization has been onboarded on our portal and all KYC activities has been.

#### Request Body

| Name                                       | Type   | Description   |
| ------------------------------------------ | ------ | ------------- |
| user\_id<mark style="color:red;">\*</mark> | String | User Id       |
| password<mark style="color:red;">\*</mark> | String | User Password |

{% tabs %}
{% tab title="200 Success" %}
{% code fullWidth="true" %}

```javascript
{
  "status": "Success",
  "description": "Login Successfull",
  "authDetails": {
    "authToken": "PBKWY4APEAQD83FBU9GZK37NGH11SUNH-168",
    "expireToken": "2023-01-27 05:06:08"
  },
  "userDetails": {
    "userID": "G-4568-3493",
    "Full Name": "King One Admin",
    "Username": "kingOneAdmin"
  },
  "orgDetails": {
    "secret-key": "T2Y629UUeiwe7fjdj838934ooosoi82398297297482992",
    "Org Full Name": "King One Enterprise"
  }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

<pre class="language-php" data-full-width="false"><code class="lang-php"><strong>&#x3C;?php
</strong>
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://apisandbox.fezdelivery.co/v1/user/authenticate',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS =>'{
    "user_id": "G-4568-3493",
    "password":"KingOne123#"
}',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

</code></pre>

{% hint style="info" %}
**Good to know:** Upon a successful login, the API returns the user details and the authentication details which contain your bearer token and the token's expiry date.

Please use the bearer token when making calls to other method. Also, please include secret-key in your header. The secret key identify your organization
{% endhint %}
