# JavaScript API

{% hint style="info" %}
The documentation below describes the API as of version 9.x of the script.&#x20;
{% endhint %}

## Documentation

* [Functions](/discount-ninja-developer-hub/storefront-api/promotion-engine/javascript-api/functions.md): documents all properties and functions available in the public API
* [Events](/discount-ninja-developer-hub/storefront-api/promotion-engine/javascript-api/events.md): documents the events published and subscribed to by the Price Rule Engine
* [Objects](/discount-ninja-developer-hub/storefront-api/promotion-engine/javascript-api/objects.md): documents the objects returned by the functions and properties


---

# 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://developers.discountninja.io/discount-ninja-developer-hub/storefront-api/promotion-engine/javascript-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.
