> For the complete documentation index, see [llms.txt](https://docs.mnasati.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mnasati.com/api-methods/authorization.md).

# Authorization

This method is used for authorizing the vendor and validating API access.

## Authorization

<mark style="color:green;">`POST`</mark> `https://sandbox.mnasati.com/v1/authorization`

This endpoint authorizes the vendor and returns all settings and information related to the vendor store.

#### Path Parameters

| Name     | Type   | Description                          |
| -------- | ------ | ------------------------------------ |
| e-Mail   | string | e-mail address of the vendor account |
| Password | string | Password of the vendor account.      |

#### Headers

| Name         | Type   | Description                                                          |
| ------------ | ------ | -------------------------------------------------------------------- |
| Content-Type | string | The Authentication token is to track down who is emptying our stocks |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{
   "status":true,
   "message":"Vendor autorization successfully.",
   "access_token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZW5kb3JfaWQiOiI0MyIsInVzZXJfaWQiOiI0MCIsInVzZXJfdHlwZSI6InZlbmRvciIsImVtYWlsIjoiemF6YUB1aWd0Yy5jb20iLCJpYXQiOjE2MjExNTc4NjcsImV4cCI6MTYyNjM0MTg2N30.H48knQdwQugrYDOCQW_flHmUZzRVNceiFM9OK8yWKq4",
   "expires_in":1626341867,
   "user_info":{
      "vendor_id":"43",
      "email":"zaza@uigtc.com",
      "address1":"vhyvuvuvu\r\n\r\n\r\n\r\n\r\nhvvuvujv\r\nchcgcghvhv\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\nتىعةعةعةعةعةعةهةهةهةهةهةهىهىهىهىهىهىهى\r\n",
      "web_page_title":"Zaza Restaurant",
      "details":"<p><span class=\"text-tiny\">test</span></p><h2><span class=\"text-tiny\">test</span></h2>\n",
      "phone":"96555329989",
      "country":"11",
      "country_name":"Qatar",
      "store_name":"Zaza Restaurant",
      "store_name_ar":"مطعم 5",
      "about_us":"<p><span class=\"text-tiny\">test</span></p><h2><span class=\"text-tiny\">test</span></h2>\n",
      "about_us_ar":"<p><span class=\"text-tiny\">test </span></p><p><span class=\"text-tiny\">test </span></p>\n",
      "address1_ar":"Test 33 45555\nعربي\n",
      "address2":null,
      "address2_ar":null,
      "currency_title":"QAR",
      "currency_title_ar":"ر.ق",
      "multi_country_delivery":"1",
      "delivery_countries":"1,10",
      "store_type":"selling",
      "time_zone":"Asia/Qatar",
      "schedule_interval":"45",
      "default_preparation_time":"180",
      "payment_methods":"11,6,5",
      "external_country_cash":"",
      "store_domain":"https://template2.gallarias.com",
      "has_fundnumber":"1",
      "conversion_rate":"12.0500",
      "country_tax":"7.00",
      "sms_status_update_customer":"1",
      "logo":"https://mnasatistorage.fra1.digitaloceanspaces.com/manastitesting/uploads/vendor_logo_image/43/logo_43_1619105062.png",
      "brand_limit":"50",
      "category_limit":"500",
      "catering_service":"1",
      "celebrity_module":"1",
      "change_all_delivery_status":"1",
      "default_image":"uploads/product_image/43/default_43_1608764420.jpg",
      "digital_products":"1",
      "dinein_booking":"1",
      "dinein_booking_limit":"2",
      "dinein_deposit_amount":"20",
      "driver_module":"1",
      "extras_inventory":"1",
      "free_delivery_amount":"",
      "fundnumber_label":"Fund Numer  2222",
      "fundnumber_label_ar":" 22222 رقم الصندوق",
      "fundnumber_mandatory":"0",
      "has_pos":"1",
      "has_tax":"0",
      "invoice_link_on":"1",
      "mashkor_auth_key":"s4DAzNvhimi9jG4XJ0bm0I0jk0jGAabT2Pp",
      "mashkor_secret_key":"PPS3966F952C9719",
      "mashkor_status":"1",
      "my_fatoorah_api_key":"",
      "products_inventory":"1",
      "product_comment_label":"test",
      "product_comment_label_ar":"test",
      "product_limit":"250",
      "product_preparation_time":"1",
      "product_weight":"1",
      "special_price_per_country":"1",
      "sub_category":"1",
      "suppliers_module":"1",
      "tax_number":"100",
      "template":"2",
      "vendorapp_product_management":"1",
      "default_image_url":"https://mnasatistorage.fra1.digitaloceanspaces.com/manastitesting/uploads/product_image/43/default_43_1608764420.jpg",
      "sub_user":0
   }
}
```

{% endtab %}

{% tab title="400 Access denied due to wrong parameters or invalid headers." %}

```
{"status":400,"error":400,"messages":{"status":false,"message":"Invalid Access!"}}
```

{% endtab %}
{% endtabs %}

#### Body

```json
{
  "email":"qa1@uigtc.com",
  "password":"Ni3@solanki"
}
```

#### Examples

{% tabs %}
{% tab title="Curl/Bash" %}

```bash
curl --location --request POST 'https://sandbox.mnasati.com/v1/authorization' \
--data-raw '{
  "email":"dania@mnasati.com",
  "password":"1234567Aa"
}'

```

{% endtab %}

{% tab title="Python" %}

```python
import http.client

conn = http.client.HTTPSConnection("sandbox.mnasati.com")

payload = "{\"email\":\"zaza@uigtc.com\",\"password\":\"Test123456789\"}"

headers = { 'Content-Type': "" }

conn.request("POST", "/v1/authorization", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sandbox.mnasati.com/v1/authorization',
  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 =>'{
  "email":"qa1@uigtc.com",
  "password":"Ni3@solanki"
}',
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
```

{% endtab %}

{% tab title="C#" %}

```csharp
var client = new RestClient("https://sandbox.mnasati.com/v1/authorization");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
var body = @"{" + "\n" +
@"  ""email"":""qa1@uigtc.com""," + "\n" +
@"  ""password"":""Ni3@solanki""" + "\n" +
@"}";
request.AddParameter("text/plain", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
```

{% endtab %}

{% tab title="Java" %}

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "{\n  \"email\":\"qa1@uigtc.com\",\n  \"password\":\"Ni3@solanki\"\n}");
Request request = new Request.Builder()
  .url("https://sandbox.mnasati.com/v1/authorization")
  .method("POST", body)
  .build();
Response response = client.newCall(request).execute();
```

{% endtab %}

{% tab title="Ruby" %}

```ruby
require 'uri'
require 'net/http'
require 'openssl'

url = URI("https://sandbox.mnasati.com/v1/authorization")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["Content-Type"] = ''
request.body = "{\"email\":\"zaza@uigtc.com\",\"password\":\"Test123456789\"}"

response = http.request(request)
puts response.read_body
```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
  "fmt"
  "strings"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://sandbox.mnasati.com/v1/authorization"
  method := "POST"

  payload := strings.NewReader(`{
  "email":"qa1@uigtc.com",
  "password":"Ni3@solanki"
}`)

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, payload)

  if err != nil {
    fmt.Println(err)
    return
  }
  res, err := client.Do(req)
  if err != nil {
    fmt.Println(err)
    return
  }
  defer res.Body.Close()

  body, err := ioutil.ReadAll(res.Body)
  if err != nil {
    fmt.Println(err)
    return
  }
  fmt.Println(string(body))
}
```

{% endtab %}

{% tab title="Swift" %}

```swift
import Foundation

let headers = ["Content-Type": ""]
let parameters = [
  "email": "zaza@uigtc.com",
  "password": "Test123456789"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://sandbox.mnasati.com/v1/authorization")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

{% endtab %}

{% tab title="jQuery" %}

```javascript
const settings = {
  "async": true,
  "crossDomain": true,
  "url": "https://sandbox.mnasati.com/v1/authorization",
  "method": "POST",
  "headers": {
    "Content-Type": ""
  },
  "processData": false,
  "data": "{\"email\":\"zaza@uigtc.com\",\"password\":\"Test123456789\"}"
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
```

{% endtab %}
{% endtabs %}
