Adding In Skill Purchases to Alexa Skills

Let's Make Money

We have had some posts in the blog previously regarding Alexa skills. There are many reasons to develop Alexa skills including entertainment, convenience but in this post I'll show you how to facilitate a purchase from your skill.

ASK CLI

Amazon recommends using their CLI to add in skill purchases. There is some overhead in setting this up but it's quite smooth once you are up and running. You'll need to have Node installed to get going. Once Node is installed you can install ASK via npm install -g ask-cli. Verify your installation via ask -version. As of the time of writing I'm on 1.4.2. You can now authenticate to your Amazon Developer account via ask init --profile default. It's important that this returns a vendor id to you. Now you will be given a url to follow in your browser to gain access to your developer account. Here's what it will look like.

At this point you have loosely attached your command prompt to the amazon developer portal.

Building Skills Atomically

Before integration with the command line there were many moving parts to making an Alexa skill. Minimally, you would have to develop the context of your skill in the developer portal and then write your Lambda function in your AWS account. This creates disjoint moving parts while you struggle to get them to work together. The command line can integrate these parts together for you by allowing you to deploy to both portals simultaneously. Further, this type of work flow will allow you to version control your work atomically via git. You can then push the your repo to github, AWS Code Commit, or deploy it straight to your developer account. You can even start improving your existing skills by cloning them from the developer portal. ask clone --profile default will display your current skills and allow you to check them out locally for revision. Here are some of my skills.

In Skill Purchase

Having Ask installed on the command line will give you access to the "isp" command which will allow you to add purchases to your skill. Given the checkout of your current skills from the last section you can experiment with adding in skill purchases via ask add isp. You can either add an entitlement purchase or a subscription service. Spending money within Alexa is a deep subject but maybe the easiest use case is to add premium content to your skill and then try to up sell your audience. For example, your skill could tell a joke and then try to sell them premium jokes for a small fee. You can extrapolate from there. A subscription service is more complicated but allows for the possibility of residual income.

The Purchase Experience

A chance for a purchase is the fist step in making your skill more conversational. There are many examples of in skill purchase templates online but I have patched one up that you can fully deploy it in one step. You can clone it to your command line via git clone https://github.com/jdav999/skill-sample-nodejs-fact-in-skill-purchases-master.git This skill gives simple facts on requests and then has the opportunity to buy specialized types of facts. The version from my github has a premium category of science facts. You can tailor this repo for your in skill purchases or use ask add isp to add in skill purchases to your preexisting skills. Once your skill is ready you can fully deploy it right from the command line via ask deploy --profile default. This assumes that you have IAM environmental variables set up on your command line. If you do though, ask deploy will deploy the skill to your portal as well as the Lambda function to your AWS account.

A Sample Purchase

Using the developer portal testing center you can mimic an in skill purchase. It's important to remember that you will never be charged for your own in skill purchases. Here is an invocation of the skill.

The user can then ask "What can I buy?".

You can now see how the user will have a full life cycle transaction within in your skill.

Let the Profiteering Begin

There are limitless ways you can leverage in-skill-purchases to make money. Chances for developers to make money are going to fuel voice interaction technology for the foreseeable future.