Help Needed with Amazon Pay Integration for Alexa



Great! Just for future reference. Where was the problem?

After you’ve sent the setup directive, you will receive a custom request called Connections.Response. Jovo automatically maps that request to the ON_PURCHASE() intent.

That request will contain a payload object, which should have an attribute called billingAgreementId that you need to be able to send the charge directive, which, as the name says, is used to charge the customer.

Here’s a sample payload object from the official docs:

            "addressLine1":"1234 Main Street",
            "name":"Jane Doe",
            "addressLine1":"1234 Main Street",
            "name":"Jane Doe",

I’ve never tested it myself, but I don’t see any reason why you shouldn’t be able to.



Hi Kaan, thanks for your help. There wasn’t a problem as such, just me misunderstanding. I realised the card I was sending appeared in the user’s Alexa app. Using the card, I can now get read/write access permissions from the user for their lists and also Amazon Pay.

I was reading the docs myself last night. Thanks for confirming this. I will now attempt to send the charge directive using the billingAgreementId I get from the response. Here goes…


Hi Jan/Kaan,

I’ve sent the setupDirective, and I can confirm that the response is coming back to the ON_PURCHASE() intent. There are two issues I need help with now:

Firstly, I’m having great difficulty in logging the request object:

const request = this.$request.toJSON(); // access the request object

I’ve not worked with Node.js in a project before, and normally I use console.log to check things. I set up the ON_PURCHASE() intent like this:

        const request = this.$request.toJSON(); // access the request object


Do you know how I can see the log inside Lambda? I’ve looked at the CloudWatch logs when I do a test in the Alexa Developer Console and the logs are working but there’s no sign of my console.log(request) output.

In a very hacky attempt, I applied JSON.stringify to the request, then I used this.tell('Here is the request: ' + requestStringified + ' .'). It was pretty funny when Alexa started reading back the JSON! But obviously, this is not the right way to do things. There’s an 8000 character limit on the speech anyway so I couldn’t retrieve all the JSON even if I wanted to format it in a text editor for reading.

I need to read/check the details of the request.payload object. Once I’ve checked that, I can work on sending the charge directive.

Which leads me to my next question:

After reading the Amazon docs, there seems to be no reference to a particular product in the requests or responses. It seems as though this process is just setting up the ability to charge the customer a certain amount. It doesn’t say how the fulfillment is done.

Do you know how I can add an item to the customer’s basket from the Amazon store?

Many thanks,



I’m getting the console.log to show up in the CloudWatch logs now. Turns out you need to add the following permissions in your IAM Permissions Policy:

  "Version": "2012-10-17",
  "Statement": [
      "Effect": "Allow",
      "Action": [
      "Resource": "*"
      "Effect": "Allow",
      "Action": [
      "Resource": "arn:aws:logs:*:*:*"


Okay guys, I can see you are busy. If you could let me know when you can get back in touch that would be great. I’ve managed to get the transaction working with the setup and charge directives.

If we can’t add products to our user’s basket with Jovo I’m not sure what we will do next…


Hi @simon.revill, we’re doing our best, but please keep in mind that this is free community support, which sometimes takes time when other things come up. After all, we need to pay the bills as well :slight_smile:

Have you consulted the Amazon Pay support? We’re no Amazon Pay experts, we just built the integration with their API, anything beyond that is difficult for us to debug.

This is great, so everything works beside putting something into the Amazon basket? Does the “charge later” functionality maybe work for something like this?


Thanks Jan. I appreciate your efforts with helping me.
I will get in touch with Amazon Pay support and let you know what I find out.