More Related Content Similar to Use Alexa Skills to Buy Digital Content: A Workshop for In-Skill Purchasing (ALX401-R2) - AWS re:Invent 2018 (20) More from Amazon Web Services (20) Use Alexa Skills to Buy Digital Content: A Workshop for In-Skill Purchasing (ALX401-R2) - AWS re:Invent 20182. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Welcome to today’s workshop!
To successfully complete this workshop, you’ll need:
• An AWS account - https://aws.amazon.com
• An Amazon Developer account - https://developer.amazon.com/alexa-
skills-kit
• The ASK-CLI installed on your laptop - https://alexa.design/cli-jump-
start
Don’t have these all ready to go? While you’re waiting for the session to
start, check out https://alexa.design/isp-workshop-get-ready
3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Use Alexa Skills to Buy Digital
Content: A Workshop for In-Skill
Purchasing
Sampat Biswas
Sr. Software Dev Engineer
Amazon Alexa
A L X 4 0 1
Franklin Lobb
Sr. Solutions Architect
Amazon Alexa
4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
How Alexa In-Skill Purchasing (ISP) works
Creating In-Skill products + lab
Incorporating ISP into your VUI and skill code + lab
Persistent attributes & consumable tracking + lab
Wrap-up
5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is In-Skill Purchasing?
• Used to sell premium (digital) content
• Complements the free experience
• Uses payment options associated with
the customer’s Amazon account
• Currently en-US only
6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What can customers purchase?
8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Let’s talk price
Subscriptions and
one-time purchases
$0.99 - $99.99
Consumables
$0.99 to $9.99
9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
More on price
70%
10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Who does what?
11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Workshop architecture
Skill
• Game to guess TV show
• Sell hints in packs of five
Components
• Alexa Skill Kit
• AWS Lambda
• Amazon DynamoDB
• Alexa Monetization Service
Alexa Skills KitEcho
Amazon DynamoDB
Alexa Monetization
Service
AWS Lambda
12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Adding a consumable
•ask add ispStart from ASK CLI
•ConsumableSelect ISP type
•Consumable_TemplateSelect template
•referenceName in jsonEnter name
14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Consumable ISP JSON—Type and referenceName
{
"version": "1.0",
"type": "CONSUMABLE",
"referenceName": "two_hint_pack",
"publishingInformation": {
"locales": {
"en-US": {
"name": "2 Hint Pack",
…
15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Consumable ISP JSON—Product details
…
"summary": "You can purchase the 2 hint pack to get two hints during game play to help
you guess the number.",
"description": "With the 2 hint pack, you can ask me twice for a hint to help you guess
the number during any game play. Purchase as many as you need or as you go.",
…
"purchasePromptDescription": "The <PREMIUM_CONTENT_TITLE> includes 2 hints you can use
during game play to help you guess the number.",
"boughtCardDescription": "You now have 2 more hints to use. To use hints, say 'Alexa,
give me a hint' during gameplay.“
…
16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Consumable ISP JSON—Pricing and purchasability
…
"pricing": {
"amazon.com": {
"releaseDate": "2018-01-01T00:00Z",
"defaultPriceListing": {
"price": 0.99,
"currency": "USD"
…
"purchasableState": "PURCHASABLE"
17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lab one—Create
consumable products
Objectives
• Deploy skill w/o ISP’s
• Add consumable ISP’s to skill
using the ASK CLI
Alexa Skills KitEcho
Amazon DynamoDB
Alexa Monetization
Service
AWS Lambda
https://alexa.design/isp-workshop-lab-one
18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lab one—Create
consumable products
Completed
Deployed skill w/o ISP’s
Added Consumable ISP’s to
skill using the ASK CLI
Alexa Skills KitEcho
Amazon DynamoDB
Alexa Monetization
Service
AWS Lambda
https://alexa.design/isp-workshop-lab-one
19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Briefly stepping out of the flow
21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• Suggestive of option, based
on context
• Dynamic prompt
• Ends with yes/no question,
for example: Would you like
to learn more?
• If yes, moves directly to buy
• Includes pricing information
(including any discount)
• Purchase prompt is in product
configuration
• If Voice Code is configured,
checked if customer wants to
buy
22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Are there any other adventures
I can try?
23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
We have a jungle adventure which is
available for purchase. Do you want to
know more about it?
Are there any other adventures
I can try?
24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
We have a jungle adventure which is
available for purchase. Do you want to
know more about it?
Are there any other adventures
I can try?
Upsell
25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
We have a jungle adventure which is
available for purchase. Do you want to
know more about it?
Are there any other adventures
I can try?
Yes!
26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
We have a jungle adventure which is
available for purchase. Do you want to
know more about it?
Are there any other adventures
I can try?
Yes!
The jungle adventure is amazing. Prime
members save 19 cents, without Prime
it costs 99 cents. Would you like to buy
it?
27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
We have a jungle adventure which is
available for purchase. Do you want to
know more about it?
Are there any other adventures
I can try?
Yes!
The jungle adventure is amazing. Prime
members save 19 cents, without Prime
it costs 99 cents. Would you like to buy
it?
Buy
28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
I want to buy the jungle
adventure.
29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
I want to buy the jungle
adventure.
The jungle adventure is
amazing. Prime members save
19 cents, without Prime it
costs 99 cents. Would you like
to buy it?
Buy
30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Purchase process
ACCEPTED
DECLINED
Connections.SendRequest
Connections.Response
Upsell
Buy
33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Upsell directive
return handlerInput.responseBuilder
.addDirective({
'type': 'Connections.SendRequest',
'name': 'Upsell',
'payload': {
'InSkillProduct’: { 'productId': HINT_PACK_PRODUCT_ID
},
'upsellMessage': 'You do not have any available hints
to use. Want to learn more about how to purchase?'
},
'token': 'correlationToken' }) .getResponse();
34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Buy directive
return handlerInput.responseBuilder
.addDirective({
'type': 'Connections.SendRequest',
'name': 'Buy',
'payload’: {
'InSkillProduct’: { 'productId': HINT_PACK_PRODUCT_ID }
},
'token': 'correlationToken'
}) .getResponse();
35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Connections response
36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Testing In-Skill Purchasing
Developer (account)
• Never pays—no money changes
hands—even after going live
• Reset using ASK CLI
Beta tester
• During beta test, does not pay
• Reset during beta test using ASK CLI
• Automatically reset at end of beta test
• Purchases do not carry over
37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lab two—VUI and skill
code updates
Objectives
• Update voice interaction
model to include buy, upsell,
and other ISP related intents
• Update the skill code to
handle new intents
• Update the skill code to send
connections directives and
handle connections events
Alexa Skills KitEcho
Amazon DynamoDB
Alexa Monetization
Service
AWS Lambda
https://alexa.design/isp-workshop-lab-two
38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lab two—VUI and skill
code updates
Completed
Updated voice interaction
model to include buy, upsell,
and other ISP related intents
Updated the skill code to
handle new intents
Updated the skill code to
send connections directives
and handle connections
events
Alexa Skills KitEcho
Amazon DynamoDB
Alexa Monetization
Service
AWS Lambda
https://alexa.design/isp-workshop-lab-two
39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Three types of attributes in the SDK
Request
attributes
Session attributes
Persistent
attributes
41. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Connect to Amazon DynamoDB
const skillBuilder = Alexa.SkillBuilders.standard();
exports.handler = skillBuilder .addRequestHandlers( // ... handlers )
.addRequestInterceptors( // ... request interceptors )
.addResponseInterceptors( // ... response interceptors )
.addErrorHandlers(ErrorHandler)
.withTableName(“mySkillName")
.withAutoCreateTable(true)
.lambda();
42. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Get persistent attributes
43. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Set persistent attributes
44. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Save persistent attributes
45. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
46. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Consumable lifecycle events
• Initialize when first run (zero out)
• Consume it (decrement)
• Refill—purchase more (increment)
• Return / Cancel (decrement)
• Inventory check (current value) Inventory
Initialize
Consume
RefillReturn
Check
47. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What should be tracked?
Required
• Remaining inventory
Strongly recommended
• Total purchased
Optional
• Expiration timestamp
• Purchase/usage history
0
1
2
3
4
5
6
1 2 3 4
48. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
To stack or not to stack?
49. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Out of skill “experience”—Customer refunds
50. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Re-enablements with consumables
User id = ABC123User id = XYZ321
51. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Promo codes
52. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lab three—
Consumable tracking
Objectives
• Use persistent attributes to
track consumable inventory
levels
• Test by purchasing and
consuming hints
Alexa Skills KitEcho
Amazon DynamoDB
Alexa Monetization
Service
AWS Lambda
https://alexa.design/isp-workshop-lab-three
53. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lab three—
Consumable tracking
Completed
Used persistent attributes to
track consumable inventory
levels
Tested by purchasing and
consuming hints
Alexa Skills KitEcho
Amazon DynamoDB
Alexa Monetization
Service
AWS Lambda
https://alexa.design/isp-workshop-lab-three
54. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Congratulations!
Alexa Skills KitEcho
Amazon DynamoDB
Alexa Monetization
Service
AWS Lambda
Today you:
Created a skill
Added consumable ISP
Updated VUI and skill code
Tracked consumables
55. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Next steps
• Add premium content and ISP’s to your skill
• Consider adding additional analytics within your skill
• Conduct a beta test (tweet me and I’ll be a beta tester for your skill)
• Submit for certification
• Monitor your skill’s performance
• Iterate and enhance your skill
https://alexa.design/isp-workshop
56. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Related Sessions
Thursday, November 29th
Deep Dive into Three Critical Aspects of Alexa’s In-Skill Purchase API
11:30 am – 12:30 pm | Bellagio
Wednesday, November 28th
Build an Interactive Alexa Voice Experience for Multiple Screens
7:00 pm – 9:15 pm | Venetian
57. Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Sampat Biswas
@sampatbiswas
Franklin Lobb
@franklinlobb
58. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.