Test In-Skill Purchasing Skills
Before you submit your skill for certification, you should test your skill functionality and the in-skill purchase flow. For details about testing custom skills, see Test and Debug a Custom Skill. Your skill must also meet the certification requirements for custom skills. For details about certification testing, see Certify and Publish Your Skill.
- Test the purchase flow
- Test products for different regions
- Test consumable purchases when enabling and disabling the skill
- Optionally beta test your skill with in-skill products
- Test your live skill
- Related topics
Test the purchase flow
Test your purchase flow thoroughly by using your developer account. Include the following test scenarios:
- Decline a purchase
- Refund a purchase
- Cancel a purchase
- Use consumable products
- Renew a subscription
When your skill is in the development stage, the developer account associated with the skill is never charged for in-skill products. For details about testing in the developer console, see Test Your Skill.
Reset test purchases
When you test your in-skill products with your development account, you can reset the status of an in-skill purchase as follows:
To reset purchases for a product with the developer console:
- Edit a custom skill in the developer console.
- On the Build page, select a locale that supports in-skill purchasing.
- Under Skill builder checklist, click In-Skill Products (ISP).
- Find the product in the Linked to this skill list, and then click the Reset test purchases link.
To reset purchases for a product with the Alexa Skills Kit (ASK) Command Line Interface (CLI), use the
Test products for different regions
If your skill supports in-skill purchasing in multiple regions, you can use the Alexa Simulator to test in-skill purchasing in the default locale for each region (marketplace). When you use the Alexa Simulator, you can test each region by using your developer account. If you want to test on a physical Echo device, you must create an account in each region.
To test in-skill purchasing for each region, do the following:
- Login to the Alexa developer console.
- Find your skill in the list. Under Actions, choose Edit.
- At the top of the page, select Test.
- On the Test page, for Test is disabled for this skill, select Development.
Under Alexa Simulator, select the locale for which you want to test in-skill purchasing.
- Use voice or text to launch your skill, and then interact with your skill appropriately. Based on the locale that you selected, the Alexa Simulator uses the price that corresponds to the default locale for the region in the purchasing flow. The default locale is en-US for
amazon.com, en-GB for
amazon.co.uk, de-DE for
amazon.de, and ja-JP for
Test consumable purchases when enabling and disabling the skill
It's important to test that the skill saves the user's consumable purchase inventory between skill sessions. Make sure to test
that your skill retains the user's inventory when the user disables, and then re-enables the skill. When doing this test, make some consumable purchases and use the items so that the
activeEntitlementCount (the total number of purchases) doesn't correspond to the number of items the user still has.
If you use the
AlexaSkillEvent.SkillDisabled event to perform cleanup when a user disables your skill, be sure test these conditions:
- When a user with consumable purchases disables the skill, your cleanup logic retains the user's inventory.
- When a user without consumable purchases disables the skill, your cleanup logic clears the data associated with the user. Here, Alexa assigns the user a new
userIdwhen they re-enable the skill.
Optionally beta test your skill with in-skill products
You can use the beta-testing tool to further test your skill before submitting it for certification. When you offer your skill for beta testing:
- A beta tester isn't charged for in-skill purchases during the beta test.
- You can't reset the products for a beta-tester during beta testing.
- When the beta tests ends, the purchased products are automatically reset. When the skill is live, the user is charged for in-skill purchases.
Beta test for consumable products
If you plan to do a beta test on a skill that offers consumable products, maintain the beta user's inventory separately. After Amazon publishes your skill, Alexa resets the user's purchases and returns 0 for
activeEntitlementCount. Any items that the user purchased during the beta won't be available in the live skill.
For example, suppose your beta user purchased your "five hint pack" three times during beta. Your inventory for this user therefore contains 15. When the skill goes live, the inventory you saved (15) is now out of sync with the actual live purchases (0).
To keep the beta and live inventories separate, check the
purchaseMode property in for the product. For a beta user, this returns
TEST. For a live skill, this returns
Test your live skill
The developer account associated with a skill never incurs the cost of the in-skill purchases during development. To fully test the end-user experience, you should complete a final test pass with an account other than your developer account. All in-skill purchases are charged during live skill testing.