> For the complete documentation index, see [llms.txt](https://octotable-1.gitbook.io/octotable-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://octotable-1.gitbook.io/octotable-api/create-clients/quickstart.md).

# How to create clients

Client Creation and Authentication in the Octotable API

The OctoTable API allows users to create a client to begin integrating with our reservation system.

OctoTable APIs are primarily designed for software platforms that use a single client integration to connect with multiple independently authorized restaurants, rather than being limited to single-venue integrations.

\
⚠️  To use the Octotable APIs correctly, you need to [download Postman](https://www.postman.com/downloads/) and avoid using the desktop version.\
&#x20;To initiate this process, a minimum set of attributes is required:

* **Name**: The name of the property.
* **Email**: The email associated with the property.
* **Username:** The username associated with user of the the property.
* **Password:** The password of the user.
* **Redirect Uri:** The redirect uri of the company's web page

Once the `Create Client` call is made, the system generates a **Client ID** and **Client Secret**, which are crucial for the next step in the integration.

**Generating an Access Token**

Using the provided **Client ID** and **Client Secret**, you can perform the `Generate Access Token` call. This token serves as the key to accessing the full functionality of the API.

**Testing Environment**

When a client is created, Octotable automatically sets up a fake property for testing purposes. This allows you to experiment with and test the API's features before using it in a live environment.

**The client created through the Create Client API is a permanent client and does not need to be recreated when moving from Sandbox to Production. At the time the client is created, Octotable automatically creates a property for testing purposes using the same name as the client used for the integration.**

**The same API client can be used both to create a new structure in the Production environment and to associate existing real structures with the client. Therefore, there is no need to create a new client when moving to Production.**

**When you are ready to move from Sandbox to Production, please contact Octotable Support or your Octotable commercial representative. The client initially created and used for testing can then be enabled for Production and used with real properties and structures.**

With the access token, you can proceed to execute all other operations available in the Octotable API.\
\
**NOTE**\
The testing environment is available for a limited period, ensuring you have ample time to explore and familiarize yourself with the API's functionalities before transitioning to production.

⚙️ **Use the base resource URL** for the following examples, or [see complete collection](https://documenter.getpostman.com/view/50380496/2sB3dK1YWg#2fa66ba7-b915-4459-9e7c-67232d707994)

```
https://api.octotable.com/octotable-pms/api/v2
```

## 🆕 Create a new client

<mark style="color:yellow;">**`POST`**</mark> `/api-account/oauth2/client`

Creates a new oauth2 client

**Headers**

| Name           | Value              |
| -------------- | ------------------ |
| `Content-Type` | `application/json` |

**Body**

| Name           | Type   | Description                     |
| -------------- | ------ | ------------------------------- |
| `name`         | string | Name of the sandbox property    |
| `email`        | string | Email of the property           |
| `username`     | string | Username                        |
| `password`     | string | Password                        |
| `redirect_uri` | string | The redirect uri of the company |

**Request**

{% tabs %}
{% tab title="First Tab" %}

```json
curl --location 'https://api.octotable.com/octotable-auth/api/v2/api-account/oauth2/client'
--data-raw '{
    "redirect_uri": "http://localhost:8183/main-page",
    "sandbox_property": {
       "name": "Your Company SPA",
       "username": "yourcompany100@demo.com",
       "password": "yourCompany123!",
       "description": "A financial institution specializing in global banking",
       "email": "yourcompany1@demo.com",
       "website": "www.yourcmpany.com",
       "phone": "+1234567890",
       "position": {
           "latitude": 45.4442,
            "longitude": 9.9900,
            "country": "IT",
            "address": "Piazza, 33",
            "city": "Milan",
            "zip": "20154"
      }
   }
}'
```

{% endtab %}
{% endtabs %}

**Response**

{% tabs %}
{% tab title="200 OK" %}

```json
{
    "data": [
        {
            "client_id": "public_8956990355e6df036-b5ff-48cd-b8be-b3d93fb752",
            "client_secret": "12404a0a-9cbf-4b40-82cc-32296e92c515",
            "id": 124,
            "username": "yourcompany100@demo.com",
            "password": "yourCompany123!",
            "properties": [
                {
                    "enabled": true,
                    "id": 999641,
                    "name": "Your Company SPA",
                    "position": {},
                    "sandbox": true
                }
            ],
            "redirect_uri": "http://your-webdite:80/main-page"
        }
    ]
}
```

{% endtab %}
{% endtabs %}
