> For the complete documentation index, see [llms.txt](https://developer.leaderos.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.leaderos.net/bazaar/player-storages.md).

# Player Storages

## Get user items storage

<mark style="color:blue;">`GET`</mark> `https://yourwebsite.com/api/bazaar/storages/<user_id>/items`

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

```json
[
    {
        "id": "4",
        "owner": "1",
        "serverID": "3",
        "itemID": "ENCHANTING_TABLE",
        "modelID": null,
        "name": "Enchanting Table",
        "lore": null,
        "amount": "1",
        "durability": "1",
        "maxDurability": "0",
        "enchantments": null,
        "base64": "rO0ABXNyABpvcmcuYnVra2l0LnV0aWwuaW8uV3JhcHBlcvJQR+zxEm8FAgABTAADbWFwdAAPTGph\r\ndmEvdXRpbC9NYXA7eHBzcgA1Y29tLmdvb2dsZS5jb21tb24uY29sbGVjdC5JbW11dGFibGVNYXAk\r\nU2VyaWFsaXplZEZvcm0AAAAAAAAAAAIAAlsABGtleXN0ABNbTGphdmEvbGFuZy9PYmplY3Q7WwAG\r\ndmFsdWVzcQB+AAR4cHVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAJ0AAI9\r\nPXQABHR5cGV1cQB+AAYAAAACdAAeb3JnLmJ1a2tpdC5pbnZlbnRvcnkuSXRlbVN0YWNrdAARRU5D\r\nSEFOVE1FTlRfVEFCTEU=\r\n",
        "description": null,
        "price": "0.00",
        "sold": "0",
        "creationDate": "2022-08-24 00:15:03"
    },
    {
        "id": "5",
        "owner": "1",
        "serverID": "3",
        "itemID": "BOOKSHELF",
        "modelID": null,
        "name": "Bookshelf",
        "lore": null,
        "amount": "32",
        "durability": "1",
        "maxDurability": "0",
        "enchantments": null,
        "base64": "rO0ABXNyABpvcmcuYnVra2l0LnV0aWwuaW8uV3JhcHBlcvJQR+zxEm8FAgABTAADbWFwdAAPTGph\r\ndmEvdXRpbC9NYXA7eHBzcgA1Y29tLmdvb2dsZS5jb21tb24uY29sbGVjdC5JbW11dGFibGVNYXAk\r\nU2VyaWFsaXplZEZvcm0AAAAAAAAAAAIAAlsABGtleXN0ABNbTGphdmEvbGFuZy9PYmplY3Q7WwAG\r\ndmFsdWVzcQB+AAR4cHVyABNbTGphdmEubGFuZy5PYmplY3Q7kM5YnxBzKWwCAAB4cAAAAAN0AAI9\r\nPXQABHR5cGV0AAZhbW91bnR1cQB+AAYAAAADdAAeb3JnLmJ1a2tpdC5pbnZlbnRvcnkuSXRlbVN0\r\nYWNrdAAJQk9PS1NIRUxGc3IAEWphdmEubGFuZy5JbnRlZ2VyEuKgpPeBhzgCAAFJAAV2YWx1ZXhy\r\nABBqYXZhLmxhbmcuTnVtYmVyhqyVHQuU4IsCAAB4cAAAACA=\r\n",
        "description": null,
        "price": "0.00",
        "sold": "0",
        "creationDate": "2022-08-24 00:17:37"
    }
]
```

{% endtab %}

{% tab title="404: Not Found User not found" %}

```json
{
    "status": false,
    "error": "USER_NOT_FOUND",
    "message": "User not found!"
}
```

{% endtab %}
{% endtabs %}

## Add items to user storage

<mark style="color:green;">`POST`</mark> `https://yourwebsite.com/api/bazaar/storages/<user_id>/items`

#### Request Body

| Name                                            | Type    | Description |
| ----------------------------------------------- | ------- | ----------- |
| serverID<mark style="color:red;">\*</mark>      | int     |             |
| itemID<mark style="color:red;">\*</mark>        | numeric |             |
| modelID                                         | numeric |             |
| name                                            | string  |             |
| lore                                            | string  |             |
| amount<mark style="color:red;">\*</mark>        | numeric |             |
| durability<mark style="color:red;">\*</mark>    | numeric |             |
| maxDurability<mark style="color:red;">\*</mark> | numeric |             |
| enchantments                                    | string  |             |
| base64<mark style="color:red;">\*</mark>        | string  |             |

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

```json
{
    "success": true
}
```

{% endtab %}

{% tab title="404: Not Found User not found" %}

```json
{
    "status": false,
    "error": "USER_NOT_FOUND",
    "message": "User not found!"
}
```

{% endtab %}

{% tab title="400: Bad Request Error while inserting data" %}

```json
{
    "status": false,
    "error": "INSERT_ERROR",
    "message": "Error while inserting data!"
}
```

{% endtab %}
{% endtabs %}

## Remove items to user storage

<mark style="color:red;">`DELETE`</mark> `https://yourwebsite.com/api/bazaar/storages/<user_id>/items/<id>`

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

```json
{
    "success": true
}
```

{% endtab %}

{% tab title="400: Bad Request Error while deleting data" %}

```json
{
    "status": false,
    "error": "DELETE_ERROR",
    "message": "Error while deleting data!"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://developer.leaderos.net/bazaar/player-storages.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
