Pages Menu
TwitterRssFacebook

Posted by on Feb 18, 2022 in Development, Microsoft Teams | 0 comments

Microsoft Teams Apps now support in-app purchases

Microsoft Teams Apps now support in-app purchases

The Microsoft Teams App ecosystem got yet another feature recently: the ability for developers to transact in-app purchases by making use of dedicated API calls to trigger “purchase experiences”.

You’ve been able to charge money for Teams apps for a little while now, but this is a decision that users made up-front when installing the app. This change is essentially the ability for users to change subscription after installation, via a new method in the Teams client SDK: microsoftTeams.monetization.openPurchaseExperience().

I looked around a bit, and this API call actually isn’t that new – it’s in the current version of the SDK (v1.11) but just wasn’t much noticed (at least not by me until new documentation showed up describing it).

Calling the method overlays a dialog showing the available subscriptions, as set up by the app developer (same one as for purchasing the app prior to installation):

You need .. a new permission?

For reasons I don’t fully understand, a new RSC permission is needed if you want to implement this functionality, specifically the Delegated permission InAppPurchase.Allow.User. The reason I don’t understand it is that this feature isn’t providing access to any new piece of information, or enabling any ability to modify anything about the channel the application is installed in. It’s more like a feature flag. Maybe the reason is to ensure that someone in authority (such as an owner of the channel) is made aware or, and thus consents to, the reality that end-users may choose to upgrade to a paid plan of the software that’s been installed in the channel.

I definitely still have questions about how this works, who gets charged, how to change subscriptions again later, and whether admins can control which users (if any) are able to invoke these upgrades, but I haven’t yet had a chance to set this up and play with it. There is also a preview offer type you can add to you application to test the end-to-end subscription flow, presumably without spending actual money, so I will also be looking at that.

If you’d like to know more about this, let me know and I’ll put together a video about my experiences setting everything up and walking through the various different user flows.

Written by Tom Morgan

Tom is a Microsoft Teams Platform developer and Microsoft MVP who has been blogging for over a decade. Find out more.
Buy the book: Building and Developing Apps & Bots for Microsoft Teams. Now available to purchase online with free updates.

Post a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.