Steps to Add In-Skill Purchasing to Your Skill
If you want to sell premium content in a custom skill, you define in-skill products, such as subscriptions, consumables, or one-time purchases. You update your interaction model to include custom intents to support user requests to purchase and cancel products. You add purchase flows to your skill logic to transfer control to Alexa to guide the customer through the purchase.
Complete the following steps to add in-skill purchasing (ISP) to your skill. For an overview of ISP, see Understand In-Skill Purchasing.
Prerequisites
To use in-skill purchasing, you skill must comply with the following prerequisites:
- Your skill is a custom skill that uses the custom voice interaction model.
For more details, see Understand Custom Skills and Create the Interaction Model for Your Skill. - You offer in-skill purchasing in the supported locales.
Workflow: Add ISP to your skill
Complete the following steps to add ISP to your skill.
- Design purchase and cancel flows
- Create in-skill products
- Add purchase and cancel intents to your interaction model
- Add the purchase and cancel requests in your skill code
- Test your skill
- Provide publishing information
- Submit your skill for certification
Step 1: Design purchase and cancel flows
When you add in-skill purchasing to your skill, you design the purchase suggestion, the transfer to Alexa to complete the purchase, and the seamless flow back to your skill. You also design flows for direct purchase, cancellation, and refund. For details, see Design the Purchase Flows for In-Skill Products.
Step 2: Create in-skill products
To sell premium content in your skill, define one or more in-skill products and associate them with your skill. An in-skill product defines the payment model and details, such as purchase description, purchase prompt, and pricing. You can create a product and link it to a skill. Or, you can create products and link them at a later time. Use the product descriptions and prompts that you defined during the design phase.
You can use any of the following tools to create products and associate them with your skill:
- Create and Manage In-Skill Products in the Alexa Developer Console
- Create and Manage In-Skill Products with the ASK CLI
- In-Skill Product Management REST API Reference
Step 3: Add purchase and cancel intents to your interaction model
Next, add custom intents to your interaction model for the purchase and cancellation flows. These intents support the cases when a customer asks Alexa to buy, cancel, or refund your products directly. For more details, see Create Intents, Utterances, and Slots. If your skill offers consumable products, provide an intent that lets the user ask for their consumable product inventory.
The following example shows buy and cancel intents for a Quick Trivia skill that offers two in-skill products.
{
"interactionModel": {
"languageModel": {
"invocationName": "quick trivia",
"intents": [{
"name": "AMAZON.CancelIntent",
"samples": []
},
{
"name": "AMAZON.HelpIntent",
"samples": []
},
{
"name": "AMAZON.StopIntent",
"samples": []
},
{
"name": "AMAZON.NavigateHomeIntent",
"samples": []
},
{
"name": "AMAZON.FallbackIntent",
"samples": []
},
{
"name": "BuyIntent",
"slots": [{
"name": "your-product-name",
"type": "LIST_OF_PRODUCT_NAMES"
}],
"samples": [
"buy your-product-name",
"purchase your-product-name",
"want your-product-name",
"would like your-product-name"
]
},
{
"name": "ShopIntent",
"slots": [],
"samples": [
"what can i buy",
"what can i shop for",
"tell me what I can buy",
"buy",
"shop",
"purchase"
]
},
{
"name": "CancelProductIntent",
"slots": [{
"name": "your-product-name",
"type": "LIST_OF_PRODUCT_NAMES"
}],
"samples": [
"cancel your-product-name",
"stop your-product-name",
"don't want your-product-name",
"refund your-product-name"
]
}
],
"types": [{
"name": "LIST_OF_PRODUCT_NAMES",
"values": [{
"id": "reference_name_1",
"name": {
"value": "Product A",
"synonyms": ["A product"]
}
},
{
"id": "reference_name_2",
"name": {
"value": "Product B",
"synonyms": ["B product"]
}
}
]
}]
}
}
}
Step 4: Add the purchase and cancel requests in your skill code
In this step, you add the customer entitlement query, and purchase and cancel requests to your skill code as follows:
- At the start of each skill session, get the list of in-skill products that are available to the customer to determine paid products and the products to offer for sale.
- Add support for the direct purchase request.
- Offer purchase suggestions to the customer while they're interacting with your skill.
- Handle cancel and refund requests.
- Add the code to transfer control to the Amazon purchase flow and code to resume your skill after the purchase or cancellation.
- If you offer consumables, manage the inventory as the customer uses the purchase items.
For more details, see Add ISP Support to Your Skill Code.
Step 5: Test your skill
When you're ready to test your skill, you can use the Alexa simulator in the Alexa developer console to test skill functionality and the purchase and cancellation flows. When your skill is in the development stage, the developer account associated with the skill is never charged for in-skill products. For details, see Test In-Skill Purchasing Skills.
Step 6: Provide publishing information
To distribute your skill to the Amazon Alexa Skills Store, you must fill out the required metadata for your skill on the Distribution tab in the developer console. Make sure that you provide links to a privacy policy and terms of use page and that all tappable and clickable links open and display properly on iOS , Android and desktop devices. In the test instructions specify each in-skill product name and how to reach the purchase prompts for each product.
After you complete and save the skill information, you can distribute your skill for beta testing or submit it for certification.
Step 7: Submit your skill for certification
Before you submit your skill for certification, make sure that your skill passes all certification testing requirements. You must also complete the tax identity interview and enter payment information. Then, review Certify In-Skill Purchasing Skills for test cases that your skill should pass before skill submission.
To submit your skill for certification, see Submit Skills for Certification.
Related topics
- Paid Skills Interface Reference
- Paid Skill Schemas
- ASK SDK for Node.js Monetization Service Client
- ASK SDK for Python Monetization Service Client
Last updated: May 01, 2024