# Work with Player Inventory

### Retrieve Inventory in Game

To retrieve the inventory of player in game use the following SDK code

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

```csharp
LootLockerSDKManager.GetInventory((response) =>
{
    if (response.success)
    {
        Debug.Log("Successfully retrieved player inventory: " + response.inventory.Length);
    } else
    {
        Debug.Log("Error getting player inventory");
    }
});
```

{% endtab %}

{% tab title="Unreal" %}

<figure><img src="https://534367586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVu1MPzezO-NgvC98xh%2Fuploads%2Fgit-blob-dca50c2f903a094ccbf4d877e9641986a484e605%2Fimage%20(45).png?alt=media" alt=""><figcaption><p><a href="https://blueprintue.com/blueprint/4o3yt2r-">Blueprint example of retrieving the players inventory</a></p></figcaption></figure>

To copy and paste the above example into your editor, [look here](https://blueprintue.com/blueprint/4o3yt2r-/).

**Input**

You need to exchange the white empty event for whatever event you want to use to trigger this flow.

**Output**

We recommend branching the completed events on the success flag in the response, and if you do this, you will probably want to add error handling in case the request fails as well as what (if any) continued actions you want on success.
{% endtab %}

{% tab title="REST" %}

```bash
curl -X GET "https://api.lootlocker.io/game/v1/player/inventory/list" \
  -H "x-session-token: your_token_here"
```

Example response:

```json
{
    "success": true,
    "inventory": [
        {
            "instance_id": 538,
            "variation_id": 45,
            "rental_option_id": null,
            "acquisition_source": "grant_default_loadout",
            "acquisition_date": "2022-05-30T07:57:58+00:00",
            "asset": {...},
            "rental": {
                "is_rental": false,
                "time_left": null,
                "duration": null,
                "is_active": null
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### Gift an Asset

Gifting is the ability to grant a specific Asset to a player directly through the LootLocker Management Console.

![](https://534367586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVu1MPzezO-NgvC98xh%2Fuploads%2Fgit-blob-2618e028c2a1f2a1169ce08c0149c286cc1f4cc3%2FScreenshot_10.png?alt=media)

To gift an Asset to a player, click the `Give Asset` button in the Player Manager interface. Search for and select an Asset from the popup Asset list. This will immediately grant the player the Asset. A list of all granted Assets can be found in the Orders tab in the Player Manager interface.

![](https://534367586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVu1MPzezO-NgvC98xh%2Fuploads%2Fgit-blob-ac656ebabc3f5101252a18092e7e67cd518ef5c7%2FScreenshot_11.png?alt=media)

### Refund an Order

Refunds can be used in case a player purchases an Asset unintentionally or needs to be refunded their purchase for other reasons. Refunding an Order in LootLocker is an easy and simple process.

![](https://534367586-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVu1MPzezO-NgvC98xh%2Fuploads%2Fgit-blob-564983ffff1e9232cdc7641df77936842ea933d1%2FplayerManager-refund.png?alt=media\&token=4f0d0cf9-1554-4bb3-b315-50ac2eef4cb3)

To refund an Order, navigate to the Inventory tab in the Player Manager interface. Find the Asset in question and use the `Refund` button to refund the Asset. This will immediately refund the purchased Assets and return the Currency to the player’s wallet. If the player purchased an Asset Package, you will need to refund all Assets from that package for the Currency to be returned to the player's wallet.

{% hint style="info" %}
Only purchased Assets can be refunded. Assets granted through other LootLocker systems cannot be refunded.
{% endhint %}
