playfab_ex v0.2.0 PlayfabEx.Client.PlayerItemManagement

Link to this section Summary

Functions

Increments the user’s balance of the specified virtual currency by the stated amount

Confirms with the payment provider that the purchase was approved (if applicable) and adjusts inventory and virtual currency balances as appropriate

Consume uses of a consumable item. When all uses are consumed, it will be removed from the player’s inventory

Retrieves the specified character’s current inventory of virtual goods

For payments flows where the provider requires playfab (the fulfiller) to initiate the transaction, but the client completes the rest of the flow. In the Xsolla case, the token returned here will be passed to Xsolla by the client to create a cart. Poll GetPurchase using the returned OrderId once you’ve completed the payment

Retrieves a purchase along with its current PlayFab status. Returns inventory items from the purchase that are still active

Retrieves the user’s current inventory of virtual goods

Selects a payment option for purchase order created via StartPurchase

Buys a single item with virtual currency. You must specify both the virtual currency to use to purchase, as well as what the client believes the price to be. This lets the server fail the purchase if the price has changed

Adds the virtual goods associated with the coupon to the user’s inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager

Creates an order for a list of items from the title catalog

Decrements the user’s balance of the specified virtual currency by the stated amount. It is possible to make a VC balance negative with this API

Opens the specified container, with the specified key (when required), and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem

Searches target inventory for an ItemInstance matching the given CatalogItemId, if necessary unlocks it using an appropriate key, and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem

Link to this section Functions

Link to this function add_user_virtual_currency(params)
add_user_virtual_currency(map()) ::
  {:ok, map()} |
  {:error, String.t()}

Increments the user’s balance of the specified virtual currency by the stated amount

online docs

Link to this function confirm_purchase(params)
confirm_purchase(map()) :: {:ok, map()} | {:error, String.t()}

Confirms with the payment provider that the purchase was approved (if applicable) and adjusts inventory and virtual currency balances as appropriate

online docs

Link to this function consume_item(params)
consume_item(map()) :: {:ok, map()} | {:error, String.t()}

Consume uses of a consumable item. When all uses are consumed, it will be removed from the player’s inventory.

online docs

Link to this function get_character_inventory(params)
get_character_inventory(map()) :: {:ok, map()} | {:error, String.t()}

Retrieves the specified character’s current inventory of virtual goods

online docs

Link to this function get_payment_token(params)
get_payment_token(map()) :: {:ok, map()} | {:error, String.t()}

For payments flows where the provider requires playfab (the fulfiller) to initiate the transaction, but the client completes the rest of the flow. In the Xsolla case, the token returned here will be passed to Xsolla by the client to create a cart. Poll GetPurchase using the returned OrderId once you’ve completed the payment.

online docs

Link to this function get_purchase(params)
get_purchase(map()) :: {:ok, map()} | {:error, String.t()}

Retrieves a purchase along with its current PlayFab status. Returns inventory items from the purchase that are still active.

online docs

Link to this function get_user_inventory(params)
get_user_inventory(map()) :: {:ok, map()} | {:error, String.t()}

Retrieves the user’s current inventory of virtual goods

online docs

Link to this function pay_for_purchase(params)
pay_for_purchase(map()) :: {:ok, map()} | {:error, String.t()}

Selects a payment option for purchase order created via StartPurchase

online docs

Link to this function purchase_item(params)
purchase_item(map()) :: {:ok, map()} | {:error, String.t()}

Buys a single item with virtual currency. You must specify both the virtual currency to use to purchase, as well as what the client believes the price to be. This lets the server fail the purchase if the price has changed.

online docs

Link to this function redeem_coupon(params)
redeem_coupon(map()) :: {:ok, map()} | {:error, String.t()}

Adds the virtual goods associated with the coupon to the user’s inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager.

online docs

Link to this function start_purchase(params)
start_purchase(map()) :: {:ok, map()} | {:error, String.t()}

Creates an order for a list of items from the title catalog

online docs

Link to this function subtract_user_virtual_currency(params)
subtract_user_virtual_currency(map()) ::
  {:ok, map()} |
  {:error, String.t()}

Decrements the user’s balance of the specified virtual currency by the stated amount. It is possible to make a VC balance negative with this API.

online docs

Link to this function unlock_container_instance(params)
unlock_container_instance(map()) ::
  {:ok, map()} |
  {:error, String.t()}

Opens the specified container, with the specified key (when required), and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem.

online docs

Link to this function unlock_container_item(params)
unlock_container_item(map()) :: {:ok, map()} | {:error, String.t()}

Searches target inventory for an ItemInstance matching the given CatalogItemId, if necessary unlocks it using an appropriate key, and returns the contents of the opened container. If the container (and key when relevant) are consumable (RemainingUses > 0), their RemainingUses will be decremented, consistent with the operation of ConsumeItem.

online docs