Documentation

InventoryApi

Import

Import

  • const { InventoryApi } = require("@unity-services/economy-2.1");

Constructors

Constructor

Methods

Add Inventory Item

  • addInventoryItem(projectId: string, playerId: string, configAssignmentHash?: string, addInventoryRequest?: AddInventoryRequest, options?: AxiosRequestConfig): Promise<AxiosResponse<InventoryResponse>>
  • Add an item to a player's inventory.

    summary

    Add Inventory Item

    throws

    {RequiredError}

    memberof

    InventoryApi

    Parameters

    • projectId: string

      ID of the project

    • playerId: string

      ID of the player

    • Optional configAssignmentHash: string
    • Optional addInventoryRequest: AddInventoryRequest
    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<InventoryResponse>>

Delete Inventory Item

  • deleteInventoryItem(projectId: string, playerId: string, playersInventoryItemId: string, configAssignmentHash?: string, inventoryDeleteRequest?: InventoryDeleteRequest, options?: AxiosRequestConfig): Promise<AxiosResponse<void>>
  • Delete a player inventory item.

    summary

    Delete Inventory Item

    throws

    {RequiredError}

    memberof

    InventoryApi

    Parameters

    • projectId: string
    • playerId: string
    • playersInventoryItemId: string
    • Optional configAssignmentHash: string
    • Optional inventoryDeleteRequest: InventoryDeleteRequest
    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<void>>

Get Player Inventory

  • getPlayerInventory(projectId: string, playerId: string, configAssignmentHash?: string, after?: string, limit?: number, playersInventoryItemIds?: string[], inventoryItemIds?: string[], options?: AxiosRequestConfig): Promise<AxiosResponse<PlayerInventoryResponse>>
  • Get a list of inventory for a player. Results ordered by Player Inventory Item ID ascending. Players inventory item ID and Inventory Item ID filters are optional, if not given all will be returned. If both are given an item must match both to be returned.

    summary

    List Player Inventory

    throws

    {RequiredError}

    memberof

    InventoryApi

    Parameters

    • projectId: string

      ID of the project

    • playerId: string

      ID of the player

    • Optional configAssignmentHash: string
    • Optional after: string
    • Optional limit: number
    • Optional playersInventoryItemIds: string[]
    • Optional inventoryItemIds: string[]
    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<PlayerInventoryResponse>>

Update Inventory Item

  • updateInventoryItem(projectId: string, playerId: string, playersInventoryItemId: string, configAssignmentHash?: string, inventoryRequestUpdate?: InventoryRequestUpdate, options?: AxiosRequestConfig): Promise<AxiosResponse<InventoryResponse>>
  • Update a players inventory item.

    summary

    Player Inventory Item

    throws

    {RequiredError}

    memberof

    InventoryApi

    Parameters

    • projectId: string
    • playerId: string
    • playersInventoryItemId: string
    • Optional configAssignmentHash: string
    • Optional inventoryRequestUpdate: InventoryRequestUpdate
    • Optional options: AxiosRequestConfig

    Returns Promise<AxiosResponse<InventoryResponse>>