---
title: ZEPETO.Multiplay.Inventory
slug: world-sdk-guide-fr/zepetomultiplayinventory
docTags: 
createdAt: 2026-09-04T05:23:23.788Z
---

| Type                                  | Description                                                                          |
| ------------------------------------- | ------------------------------------------------------------------------------------ |
| [InventoryError](./#inventoryerror)   | Code d'erreur indiquant la raison de l'échec des requêtes liées à l'inventaire.      |
| [InventoryRecord](./#inventoryrecord) | Informations sur un produit de l'inventaire.                                         |
| [Inventory](./#inventory)             | `Inventory` gère les opérations liées à l'inventaire de produits in-World du joueur. |

## InventoryError

`enum`

Code d'erreur indiquant la raison de l'échec des requêtes liées à l'inventaire.

| Nom          | Valeur | Description                                                                               |
| ------------ | ------ | ----------------------------------------------------------------------------------------- |
| Unknown      | -1     | Erreur : erreur inconnue.                                                                 |
| NetworkError | 0      | Erreur : erreurs liées au réseau, notamment les déconnexions ou les connexions instables. |

## InventoryRecord

`interface`

Informations sur un produit de l'inventaire.

### Propriétés

| Nom       | Type     | Description                                                           |
| --------- | -------- | --------------------------------------------------------------------- |
| productId | `string` | ID du produit.                                                        |
| quantity  | `number` | Quantité du produit.                                                  |
| createdAt | `Date`   | Date et heure auxquelles le produit a été ajouté à l'inventaire.      |
| updatedAt | `Date`   | Date et heure de la dernière mise à jour des informations du produit. |

## Inventory

`interface`

`Inventory` gère les opérations liées à l'inventaire de produits in-World du joueur.

### Méthodes

### use

`use(productId: string, quantity?: number, reason?: string) → Promise<boolean>`

Utilise un produit in-World de l'inventaire du joueur. Lève `InventoryError`.

| Paramètre             | Type     | Description                                                   |
| --------------------- | -------- | ------------------------------------------------------------- |
| productId             | `string` | ID du produit à utiliser.                                     |
| quantity (facultatif) | `number` | Quantité du produit à utiliser. La valeur par défaut est `1`. |
| reason (facultatif)   | `string` | Décrit éventuellement la raison de l'utilisation.             |

**Renvoie :** `Promise<boolean>` — `Promise` résolue à la fin de l'opération, indiquant la réussite (`true`) ou l'échec (`false`).

### add

`add(productId: string, quantity?: number, reason?: string) → Promise<boolean>`

Ajoute un produit in-World à l'inventaire du joueur. Lève `InventoryError`.

| Paramètre             | Type     | Description                                                  |
| --------------------- | -------- | ------------------------------------------------------------ |
| productId             | `string` | ID du produit à ajouter.                                     |
| quantity (facultatif) | `number` | Quantité du produit à ajouter. La valeur par défaut est `1`. |
| reason (facultatif)   | `string` | Décrit éventuellement la raison de l'ajout.                  |

**Renvoie :** `Promise<boolean>` — `Promise` résolue à la fin de l'opération, indiquant la réussite (`true`) ou l'échec (`false`).

### madd

`madd(products: { productId: string; quantity: number; reason?: string }[]) → Promise<boolean>`

Ajoute plusieurs produits in-World à l'inventaire du joueur. Lève `InventoryError`.

| Paramètre | Type                                                         | Description                     |
| --------- | ------------------------------------------------------------ | ------------------------------- |
| products  | `{ productId: string; quantity: number; reason?: string }[]` | Tableau des produits à ajouter. |

**Renvoie :** `Promise<boolean>` — `Promise` résolue à la fin de l'opération, indiquant la réussite (`true`) ou l'échec (`false`).

### has

`has(productId: string) → Promise<boolean>`

Vérifie l'existence d'un produit in-World dans l'inventaire du joueur. Lève `InventoryError`.

| Paramètre | Type     | Description               |
| --------- | -------- | ------------------------- |
| productId | `string` | ID du produit à vérifier. |

**Renvoie :** `Promise<boolean>` — `Promise` résolue à la fin de l'opération, indiquant la présence (`true`) ou l'absence (`false`) du produit.

### get

`get(productId: string) → Promise<InventoryRecord | null>`

Récupère un produit in-World depuis l'inventaire du joueur. Lève `InventoryError`.

| Paramètre | Type     | Description                |
| --------- | -------- | -------------------------- |
| productId | `string` | ID du produit à récupérer. |

**Renvoie :** `Promise<InventoryRecord | null>` — `Promise` résolue à la fin de l'opération, avec l'objet `InventoryRecord` récupéré.

### remove

`remove(productId: string) → Promise<boolean>`

Supprime un produit in-World de l'inventaire du joueur. Lève `InventoryError`.

| Paramètre | Type     | Description                |
| --------- | -------- | -------------------------- |
| productId | `string` | ID du produit à supprimer. |

**Renvoie :** `Promise<boolean>` — `Promise` résolue à la fin de l'opération, indiquant la réussite (`true`) ou l'échec (`false`).

### list

`list() → Promise<InventoryRecord[]>`

Récupère tous les produits in-World de l'inventaire du joueur. Lève `InventoryError`.

**Renvoie :** `Promise<InventoryRecord[]>` — `Promise` résolue à la fin de l'opération, avec un tableau des objets `InventoryRecord` récupérés.
