Pricing and Licensing Apps
After you have created a client ID and
client secret, but before you submit an app to the Store, you need to
make some important decisions about how you will price and license the
app. The first question to ask yourself is whether your app will be
free or not. There is a lot to consider when making this decision. You
might want to make the app free and make money by having ads in the
app. Alternatively, you could offer a free version that supports in-app
purchases that cost money and unlock additional functionality in your
application.
For paid apps you can offer a price per user and
set an upper bound for the most an organization will pay for your app.
This method allows you to say, for example, that for above 500 users,
the app costs the same no matter how many users it is for.
NOTE
At the time of this writing the SharePoint Store does not support
commerce or licensing support for in-app purchases. This capability is
possible through the use of a third-party payment system and licensing
checks, but it is outside the boundary of the SharePoint Store and
Seller Dashboard and is up to the developer to provide and manage.
You might also want to support offering a trial
of your application. The SharePoint Store supports the ability to limit
the use of the trial to a particular time period and a number of users.
Another important point to consider is that app
developers must include code-based checks in their code to check for a
valid license. This ensures the individual or organization has
purchased the appropriate license for your app. This isn’t enforced by
SharePoint itself and is the developer’s responsibility. This is done
in two steps:
1. Request the licenses from SharePoint.
2. Verify the licenses with the Store.
To request the licenses from SharePoint you make a call using the Client-Side Object Model (CSOM) as follows:
ClientResult<AppLicenseCollection> licenses =
Microsoft.SharePoint.Client.Utilities.Utility.GetAppLicenseInformation(ctx, productId);
ctx.ExecuteQuery();
This returns the list of licenses that the user
has for the application. The next step is to verify those licenses. To
do that you need to submit the license to the validation Web service
hosted and run by Microsoft. The REST-based call to verify a license is
at: https://verificationservice.officeapps.live.com/ova/verificationagent.svc/rest/verify?token={token}.
The {token} parameter is a URI-encoded representation of the license token (.NET uses Uri.EscapeDataString
or something similar). The response from the service includes
information about whether the license is valid or has expired, the
license type, number of seats, and when it expires. You can then make
determinations based on this information in your application code to
decide what you want to do. Some considerations include:
- Revoking access
- Allowing access
- Turning on or off features based on whether the users are paid or free
- Turning on features if users have bought more than a certain number of seats
- Warning users their license is going to expire soon and they should consider buying a new one
The options are limitless, which is why leaving
it up to the developer to decide what to do and enforce those options
through code is part of the app model design. You are not limited to
the decision-making process. You could, for example, confer with
another system as part of the process such as another licensing system
or in-app payment system. These are just examples, but the final
pricing and licensing decisions will vary based on the individual app.