> For the complete documentation index, see [llms.txt](https://developer.gotadi.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.gotadi.com/english/b2b2c-partner/api-method/login-api.md).

# Login API

```
POST: /api/partner/login
```

Create a new session for the user

{% hint style="info" %}
Security requirements: Encrypt data and include a digital signature
{% endhint %}

#### Request Body <a href="#request-body" id="request-body"></a>

<details>

<summary>Model</summary>

* key (string, required),

  Key decrypts (encrypted) data. How to establish refer to the section: Encryption of transmitted data and authentication of digital signature
* data (string, required),

  Data with electronic signature (encrypted). How to decrypt refer to the section: Encryption of transmitted data and authentication of digital signature

  *Signature data schema:*

  ```
  <access_code>|<user_id>|<layout>|<product>
  ```

  *Original data schema:*

  ```
  <access_code>|<user_id>|<layout>|<product>|<signature>
  ```

  * access\_code (String, required)

    Access code provided by Gotadi to Partners.
  * user\_id (String, required)

    User identifier on the Partner’s system.
  * layout (String, optional)

    The value is dual or single corresponding to 2 types of layout Gotadi provides to partners.
  * product (String, required)
    * The value is flight or hotel. Corresponding to 2 products Gotadi provided to partners.
    * When the layout is single: Used to select the display service on the webview.
    * When the layout is dual: Used to focus the service displayed on the webview.

</details>

#### Response <a href="#response" id="response"></a>

**Code 200**

> OK

<details>

<summary>Model</summary>

* key (String, required)

  Key decrypts (encrypted) data. How to establish refer to the section: Encryption of transmitted data and authentication of digital signature
* data (String, required)

  Data with electronic signature (encrypted). How to decrypt refer to the section: Encryption of transmitted data and authentication of digital signature

  *Signature data schema:*

  ```
  <access_code>|<error_code>|<redirect_url>
  ```

  *Original data schema:*

  ```
  <access_code>|<error_code>|<redirect_url>|<signature>
  ```

  * access\_code (String, required)

    Access code provided by Gotadi to Partners.
  * error\_code (String, required)

    [Error code](https://developer.gotadi.com/dev-guide-en/agency-partner/integration-documentation/#error-code)
  * redirect\_url (String, optional)

    Link to Gotadi Webview with jwtToken included.

    ```
    https://<gotadi_webview_url>?access_token=<jwtToken>
    ```

</details>
