Hi, I'm trying the have the ItemInstanceId from a user inventory and then execute the OpenTradeRequest. When I try to get the OfferedInventoryInstanceIds it's returning an error . What I'm doing wrong? I just need a simple code to get the ItemInstanceId. Thank you very much.
The error:
Trading Not Opened/Client/OpenTrade PlayFabError(InvalidParams, Invalid input parameters, 400 BadRequest - Details: OfferedInventoryInstanceIds: Invalid Format | )
using the following code:
private void GetInventory() { Debug.Log("Starting Inventory Check"); PlayFabClientAPI.GetUserInventory(new GetUserInventoryRequest(), OnApiCallSuccess, OnApiCallError); } private void OnApiCallSuccess(GetUserInventoryResult result) { GiveItemToMerchant(); } private void OnApiCallError(PlayFabError error) { } public void GiveItemToMerchant() { string instanceID = new ItemInstance().ItemInstanceId; Debug.Log("Starting the Trading Item to Merchant: " + instanceID ); PlayFabClientAPI.OpenTrade(new OpenTradeRequest() { AllowedPlayerIds = new List<string> { secondPlayerId }, // PlayFab ID for the friend who will receive your gift OfferedInventoryInstanceIds = new List<string> { instanceID } // The item instanceId fetched from GetUserInventory() //RequestedCatalogItemIds = new List<string> { itemId } //The item instanceId fetched from GetUserInventory() }, tradeSuccesfull, tradeFailure); }