# API Authentification

To authenticate with Gigastore backend, please use the credentials provided when logging in to your Gigastore account.&#x20;

{% hint style="info" %}
API credentials and inventory are bound to the Gigastore login. \
Make sure to use the same login to create credentials and manage your inventory.
{% endhint %}

The credentials are **Client ID** and **Client Secret**, which can be found in the[ API section ](https://dent.giga.store/#/api)of the Gigastore portal.&#x20;

<figure><img src="/files/k3MxvoSJwNmM66slj0a3" alt="" width="563"><figcaption></figcaption></figure>

&#x20;Use the `/reseller/authenticate` endpoint with [Basic Authorization](https://en.wikipedia.org/wiki/Basic_access_authentication) using your **Client ID** as username and **Client Secret** as password to retrieve the accessToken.&#x20;

The snippet below can be generated by following the **"First Steps"** in the Gigastore API portal, or the base64 value needs to be calculated on your side.

```
curl --location --request POST 'https://api.giga.store/reseller/authenticate'
--header 'Authorization: Basic base64(<clientid>:<clientsecret>)'

Response:
{
    "accessToken": "eyJhbGciOiJSUzI1NiIsInR5c..._very.long_string",
    "expiresIn": 86400,
    "refreshToken": null,
    "refreshExpiresIn": 0,
    "tokenType": "Bearer",
    "idToken": null
}
```

Now, you can use the **accessToken** in your header as **Authorization Bearer** for other API calls needing authentification.

```
curl --location --request GET 'https://api.giga.store/gigastore/products/inventory' \
--header 'Authorization: Bearer eyJhbGciO...YOUR_ACCESS_TOKEN...

Response:
{
    // your inventory
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.giga.store/api/api-authentification.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
