In-Skill Purchase Testing Guide
Before you submit a skill that contains in-skill products, your skill should meet all of the certification guidelines for skills. In addition, you should test the in-skill products thoroughly and make sure that they meet the certification requirements provided in this topic.
- Test your skill
- Test products
- Reset purchases using the ASK CLI
- Test consumable purchases when enabling and disabling the skill
- Optionally beta test your skill with in-skill products
- Test your live skill
Test your skill
Make sure to thoroughly test your skill following the guidelines for custom skills. See Test and Debug a Custom SKill for more information.
You need to test your skill and the purchase experience thoroughly. You can test your skill that contains in-skill purchases using any of the methods described in Ways to Test Your Skill section. You should use your developer account to test purchasing, declining, and asking for refunds or cancellations of your products when your skill is in the development stage. Also test purchasing and using up consumable products. Note that the developer account associated with the skill is never charged for in-skill products.
Reset purchases using the ASK CLI
When you test your in-skill products with your development account, you can use the reset-isp-entitlement command to reset the status of an in-skill purchase. This command resets the provided product as follows:
Test consumable purchases when enabling and disabling the skill
For consumable purchases, test that the user's inventory is retained when the user disables and 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) does not exactly correspond to the number of items the user still has.
See Maintain the user inventory if the user disables and re-enables the skill for details about how the
userId is retained for users who have made consumable purchases.
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 can safely clear data associated with the user. In this case, the user is assigned a new
userIdif 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 that contains in-skill purchases before submitting it for certification. When you offer your skill for beta testing:
- A beta tester will not be charged for in-skill purchases during the beta test
- You cannot reset the products for a beta-tester while the skill is being beta-tested
- When the beta tests ends, the purchased products are automatically reset. When the skill is live, the user will be 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, you need to maintain the beta user's beta inventory separately. When your skill is published live, Alexa resets the user's purchases and returns 0 for
activeEntitlementCount. Any items that the user purchased during the beta should not 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 for the product. For a beta user, this returns
TEST. For a live skill, this returns
Test your live skill
As mentioned previously the developer account associated with a skill never incurs the cost of the in-skill purchases. Therefore, to fully test the end-user experience, you should complete a final test pass with an account other than your developer account. This account will be charged for the in-skill purchases.