logo

... you might expect that it has Alexa support, and you would be right - you can give commands to the Fire TV Stick using Alexa skills, and control all the ...
Source: Alexa Skills - Google Alert RSS

... Alexa is HIPAA-compliant and that five healthcare companies including Cigna, Livongo Health and hospital partners have created new Alexa skills, ...
Source: Alexa Skills - Google Alert RSS

b895dd2c0d1ae02f997ffbec94e9f036cf943a3f171b8a7911e538623f37de8b_c95fe012-f03e-4fd7-8add-70cf1b8958d4.png

With Amazon Pay for Alexa Skills, you can sell real-world goods and services such as tickets for movies or concerts, car pick up services, food, and more. You can reach customers around the world through an interaction as natural as voice, powered by a seamless payment processing flow handled by Amazon Pay.

Developers are already using Amazon Pay to bring a variety of real-world products to voice. For example, the British rail operator Virgin Trains is able to sell train tickets to customers directly through their Alexa-enabled device.

After building an engaging voice experience, you’re ready to learn more about monetizing your Alexa skill using Amazon Pay for Alexa Skills. This post will show you how to add Amazon Pay to your skill in just a few simple steps. Before you start, sign-up as an Amazon Pay merchant. Learn more in our guide.

The Amazon Pay for Alexa Skills APIs consist of only two operations - Setup and Charge. We will walk you through both, below.

Setup

Setup will create an agreement between your merchant account and the buyer, called a BillingAgreement, which will be used to charge the customer in a later step. Amazon Pay uses Alexa Skill Connections to have your skill interact with the Amazon Pay services. To initiate the creation of the agreement, we create a matching Connections directive to call the setup operation.

let setupDirective = {
    'type': 'Connections.SendRequest',
    'name': 'Setup',
    'payload': {
        '@type': 'SetupAmazonPayRequest',
        '@version': '2',
        'sellerId': 'AEMGQXXXKD154',
        'countryOfEstablishment': 'US',
        'ledgerCurrency': 'USD',
        'checkoutLanguage': 'en-US',
        'needAmazonShippingAddress': true,
        'billingAgreementAttributes': {
            '@type': 'BillingAgreementAttributes',
            '@version': '2',
            'sellerNote': 'Thanks for shaving with No Nicks',
            'sellerBillingAgreementAttributes': {
                '@type': 'SellerBillingAgreementAttributes',
                '@version': '2'
            }
        }
    },
    'token': 'IK1yRWd8VWfF'
};

First, we define the Connections.SendRequest directive for the Amazon Pay Setup operation. The payload inside the directive defines all Amazon Pay relevant information. The most essential ones are the sellerId, which defines who is initiating the charge, the countryOfEstablishment and ledgerCurrency define how to charge the customer. For definitions of all other fields, refer to our comprehensive guide linked to in the resources section.

You'll notice, we did not define how much to charge yet. This is subject to the Charge operation, if you charge inside your skill, or any other service using our backend APIs, you are charging “offline”.

Adding the directive to your response is fairly simple:

return handlerInput.responseBuilder
            .addDirective(setupDirective)
            .withShouldEndSession(true)
            .getResponse();

Note: the reason we end the session is because the Connection.Request will terminate your skill session and invoke it again with a Connections.Response. If you do not end your session or add a re-prompt, it will result in an error.

To catch the response, simply define a handler for the Connections.Response request

canHandle(handlerInput) {
    return handlerInput.requestEnvelope.request.type === "Connections.Response"
    && handlerInput.requestEnvelope.request.name === "Setup";
}

;

The payload of the response will contain the billingAgreementId needed to charge the customer.

Charge

Amazon Pay can help you with a variety of use cases. We classify them as the payment workflows, Charge Now and Charge Later.

Charge Now allows you to sell real-world goods (e.g. tickets, clothing, etc.) and charge the buyer while they are still interacting with your skill. It's a perfect match for one-time purchases where you know the exact charge amount. The starter kit in the “No Nicks” demo skill is an example of Charge Now.

Charge Later allows you to setup a BillingAgreement, which represents the buyer's payment and delivery address preferences, if available, and use this agreement to charge the customer at a later point in time via Amazon Pay backend APIs. It's the perfect match when you don't know the exact order total yet - e.g. for up-sell opportunities, pay-as-you-go scenarios or subscriptions, where a buyer will be charged in regular intervals.

In the chargeNow workflow, you can similarly execute a charge request, using the billingAgreementId received in the setup response.

const billingAgreementId = responsePayload.billingAgreementDetails.billingAgreementId;
let directiveObject = {
    'type': 'Connections.SendRequest',
    'name': 'Charge',
    'payload': {
        '@type': 'ChargeAmazonPayRequest',
        '@version': '2',
        'sellerId': 'AEMGQXXXKD154',
        'billingAgreementId': billingAgreementId,
        'paymentAction': 'AuthorizeAndCapture',
        'authorizeAttributes': {
            '@type': 'AuthorizeAttributes',
            '@version': '2',
            'authorizationReferenceId': 'ml3qPJG3nC6c65UE',
            'authorizationAmount': {
                '@type': 'Price',
                '@version': '2',
                'amount': '9',
                'currencyCode': 'USD'
            },
            'transactionTimeout': 0,
            'sellerAuthorizationNote': '',
            'softDescriptor': 'No Nicks'
        },
        'sellerOrderAttributes': {
            '@type': 'SellerOrderAttributes',
            '@version': '2',
            'storeName': 'No Nicks',
            'sellerNote': 'Thanks for shaving with No Nicks'
        }
    },
    'token': 'WASv2lk4pdfI'
}

The charge operation requires you to at least specify the total amount and currency to request from the customer. For a full reference, refer to the comprehensive guide in the resources below.

Just like with the setup phase, we'll add the directive to the responseBuilder when preparing the response.

 return handlerInput.responseBuilder
            .addDirective(directiveObject)
            .withShouldEndSession(true)
            .getResponse();

Once again, define a handler for the Connections.Response request

canHandle(handlerInput) {
    return handlerInput.requestEnvelope.request.type === "Connections.Response"
    && handlerInput.requestEnvelope.request.name === "Charge";
}

The response of the Connections request will tell you if the charge was successful or if there was an issue taking payments.

After a successful purchase, you should send a card to the customer’s Alexa app as an order confirmation, including the order details.

var confirmationCardResponse = 'Your order has been placed.n' +
                             'Products: 1 Starter Kit n' +
                             'Total amount: $9.00n' + 
                             'Thanks for shaving with No Nicksn' +
                             'www.nonicks.com' 
return handlerInput.responseBuilder
                             .speak( config.confirmationIntentResponse )
                             .withStandardCard( 'Order Confirmation Details',                                                                                                                        
                              confirmationCardResponse, config.logoURL )
                             .withShouldEndSession( true )
                             .getResponse( );

 

With just a few simple steps, you’re able to take payments for real-world products or services in an Alexa skill.

Get started today with integrating Amazon Pay into your Alexa skill and join the growing list of voice-first merchants. We can’t wait to see what you build!

Resources

Source: Alexa Developer Blog

Just last month, Amazon announced that it had developed six Alexa skills that are HIPAA compliant -- meaning they meet the regulatory guidelines for ...
Source: Alexa Skills - Google Alert RSS

Amazon added HIPAA compliance to Alexa skills. Now, third party app developers, following guidelines, can create healthcare skills for Alexa.
Source: Alexa Skills - Google Alert RSS

A skill called Interview Prep will also provide some tips and tricks on job interviews. Let's check out the different Alexa skills to help you land the right ...
Source: Alexa Skills - Google Alert RSS

Even as Amazon Alexa now appears on over 30,000 Alexa-compatible smart home devices, Alexa is also helping families to do more in the kitchen. With new innovative microwave products, Alexa can control the appliance from anywhere in the house with simple voice commands. This new functionality is available in an expanded Alexa Smart Home Skill API and helps customers prepare meals by replacing cooking controls like defrost, popcorn mode, time and power that would normally require 5 to 10 button presses with a simple voice command. Additionally, the hands-free ability for a consumer to pause and resume cooking in an oven while they take a call or handle another event is exceptionally useful.

In 2018, Amazon released its first voice-controlled microwave, and GE followed suit. Both microwaves utilize the Alexa voice capabilities. These microwaves provide consumers with easy-to-remember voice commands to prepare common food items like popcorn and frozen pizza.

If your business offers a connected microwave, this blog post will help you create an easy-to-consume food preset catalog that you can associate with your microwave Alexa skill.

The Cooking Interface

To understand how to implement commands for cooking, we will share the steps and best practices to add voice support to cooking devices. As developers integrate cooking-centered voice commands into connected microwaves, one of the first challenges for providing a great user experience is that packaged food items have complicated names. Variations on sub-brands, sizes, and flavors all lead to requiring voice commands that might be challenging for the customer and Alexa. To help simplify and standardize this interface for developers, Alexa defines the Alexa.Cooking Interface. This interface is common to all cooking endpoints and describes the available operations for the device.

The basic voice operation of a microwave would be something like “Alexa, two minutes on my microwave.” This command assumes that customer already placed a food item inside the microwave, and that the customer knows the cooking time required. In case the customer didn’t specify the time, Alexa would ask about the time required to cook the item.

What if customers didn’t know the correct mode and the right amount of time to cook and item? In this case, the Alexa preset cooking comes handy. If the microwave manufacturer has created a preset catalog, cusotmers can only ask Alexa to cook by preset name, without the need to know the mode of the time required. In some cases, preset cooking requires either weight, volume or quantity (count) to perfectly cook the food item. This is determined by the preset catalog author. The author can specify that one or more of these food properties are required to fulfill the request. If it is required, Alexa will ask the customer about count, volume or weight if customer didn’t specify them in the request.

For cooking with preset settings, the Alexa.Cooking.PresetController helps developers define custom cooking settings appropriate for a manufacturer's appliance.

Using a Preset Catalog

If a microwave has an often used or common preset, the developer should consider it to be controlled with voice commands. Specifically, Alexa-enabled microwaves can provide customers with the ability to cook with most of the commonly used recipes and packaged food by simply providing the name of the food. (The food name will be resolved to a slot value, or catalog item, and will be sent to you skill within the Alexia directive.) Using voice means fewer buttons for the customer to press and convenient cooking control while their hands are busy or messy. Beyond stopping and starting cooking, adjustments to power levels and duration are also available. For example, a customer can stop cooking and then instruct Alexa to set the microwave at 80% power for three minutes.

To understand how a preset is used for a cooking device, let’s look at an example. To support a preset for "PRIMO Mango Chicken with Coconut Rice,” the flow from configuration to handling a PresetController directive from Alexa looks like the following:

  1. The developer provides Amazon with a Preset Catalog of supported, custom cooking settings. This includes an entry for “PRIMO Mango Chicken with Coconut Rice.”
  2. After the catalog is ingested by Amazon, the developer will receive a unique preset catalog ID to be used in the discovery response of a cooking device.
  3. The developer builds an Alexa skill that supports the cooking endpoint.
  4. The discovery response returned by the cooking endpoint skill defines the required presetCatalogId (received from catalog ingestion) and supportedCookingModes.
  5. A customer enables the cooking endpoint skill through account linking.
  6. The customer says, “Alexa, microwave the Primo mango chicken with coconut rice.”
  7. Alexa interprets the food and cooking verb from the customer and sends a CookByPreset directive to the cooking endpoint skill.
  8. Using the preset directive information, the cooking endpoint instructs the endpoint to cook on High for two minutes.

To provide cooking by name of an item, it is necessary for Amazon to train Alexa to understand the items in a provided preset catalog to offer the best customer experience.

Using the Supported Cooking Modes

A required element of a cooking endpoint is the Supported Cooking Modes. These modes describe the configuration settings for a defined mode.

The current CookingMode values are as follows:

  • Defrost - Cooking appliance is automatically configured to defrost mode
  • Off - Switches off the device
  • Preset - Brings it back to its automated cooking
  • Reheat - Sets it to reheating mode
  • TimeCook - Sets the time and power level for cooking

For example, an endpoint with the Defrost cooking mode defined could support the following user utterance: "Alexa, defrost two pounds of chicken.” In this example, the Preset is a chicken, while the Cooking Mode will be set to DEFROST. Alexa has support for food quantities, count or weight when using the preset cooking functionality.

Best Practices for Authoring the Preset Catalog

For most customers, it can be tedious when mentioning the full name of the item they want to cook in the microwave. For instance, having to say, “Alexa, microwave PRIMO Frozen Sandwiches Four Meat and Four Cheese Pizza” and “Alexa, cook ALWAYS-FRESH Frozen Sandwiches Pepperoni and Sausage Pizza.” Those two items have the same cooking instructions, and customers end up omitting the brand name. This omission might lead to preset name failure.

To overcome this problem, avoid repeating the same words in more than one item; this makes detection more difficult. Understanding that only the Preset Name and Cooking Mode are required, it is recommended to group similar items by the mode of cooking and not the item name. For example, the following two items share the same cooking mode and time settings, as well as the general item name, but are from different brands:

In this scenarios, group these two items into one preset record: HERB ROASTED CHICKEN.Users can say, “Alexa, cook Herb Roasted Chicken” or “Alexa, Microwave Herb Roasted Chicken.” In this case, there is a preset on this microwave for Herb Roasted Chicken. Alexa sends a Cook By Preset directive with details about the food.

Conclusion

Developers should understand the challenges of voice recognition when undertaking Preset Cooking and should expect that Preset Catalog Item names reflect the most common way people identify or describe the cooked item. This is not necessarily the actual name on the box label. You should research how your customer names or refers to the supported food items that are to be used by your endpoint. Additionally, focus on how an item is cooked using your device and not the preset name.

Additional Resources

Source: Alexa Developer Blog

Amazon's Alexa contains multitudes. Today, Alexa can perform more than 90,000 skills and counting. Did you know you can ask her to remember ...
Source: Alexa Skills - Google Alert RSS

... Morgan Stanley Announces Amazon Alexa Skills – Offering Original Content and Market Insights Via Easy Voice Command; 15/05/2018 – Amazon ...
Source: Alexa Skills - Google Alert RSS

The news follows the introduction of health care Alexa skills for Echo devices earlier this year. Amazon's HIPAA-eligible skills are being used to do ...
Source: Alexa Skills - Google Alert RSS