question

Jade Bourque avatar image
Jade Bourque asked

Does ClientPurchaseItem use currency from user instead of character?

Hey folks, I'm trying to buy an item using a character's virtual currency, but I keep getting an insufficient funds error despite having more than enough currency.

My item is priced at 1000, my character has 20000+

6062-image.png 6074-image.png

Also, does the item get added to the player's inventory after purchase, or the character's? I think this info should be added to the docs!

Thanks!

Player Inventory
image.png (23.9 KiB)
image.png (38.3 KiB)
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Gosen Gao avatar image
Gosen Gao answered

Please specify the CharacterId when calling the Player Item Management - Purchase Item - REST API (PlayFab Client) | Microsoft Learn, or it will purchase for the Master player account.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jade Bourque avatar image Jade Bourque commented ·

The Character ID field was filled ! ClientPurchaseItemRequest({ ItemId: "FTContainer_Marking_Pandora", Price: 1000, VirtualCurrency: "FT", CharacterId: "260DE3973BE4E09B", StoreId: "PoP_FeaturedMarkings" })

0 Likes 0 ·
Gosen Gao avatar image Gosen Gao Jade Bourque commented ·

It should purchase the item for the character if you specify the CharacterId field. You can check if you have other catalog versions that sets a higher price. If it is not the cause, may I know your Title ID and the PlayFab Id of the associated account?

0 Likes 0 ·