> For the complete documentation index, see [llms.txt](https://docs.idosgames.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.idosgames.com/api/api-v1/shop.md).

# 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"  
}  
```
