question

jvgough avatar image
jvgough asked

In-Skill purchases not working

Hello,


I'm in the process of adding an in-skill purchase to my skill. I created a product. In Lambda, I'm returning the purchase delegate by itself (which I think is the correct syntax), but when I ask for the purchase intent, Alexa responds with "There was a problem with the requested skill's response."

It's not a Lambda problem, as my Python code correctly returns JSON. I'm not sure what's going on as I do not know if I'm able to monitor Alexa's errors via Cloudwatch. Can someone confirm?


Here is what I'm returning from Lambda (replaced the productID with my own):

{
        'type': 'Connections.SendRequest',
        'name': 'Buy',
        'payload': {
                    'InSkillProduct': {
                        'productId': "productID_GOESHERE"
                    }
        },
        'token': 'correlationToken'
    }


Any help would be appreciated!

alexalambdapurchasing
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jvgough avatar image
jvgough answered

I figured it out. I needed to return the entire body JSON response. In addition to that, the ShouldEndSession should be False.


{
  "version": "1.0",
  "sessionAttributes": {},
  "response": {
    "shouldEndSession": false,
    "directives": [
      {
        "type": "Connections.SendRequest",
        "name": "Buy",
        "payload": {
          "InSkillProduct": {
            "productId": "xxxxProductIDxxxxx"
          }
        }
      }
    ]
  }
}
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jvgough avatar image
jvgough answered

This is a bump.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Anand@Amazon avatar image
Anand@Amazon answered

Hey @jvgough

Please share skill ID I will take a look.

1 comment
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Should I share it here or in a message? Is that supposed to be private or does it not matter?

0 Likes 0 ·