> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Timed Consumables in Economy (Legacy)

> Configure PlayFab Legacy Economy timed consumables in Game Manager so items auto-consume from a player's inventory after a set duration.

# Timed Consumables (Legacy Economy)

<Info>
  Economy v1 APIs are in maintenance mode and will not be receiving any new features, only bug fixes. **The v1 APIs will be maintained for the foreseeable future.** See the [Economy v2 Overview](/services/playfab/economy-monetization/economy-v2/overview) to learn more about the next version of PlayFab Economy!
</Info>

This tutorial walks you through creating timed consumables using the PlayFab Game Manager. Timed consumables are items that are configured to auto-consume after a specific time from the initial grant to the player.

## Requirements

* We assume that you're already familiar with [Catalogs](/services/playfab/economy-monetization/economy/items/catalogs), [Inventory](/services/playfab/player-progression/player-data/player-inventory), and the PlayFab [Game Manager](/services/playfab/live-service-management/gamemanager/quickstart).
* You must have a *primary catalog*.

## Create a Stackable Timed Consumable

Let's create a small stamina potion that boosts your player's stamina for five minutes when granted, and increases the time range by five minutes. In Game Manager:

1. Navigate to your **Title**.
2. Select **Economy** from the menu on the left.
3. Go to the **Catalogs** tab and choose your primary catalog - your screen should look similar to this example:
   <img src="https://mintcdn.com/microsoft-4404708b/Oa_DP1q6U1lat7c2/images/playfab/economy-monetization/economy/tutorials/game-manager-timed-consumables-items-tab.png?fit=max&auto=format&n=Oa_DP1q6U1lat7c2&q=85&s=07324205042b82707322d0144072dc89" alt="Game Manager - Timed Consumables - Items Tab With One Item" width="1280" height="1100" data-path="images/playfab/economy-monetization/economy/tutorials/game-manager-timed-consumables-items-tab.png" />
4. Select **New item** in the top right corner.
5. Fill out the following fields:

   |    Field Name   |      Sample Value      | Description                                                                                                                                                                                                       |
   | :-------------: | :--------------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   |     Item ID     | Small\_Stamina\_Potion | This *required* field is the unique identifier for the item within the Catalog. The item ID must be unique within the Catalog, but you can have multiple catalog versions containing items with the same item ID. |
   |   Display Name  |  Small Stamina Potion  | This *optional* field is the name displayed for the catalog item. One common usage is when you want to offer the item in your in-game store. Display names don't need to be unique.                               |
   |    Consumable   |       Consumable       | Indicates whether the item is **Durable** or **Consumable**.                                                                                                                                                      |
   |     By Count    |            1           | This field is *required* when **Consumable** is selected. It determines how much the count of that item will be decremented when consumed.                                                                        |
   |     By Time     |        5 Minutes       | This field is *optional* when **Consumable** is selected. It determines the amount of time that will elapse from the moment the item is granted to the moment it's consumed.                                      |
   | Time Group Name | Small\_Stamina\_Potion | This field is *optional* when **Consumable** is selected. It allows you to join multiple item consumption times with the same group name together.                                                                |
   |   Is Stackable  |          True          | Marking an item as **Stackable** allows only one item of this type in the inventory and increments the quantity count of the item.                                                                                |

   <img src="https://mintcdn.com/microsoft-4404708b/Oa_DP1q6U1lat7c2/images/playfab/economy-monetization/economy/tutorials/game-manager-timed-consumables-stackable.png?fit=max&auto=format&n=Oa_DP1q6U1lat7c2&q=85&s=84e03786b569afc2859a00d3dddde7ab" alt="Game Manager - Timed Consumables - Stackable Item" width="1280" height="1100" data-path="images/playfab/economy-monetization/economy/tutorials/game-manager-timed-consumables-stackable.png" />
6. Select **Save item**.

You'll now be able to stack these potions and the remaining time will automatically "stack" as well. For example, if I grant one small stamina potion to a player at 1:00pm, the item will be consumed at 1:05pm. If I grant another small stamina potion at 1:02pm, the two items will be consumed at 1:10pm.

<Note>
  If you don't specify a time group name for a stackable timed consumable, the full stack will expire when the original expiration time was set from the first grant. For example, in the scenario above, if I instead left the time group name blank, if I grant one small stamina potion to a player at 1:00pm, the item will be consumed at 1:05pm. If I grant another small stamina potion at 1:02pm, the two items will still be consumed at 1:05pm. If I grant yet another small stamina potion at 1:04pm, the three items will still be consumed at 1:05pm. But after the stack is consumed, if I grant a small stamina potion at 1:10pm, the item will be consumed at 1:15pm.
</Note>

## Create a Non-Stackable Timed Consumable

Let's create a similar example as before, but with a non-stackable item. Let's create a medium stamina potion that will boost your player's stamina for 10 minutes when granted, and increase the time range by an additional 10 minutes for each additional item. In Game Manager:

1. Navigate to your **Title**.
2. Select **Economy** from the menu on the left.
3. Go to the **Catalogs** tab and choose your primary catalog - your screen should look similar to this example:
   <img src="https://mintcdn.com/microsoft-4404708b/Oa_DP1q6U1lat7c2/images/playfab/economy-monetization/economy/tutorials/game-manager-timed-consumables-items-tab-2.png?fit=max&auto=format&n=Oa_DP1q6U1lat7c2&q=85&s=106ecb5bb2ee7f236a73460377e6c563" alt="Game Manager - Timed Consumables - Items Tab With Two Items" width="1280" height="1100" data-path="images/playfab/economy-monetization/economy/tutorials/game-manager-timed-consumables-items-tab-2.png" />
4. Select **New item** in the top right corner.
5. Fill out the following fields:

   |    Field Name   |      Sample Value     | Description                                                                                                                                                                                                       |
   | :-------------: | :-------------------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   |     Item ID     |  Med\_Stamina\_Potion | This *required* field is the unique identifier for the item within the Catalog. The item ID must be unique within the Catalog, but you can have multiple catalog versions containing items with the same item ID. |
   |   Display Name  | Medium Stamina Potion | This *optional* field is the name displayed for the catalog item. One common usage is when you want to offer the item in your in-game store. Display names don't need to be unique.                               |
   |    Consumable   |       Consumable      | Indicates whether the item is **Durable** or **Consumable**.                                                                                                                                                      |
   |     By Count    |           1           | This *required* field (when **Consumable** is selected) determines how much the count of that item will be decremented when consumed.                                                                             |
   |     By Time     |       10 Minutes      | This *optional* field (when **Consumable** is selected) determines the amount of time that will elapse from the moment the item is granted to the moment it's consumed.                                           |
   | Time Group Name |  Med\_Stamina\_Potion | This *optional* field (when **Consumable** is selected) allows you to join multiple item consumption times with the same group name together.                                                                     |
   |   Is Stackable  |         False         | Marking an item as **Stackable** allows only one item of this type in the inventory and increments the quantity count of the item.                                                                                |

   <img src="https://mintcdn.com/microsoft-4404708b/Oa_DP1q6U1lat7c2/images/playfab/economy-monetization/economy/tutorials/game-manager-timed-consumables-non-stackable.png?fit=max&auto=format&n=Oa_DP1q6U1lat7c2&q=85&s=77e85186bc62bdbd92c87506f6698f13" alt="Game Manager - Timed Consumables - Non-Stackable Item" width="1280" height="1100" data-path="images/playfab/economy-monetization/economy/tutorials/game-manager-timed-consumables-non-stackable.png" />
6. Select **Save item**.

Now every time you grant an additional medium stamina potion, it will create an entirely new instance in the player's inventory, as the item isn't stackable. You'll still be able to automatically "stack" the remaining time for those items. For example, if I grant one medium stamina potion to a player at 1:00pm, the item will be consumed at 1:10pm. If I grant another medium stamina potion at 1:05pm, the two items will be consumed at 1:20pm.

<Note>
  If you don't specify a time group name for a non-stackable timed consumable, each instance will expire independently of one another. For example, in the scenario above, if I instead left the time group name blank, if I grant one medium stamina potion to a player at 1:00pm, the item will be consumed at 1:10pm. If I grant another medium stamina potion at 1:05pm, the first item will still be consumed at 1:10pm, and the second item will be consumed at 1:15pm.
</Note>

## Link Multiple Timed Consumables

Now that you have a Small Potion (stackable) and a Medium Potion (non-stackable), let's link those two timers together. Let's modify a few fields to allow your player's stamina to get boosted when the small or medium stamina potions are granted, and increase the time range by an additional 5 or 10 minutes for each small or medium stamina potion, respectively. In Game Manager:

1. Navigate to your **Title**.
2. Select **Economy** from the menu on the left.
3. Go to the **Catalogs** tab and choose your primary catalog - your screen should look similar to this example:
   <img src="https://mintcdn.com/microsoft-4404708b/Oa_DP1q6U1lat7c2/images/playfab/economy-monetization/economy/tutorials/game-manager-timed-consumables-items-tab-3.png?fit=max&auto=format&n=Oa_DP1q6U1lat7c2&q=85&s=0db8f5c8cba28d73e06ee7fa3cf37748" alt="Game Manager - Timed Consumables - Items Tab With Three Items" width="1280" height="1100" data-path="images/playfab/economy-monetization/economy/tutorials/game-manager-timed-consumables-items-tab-3.png" />
4. Select **Med\_Stamina\_Potion** in the item list.
5. Change the **Time Group Name** from `Med_Stamina_Potion` to `Stamina_Potion`.
6. Select **Save item**.
7. Select **Small\_Stamina\_Potion** in the item list.
8. Change the **Time Group Name** from `Small_Stamina_Potion` to `Stamina_Potion`.
9. Select **Save item**.

Now every time you grant an additional small or medium stamina potion, it will automatically "stack" the remaining time for all items with the same time group name. For example, if I grant one medium stamina potion to a player at 1:00pm, the item will be consumed at 1:10pm. If I grant a small stamina potion at 1:05pm, the two items will be consumed at 1:15pm.


## Related topics

- [Stores and sales in Economy (Legacy)](/services/playfab/economy-monetization/economy/tutorials/stores-and-sales.md)
- [Catalogs (Legacy Economy)](/services/playfab/economy-monetization/economy/items/catalogs.md)
- [Drop Tables in Economy (Legacy)](/services/playfab/economy-monetization/economy/tutorials/drop-tables.md)
- [Managing consumable products from your service](/publishing/xstore-commerce/xstore-managing-consumables.md)
- [Economy (Legacy) quickstart](/services/playfab/economy-monetization/economy/quickstart.md)
