# Shop

## GetFreeDailyReward

**Purpose:** Grant a daily free reward to a player.

**URL:**

```
https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Shop/GetFreeDailyReward  
```

**Method:** POST

**Request Parameters (JSON body):**

* `FunctionParameters` (object):
  * `ItemID` (string): The ID of the item to grant as the free daily reward.

**Responses:**

* **200 OK:** Daily reward granted successfully. Returns the granted reward details.
* **400 Bad Request:** Invalid request parameters or the item ID is null. Returns an error message.

**Example Usage:**

**Request:**

```javascript
fetch('https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Shop/GetFreeDailyReward', {    
    method: 'POST',    
    headers: {    
        'Content-Type': 'application/json'    
    },    
    body: JSON.stringify({    
        FunctionParameters: {    
            ItemID: 'example-item-id'    
        }    
    })    
})    
.then(response => response.json())    
.then(data => console.log(data))    
.catch(error => console.error('Error:', error));  
```

**Response:**

```json
{  
    "Message": "SUCCESS",  
    "FunctionName": "ShopSystem_GetFreeDailyRewardFromID"  
}  
```

## BuyItemSpecialOffer

**Purpose:** Allows a player to buy a special offer item using virtual currency.

**URL:**

```
https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Shop/BuyItemSpecialOffer  
```

**Method:** POST

**Request Parameters (JSON body):**

* `FunctionParameters` (object):
  * `ItemID` (string): The ID of the special offer item to purchase.

**Responses:**

* **200 OK:** Item purchased successfully. Returns the purchase details.
* **400 Bad Request:** Invalid request parameters or the item ID is null. Returns an error message.

**Example Usage:**

**Request:**

```javascript
fetch('https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Shop/BuyItemSpecialOffer', {    
    method: 'POST',    
    headers: {    
        'Content-Type': 'application/json'    
    },    
    body: JSON.stringify({    
        FunctionParameters: {    
            ItemID: 'special-offer-item-id'    
        }    
    })    
})    
.then(response => response.json())    
.then(data => console.log(data))    
.catch(error => console.error('Error:', error));  
```

**Response:**

```json
{  
    "Message": "ITEMS_GRANTED",  
    "FunctionName": "ShopSystem_BuyItemSpecialOffer"  
}  
```

## BuyItemForVirtualCurrency

**Purpose:** Allows a player to purchase an item using virtual currency.

**URL:**

```
https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Shop/BuyItemForVirtualCurrency  
```

**Method:** POST

**Request Parameters (JSON body):**

* `FunctionParameters` (object):
  * `ItemID` (string): The ID of the item to purchase.

**Responses:**

* **200 OK:** Item purchased successfully. Returns the purchase details.
* **400 Bad Request:** Invalid request parameters or the item ID is null. Returns an error message.

**Example Usage:**

**Request:**

```javascript
fetch('https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Shop/BuyItemForVirtualCurrency', {    
    method: 'POST',    
    headers: {    
        'Content-Type': 'application/json'    
    },    
    body: JSON.stringify({    
        FunctionParameters: {    
            ItemID: 'virtual-currency-item-id'    
        }    
    })    
})    
.then(response => response.json())    
.then(data => console.log(data))    
.catch(error => console.error('Error:', error));  
```

**Response:**

```json
{  
    "Message": "ITEMS_GRANTED",  
    "FunctionName": "ShopSystem_BuyItemForVirtualCurrency"  
}  
```

## BuyItemDailyOffer

**Purpose:** Allows a player to purchase a daily offer item using virtual currency.

**URL:**

```
https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Shop/BuyItemDailyOffer  
```

**Method:** POST

**Request Parameters (JSON body):**

* `FunctionParameters` (object):
  * `ItemID` (string): The ID of the daily offer item to purchase.

**Responses:**

* **200 OK:** Item purchased successfully. Returns the purchase details.
* **400 Bad Request:** Invalid request parameters or the item ID is null. Returns an error message.

**Example Usage:**

**Request:**

```javascript
fetch('https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Shop/BuyItemDailyOffer', {    
    method: 'POST',    
    headers: {    
        'Content-Type': 'application/json'    
    },    
    body: JSON.stringify({    
        FunctionParameters: {    
            ItemID: 'daily-offer-item-id'    
        }    
    })    
})    
.then(response => response.json())    
.then(data => console.log(data))    
.catch(error => console.error('Error:', error));  
```

**Response:**

```json
{  
    "Message": "ITEMS_GRANTED",  
    "FunctionName": "ShopSystem_BuyItemDailyOffer"  
}  
```

## GrantItemsAfterIAPPurchase

**Purpose:** Grant items to the user after an In-App Purchase (IAP) is completed.

**URL:**

```
https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Shop/GrantItemsAfterIAPPurchase  
```

**Method:** POST

**Request Parameters (JSON body):**

* `FunctionParameters` (object):
  * `ItemID` (string): The ID of the purchased item.

**Responses:**

* **200 OK:** Items granted successfully. Returns the grant details.
* **400 Bad Request:** Invalid request parameters or the item ID is null. Returns an error message.

**Example Usage:**

**Request:**

```javascript
fetch('https://api.idosgames.com/api/{titleTemplateId}/{titleId}/Client/Shop/GrantItemsAfterIAPPurchase', {    
    method: 'POST',    
    headers: {    
        'Content-Type': 'application/json'    
    },    
    body: JSON.stringify({    
        FunctionParameters: {    
            ItemID: 'iap-item-id'    
        }    
    })    
})    
.then(response => response.json())    
.then(data => console.log(data))    
.catch(error => console.error('Error:', error));  
```

**Response:**

```json
{  
    "Message": "ITEMS_GRANTED",  
    "FunctionName": "ShopSystem_GrantItemsAfterIAPPurchase"  
}  
```


---

# 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.idosgames.com/api/api-v1/shop.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.
