Test In-Skill Purchasing Skills
Before you submit your skill for certification, 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 your purchase flow thoroughly by using your developer account. Include the following test scenarios:
- Decline a purchase suggestion
- Decline a purchase
- Refund a purchase
- Cancel a purchase
- Use consumable products
- Check consumable inventory
- 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 Skills in the Alexa Developer Console.
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 in the Alexa developer console
- Edit a custom skill in the developer console.
- On the Build page, select a locale that supports in-skill purchasing.
- On the left pane, select TOOLS > Monetize Your Skill.
- On Choose how you want to monetize your skill, for Skill Monetization Model, select Add In-Skill-Products, and then click Next.
- For Linked to this skill list, find the product that you want to reset, 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
- 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.
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 that you 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.
- After the skill is live, Amazon charges the user 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 the response from the Get customer entitlement API. The value indicates whether the customer made the purchase in a beta test (
TEST) or live skill (
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. Amazon charges for all in-skill purchases during live skill testing.
Was this page helpful?
Last updated: Jan 26, 2024