question

kristofer avatar image
kristofer asked

Economy V2 - Real money purchase

Hi,

I Just started exploring the Economy V2 API's and i cant figure out how to setup real money purchases for items, currencies and bundles.

The "Quickstart" documentation states

"Items can have a cost in either a virtual currency or real money. Each title can support multiple arbitrary virtual currencies. Currencies provide flexibility for your game to implement whatever medium of exchange you desire (for example, gold, gems, hearts, or interstellar credits)."

But i cant seem to find during setup of a new item or currency where to reference a store product id. i.e a Apple store product id (com.company.productId).

Is the intention that we handle this logic our self?

Thanks,

Kristofer

10 |1200

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

kylemc@microsoft.com avatar image
kylemc@microsoft.com answered

You can link store product ids to catalog items using Alternate Ids (in public preview this is constrained to bundles). Valid Alternate Id Types are as follows.

  • AppleAppStore
  • GooglePlay
  • MicrosoftStore
  • NintendoEShop
  • PlayStationStore
  • Steam

The Alternate Id value is some form of the Marketplace Offer Id. When you use the `RedeemMicrosoftStoreInventoryItems` API (or the others), the failure message will tell you if it found an entitlement in the store that it cannot find in the catalog. You can use this to debug offer id naming mismatches.

In the Developer Portal, you can use the "Marketplace Mapping" portion of the UX to configure the marketplace Alternate Ids for an item.

4 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.

kristofer avatar image kristofer commented ·

I guess the "Alternate Id" that you are referring to is the "Marketplace" and "Marketplace ID"?

How can i initiate a purchase of a bundle with the "Marketplace ID"?

Are you planning to have the "Marketplace Mapping" added to Items as well? Or will i need to always create a bundle for each item that i want to sell for real money?

Thanks,

Kristofer

0 Likes 0 ·
kylemc@microsoft.com avatar image kylemc@microsoft.com commented ·

In the API, the mappings show up in the Alternate Ids list. In the portal they appear in the marketplace mapping section.

Once you have the mapping setup, you can call the `RedeemAppleAppStoreInventoryItems` (or one of the other 5 redeem APIs) to redeem items you have purchased from the platform store into your inventory.

We'd like to add redeem support for `catalogItems` as well. I'm not sure it makes much sense for the other item types.

0 Likes 0 ·
moises avatar image moises kylemc@microsoft.com commented ·

Hi @kylemc@microsoft.com,

I'm creating the alternate IDs using the Marketplace Mapping, and calling RedeemGooglePlayInventoryItems with the receipt I get from GooglePlay but I'm getting:

"FailureCode":"UnknownOfferId" "FailureDetails":"Failed to redeem offer mygame_100_coins because it is not setup or empty in the catalog. Please add or update a bundle with the alternate id Type=GooglePlay Value=mygame_100_coins and try again later."

I tried different IDs formats as well, but nothing seems to work.

Any tips?

0 Likes 0 ·
kylemc@microsoft.com avatar image kylemc@microsoft.com moises commented ·

It's hard to know. The algorithm is as follows:

  1. Inspect the marketplace inventory to see offers are owned and unconsumed

  2. Search for bundles in the catalog with alternate ids matching the marketplace and offer name

  3. Add those bundles to the user inventory

  4. Consume those owned offers from the marketplace inventory (assuming they're consumable)

You're failing out at Step #2. If you can run this SearchItems query successfully, then it should work in RedeemGooglePlayInventoryItems. (This is equivalent to what we run on the backend.)

(type eq 'bundle') and (alternateIds/any(a: (a/type eq 'GooglePlay' and a/value eq 'mygame_100_coins')))

0 Likes 0 ·
kristofer avatar image
kristofer answered

Hey @kylemc@microsoft.com,

Do the Redeem API's perform receipt validation (iOS,Android)?


Thanks,

Kristofer

1 comment
10 |1200

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

kylemc@microsoft.com avatar image kylemc@microsoft.com commented ·

They do. For those two specifically, you pass in the receipt as part of the request payload.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]