# Layout próprio

Por conta da nossa API desacoplada, é possível hospedar seu próprio layout e consumir nossa API de forma gratuita.

A autenticação da loja é feita pelo `x-hydrus-domain`, este cabeçalho indica de qual loja virá a informação.

Domínio para integração: `https://api.hydrus.gg`

***

## Obter informações gerais da loja

<mark style="color:blue;">`GET`</mark> `/shopping`

Esta rota retorna todos os dados básicos de uma loja, incluindo nome, categorias, variáveis

**Headers**

| Name            | Value            |
| --------------- | ---------------- |
| x-hydrus-domain | `{store.domain}` |

**Response**

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

```json
{
    "name": "Loja Exemplo",
    "variables": [
        {
            "id": 1,
            "name": "Discord",
            "type": "discord"
        },
        {
            "id": 2,
            "name": "User ID",
            "type": "user_id"
        }
    ],
    "categories": [
        {
            "id": 1,
            "store_id": 1,
            "name": "VIPS",
            "enabled": true,
            "page_size": 20,
            "weight": 3201,
            "deleted_at": null,
            "created_at": "2023-01-13T01:16:29.000000Z",
            "updated_at": "2024-02-02T23:48:17.000000Z",
            "visible": true,
            "packages_count": 14
        }
    ],
    "layout": {
        "theme": "darkocean",
        "logo": "https://storage.hydrus.gg/production/static/placeholder.png",
        "banner": "https://storage.hydrus.gg/production/static/placeholder.png",
        "icon": "https://storage.hydrus.gg/production/static/placeholder.png",
        "created_at": "2023-01-13T01:16:28.000000Z",
        "updated_at": "2024-03-31T02:56:58.000000Z",
        "body": "https://storage.hydrus.gg/production/static/placeholder.html",
        "styles_url": "https://storage.hydrus.gg/production/static/placeholder.css"
    },
    "currency": "BRL",
    "country": "BR",
    "terms_of_service": "https://storage.hydrus.gg/production/static/placeholder.txt",
    "require_address": false
}
```

{% endtab %}

{% tab title="404" %}

```json
{
  "message": "Entity Store not found"
}
```

{% endtab %}
{% endtabs %}

## Paginação de Produtos

<mark style="color:blue;">`GET`</mark> `/shopping/categories/{categoryId}/packages`

Esta rota retorna os produtos de uma categoria na página especificada.

**Headers**

| Name            | Value            |
| --------------- | ---------------- |
| x-hydrus-domain | `{store.domain}` |

**Search Params**

| Name   | Type   | Description |
| ------ | ------ | ----------- |
| `page` | number | Página      |

**Response**

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

```json
{
    "current_page": 1,
    "data": [
        {
            "id": 1,
            "name": "Produto Exemplo",
            "price": 29.99,
            "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse rhoncus diam nulla",
            // stock null indica um produto infinito
            // stock 0 indica que o estoque acabou
            "stock": null,
            "weight": 1,
            "images": [
                {
                    "id": 1,
                    "url": "https://storage.hydrus.gg/production/packages/placeholder.png"
                }
            ]
        }
    ],
    "first_page_url": "http://api.hydrus.gg/shopping/categories/1/packages?page=1",
    "from": 1,
    "to": 1,
    "last_page": 1,
    "last_page_url": "http://api.hydrus.gg/shopping/categories/1/packages?page=1",
    "links": [
        {
            "url": null,
            "label": "&laquo; Anterior",
            "active": false
        },
        {
            "url": "http://api.hydrus.gg/shopping/categories/1/packages?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "Próximo &raquo;",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "http://api.hydrus.gg/shopping/categories/1/packages",
    "per_page": 20,
    "prev_page_url": null,
    "total": 1
}
```

{% endtab %}

{% tab title="404" %}

```json
{
  "error": "Entity Category not found"
}
```

{% endtab %}
{% endtabs %}

## Busca de produtos

<mark style="color:blue;">`GET`</mark> `/shopping/packages/search`

Esta rota busca produtos utilizando palavras chaves como indexação

**Headers**

| Name            | Value            |
| --------------- | ---------------- |
| x-hydrus-domain | `{store.domain}` |

**Search Params**

| Name   | Type   | Description     |
| ------ | ------ | --------------- |
| `name` | string | Nome do produto |
| `page` | number | Página          |

**Response**

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

```json
{
    "current_page": 1,
    "data": [
        {
            "id": 1,
            "name": "Produto Exemplo",
            "price": 29.99,
            "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse rhoncus diam nulla",
            // stock null indica um produto infinito
            // stock 0 indica que o estoque acabou
            "stock": null,
            "weight": 1,
            "images": [
                {
                    "id": 1,
                    "url": "https://storage.hydrus.gg/production/packages/placeholder.png"
                }
            ]
        }
    ],
    "first_page_url": "http://api.hydrus.gg/shopping/packages/search?page=1",
    "from": 1,
    "to": 1,
    "last_page": 1,
    "last_page_url": "http://api.hydrus.gg/shopping/packages/search?page=1",
    "links": [
        {
            "url": null,
            "label": "&laquo; Anterior",
            "active": false
        },
        {
            "url": "http://api.hydrus.gg/shopping/packages/search?page=1",
            "label": "1",
            "active": true
        },
        {
            "url": null,
            "label": "Próximo &raquo;",
            "active": false
        }
    ],
    "next_page_url": null,
    "path": "http://api.hydrus.gg/shopping/packages/search",
    "per_page": 20,
    "prev_page_url": null,
    "total": 1
}
```

{% endtab %}

{% tab title="404" %}

```json
{
  "message": "Entity Store not found"
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Para realizar checkout, utilize o guia em [Fast Checkout](/pt-br/fast-checkout.md)
{% endhint %}


---

# 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.hydrus.gg/pt-br/layout-proprio.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.
