> For the complete documentation index, see [llms.txt](https://diviosx.gitbook.io/daily-random-shop/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://diviosx.gitbook.io/daily-random-shop/developers/api.md).

# API

All the events and methods of the plugin

## Add DailyShop to your plugin

Since i don't have a public repositoty yet, you can go ahead and download the free version jar and add the jarfile to your classpath.

## Get DailyShop Instance

```java
    @Override
    public void onEnable() {
    
        DailyShop api = DailyShop.getInstance();
        shopsManager manager = api.getShopsManager();
    
    }
```

## Events

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

```java
/**
* Event called when a new shop
* is created. Cannot be cancelled
**/
public void foo(CreatedShopEvent e) {

    dShop shop = e.getShop;
    Timestamp time = e.getTimestamp();

}


```

{% endtab %}

{% tab title="deletedShopEvent" %}

```java
/**
* Event called when a shop
* is deleted. Cannot be cancelled
**/
public void foo(deletedShopEvent e) {

    dShop shop = e.getShop;
    Timestamp time = e.getTimestamp();

}

```

{% endtab %}

{% tab title="reStockShopEvent" %}

```java
/**
* Event called when shop item's
* are updated.
**/
public void foo(reStockShopEvent e) {

    dShop shop = e.getShop;
    Timestamp time = e.getTimestamp();

}

```

{% endtab %}

{% tab title="updateItemEvent" %}

```java
/**
* Event called when an item
* of a certain shop is updated
**/
public void foo(deletedShopEvent e) {

    dShop shop = e.getShop;
    Timestamp time = e.getTimestamp();
    dItem item = e.getItem();            // The item updated
    updateType type = e.getType();       // UPDATE_ITEM, NEXT_AMOUNT, DELETE_ITEM

}

```

{% endtab %}
{% endtabs %}
