> ## 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.

# Inventory 컬렉션

> PlayFab Economy v2 Inventory 컬렉션을 사용하여 플레이어 인벤토리를 캐릭터, 로드아웃 또는 저장 컨테이너를 위한 이름이 지정된 그룹으로 분할합니다.

# 컬렉션

<Info>
  Economy v2는 이제 정식으로 사용할 수 있습니다(GA). 지원 및 피드백은 [PlayFab Forum](https://community.playfab.com)을 방문하세요.
</Info>

Economy v2 Inventory 서비스는 인벤토리 요구 사항에 더 큰 유연성과 지원을 추가할 수 있는 컬렉션의 개념을 도입합니다. 컬렉션은 단일 플레이어/PlayerId가 여러 인벤토리를 갖게 하는 메커니즘입니다. 이 기능을 사용하여 동일한 플레이어의 다른 캐릭터를 위한 여러 인벤토리를 관리하고, 다른 플랫폼용으로 별도의 인벤토리를 갖는 등 다양한 작업을 수행할 수 있습니다!

Inventory API 호출은 작업을 수행할 컬렉션/인벤토리를 지정하는 `CollectionId` 매개 변수를 받을 수 있습니다. 사용되지 않은 CollectionId에 아이템/스택을 추가하여 새 컬렉션을 만듭니다.

## Inventory 컬렉션 관리

### GetInventoryCollectionIds

`GetInventoryCollectionIds` API를 사용하여 지정된 플레이어의 `CollectionId` 목록을 가져올 수 있습니다. 플레이어는 자신의 ID 목록에만 액세스할 수 있도록 제한됩니다. Title Entities는 액세스하려는 플레이어의 인벤토리를 표시하기 위해 `Entity` 매개 변수를 전달할 수 있습니다.

`GetInventoryCollectionIds` 요청 예:

```json theme={null}
{
  "Entity": {
    "Type": "title_player_account",
    "Id": "ABCD12345678"
  },
  "Count": 15,
  "ContinuationToken": "abc="
}
```

이 요청은 다음 응답을 반환합니다.

```json theme={null}
{
  "data": {
  "CollectionIds": [
    "default",
    "main_character"
    ]
  }
}
```

#### Continuation Token

검색 응답에서 반환된 `ContinuationToken` 필드를 인벤토리 요청에 전달하여 여러 개의 결과 카운트를 페이지 매김할 수 있습니다.

### 새 Inventory 컬렉션 추가

새 CollectionId로 쓰기 요청을 수행하여 플레이어의 새 컬렉션을 만듭니다.

예를 들어 다음 `AddInventoryItems` 요청은 collectionId `main_character`를 사용합니다.

```json theme={null}
{
    "Entity": {
        "Type": "title_player_account",
        "Id": "ABCD12345678"
    },
    "CollectionId": "main_character",
    "Item": {
        "Id": "0b440353-bdbc-48d8-8873-f0988c1f9d8b",
    },
    "Amount": 10,
}
```

위의 요청은 완전히 새로운 인벤토리 컬렉션을 만들어 아이템 10개를 추가하거나, 이미 존재하는 경우 기존 `main_character` 인벤토리 컬렉션에 10개를 추가합니다.

### DeleteInventoryCollection

`DeleteInventoryCollectionId` API에서 삭제하려는 `CollectionId`를 정의할 수 있습니다. 삭제는 비동기 작업이며 큰 컬렉션의 경우 더 오래 걸릴 수 있습니다. 삭제 작업이 완료될 때까지 컬렉션을 다시 만들 수 없습니다.

`DeleteInventoryCollectionIds` 요청 예:

```json theme={null}
{
  "Entity": {
    "Type": "title_player_account",
    "Id": "ABCD12345678"
  },
  "CollectionId": "main_character"
}
```

<Note>
  현재 API는 Inventory 컬렉션을 삭제하는 유일한 방법입니다. Game Manager는 현재 새 컬렉션과 기존 컬렉션에 아이템을 보고 추가하는 데만 사용할 수 있습니다. 추가 기능이 향후 추가될 예정입니다.
</Note>

### ExecuteInventoryOperations API

`ExecuteInventoryOperations` API에서 `CollectionId` 매개 변수를 설정할 수 있습니다. 이 매개 변수를 사용하면 작업을 수행할 컬렉션을 정의할 수 있습니다.

스택이 있는 `ExecuteInventoryOperations` 요청 예:

```json theme={null}
{
    "Entity": {
        "Type": "title_player_account",
        "Id": "ABCD12345678"
    },
    "CollectionId": "main_character",
    "Operations": [
        {
            "Update": {
                "Item" {
                    "Id": "0b440353-bdbc-48d8-8873-f0988c1f9d8b",
                    "Amount": 10
                }
            }
        },
        {
            "Subtract": {
                "Item" {
                    "Id": "0b440353-bdbc-48d8-8873-f0988c1f9d8b",
                },
                "Amount": 5
            }
        }
    ]
}
```


## Related topics

- [PlayFab Inventory API](/ko/services/playfab/economy-monetization/economy-v2/inventory/index.md)
- [Postman용 PlayFab REST API 컬렉션 빠른 시작](/ko/services/playfab/sdks/postman/postman-quickstart.md)
- [PFInventoryDeleteInventoryCollectionAsync](/ko/services/playfab/api-references/c/pfinventory/functions/pfinventorydeleteinventorycollectionasync.md)
- [PFInventoryTransactionTransferDetails](/ko/services/playfab/api-references/c/pfinventorytypes/structs/pfinventorytransactiontransferdetails.md)
- [Economy V2 제한](/ko/services/playfab/economy-monetization/economy-v2/limits.md)
