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:

Workflow: Add ISP to your skill

Complete the following steps to add ISP to your skill.

  1. Design purchase and cancel flows
  2. Create in-skill products
  3. Add purchase and cancel intents to your interaction model
  4. Add the purchase and cancel requests in your skill code
  5. Test your skill
  6. Provide publishing information
  7. 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:

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 in the Alexa Developer Console.


Was this page helpful?

Last updated: Mar 26, 2024