# Zid-api Library

Zid-themes library available as an asset file which has `zid.store` global object that can be accessed in any javascrip file or script tag. It provides multiple functions to make REST API calls, such as adding a product to cart, remove, update, fetch the customer address, and many other helper functions. To use it, add `zidapi_script` variable in the bottom of the `body tag` as follow (line 9):

```javascript
<body>

    <div class="app">
        {% block header %}{% endblock %}
        {% block main_content %}{% endblock %}
        {% block footer %}{% endblock %}
    </div>

    {{ zidapi_script|raw }} // initialize Zid Library
    
    <script type="text/javascript" src="{{ asset_url ~ 'main.js' }}"></script>
</body>
```

`zidapi_script` resources:

* [Product](/zid-api/product-api.md)
* [Category](/zid-api/category-api.md)
* [Cart](/zid-api/cart-api.md)
* [Blog](/zid-api/blog-api.md)
* [Customer](/zid-api/customer-api.md)
* [Settings](/zid-api/settings-api.md)


---

# 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://themes.zid.dev/zid-api.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.
