question

JakeR avatar image
JakeR asked

Alexa in-skill purchase subscription has status "purchasableState": "PURCHASABLE" according to the ASK-CLI, but has status "purchasable": "NOT_PURCHASABLE" in the Lambda Cloudwatch logs.

I'm trying to to test my in-skill purchasable subcription in the Alexa simulator, but am running into problems on the Alexa server side.

Here my the status of my created subscription in the ASK-CLI:

[
  {
    "editableState": "EDITABLE",
    "lastUpdated": "2018-07-29T16:09:21.073Z",
    "nameByLocale": {
      "en-US": "my product"
    },
    "pricing": {
      "amazon.com": {
        "defaultPriceListing": {
          "currency": "USD",
          "price": 4.99,
          "primeMemberPrice": 4
        },
        "releaseDate": "2018-07-28T00:00:00Z"
      }
    },
    "productId": "amzn1.adg.product.XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    "purchasableState": "PURCHASABLE",
    "referenceName": "my-product",
    "stage": "development",
    "status": "COMPLETE",
    "type": "SUBSCRIPTION"
  }
]

I've used the command 'ask deploy' around 20 times at this point and it successfully uploads to my alexa skill and Lambda.

I'm following the template from here when implementing my BuyHandler for this purchasable: https://github.com/alexa/skill-sample-nodejs-fact-in-skill-purchases

In my buy handler, when a user has confirmed their BuyIntent I run the following code to get my subscription object in Lambda:

 const locale = handlerInput.requestEnvelope.request.locale;
 const ms = handlerInput.serviceClientFactory.getMonetizationServiceClient();
 return ms.getInSkillProducts(locale).then(function initiatePurchase(result) {
	... rest of code below ...

However in my result object that gets returned in initiatePurchase, here is my subscription obejct:

[{
    "productId": "amzn1.adg.product.amzn1.adg.product.XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
    "referenceName": "my-product",
    "type": "SUBSCRIPTION",
    "name": "my product",
    "summary": "This is a valuable product. ",
    "entitled": "NOT_ENTITLED",
    "purchasable": "NOT_PURCHASABLE"
}
]

At this point I'm hesitant because my subscription is "PURCHASABLE" in my ASK-CLI, but not here. To create my 'Buy' directive, I still proceed and enter the 'productId' in the 'Connections.SendRequest' directive. Here is the code:

return handlerInput.responseBuilder
        .addDirective({
          type: 'Connections.SendRequest',
          name: 'Buy',
          payload: {
            InSkillProduct: {
              productId: subcriptionId, // Insert my productId here
            },
          },
          token: 'correlationToken',
        })
        .getResponse();

And alas I receive this response:

"request": {
        "type": "Connections.Response",
        "requestId": "amzn1.echo-api.request.XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX",
        "timestamp": "2018-07-29T17:07:01Z",
        "locale": "en-US",
        "status": {
            "code": "400",
            "message": "BAD REQUEST"
        },
        "name": "Buy",
        "payload": {
            "message": "This feature is not supported."
        },
        "token": "correlationToken"
    }

This time the error is saying the entire feature of purchasing a subscription is not supported. For further testing I cloned the entire test repo here: https://github.com/alexa/skill-sample-nodejs-fact-in-skill-purchases, ran it, and got the same error at the same spot.

I'm working currently in Canada but have all my account settings set to the US. I'm just trying to test, not certify/publish my skill. Any ideas? My tin foil theory is that I need to change my IP address to the US but I doubt that is the case.

Thank you for all ideas/feedback.

alexa skills kitask clialexa simulatorpurchasing
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.

Thanks for your patience waiting, sorry about the confusion, please allow me to make a correction. The way Amazon determines whether you are eligible to purchase the ISP is that whether your retail Amazon account (the one you used to login to www.amazon.com) associated with your developer account has a Country Of Residency "US", if you are the developer and testing your own ISP. Can you check how do you set your major payment method: billing address and shipping address in your retail account? And what is your SkillId?

0 Likes 0 ·
KAIYIN@AMAZON.COM avatar image
KAIYIN@AMAZON.COM answered

Thank you for your post, this error would only occur if your developer account which you used to test is configured with a non-US address. Could you double check if that's the case for you? If your developer account has a US address but still see this issue, we will report it to internal development team.

10 |5000

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

KAIYIN@AMAZON.COM avatar image
KAIYIN@AMAZON.COM answered

Thanks for your patience waiting, sorry about the confusion, please allow me to make a correction. The way Amazon determines whether you are eligible to purchase the ISP is that whether your retail Amazon account (the one you used to login to www.amazon.com) associated with your developer account has a Country Of Residency "US", if you are the developer and testing your own ISP. Can you check how do you set your major payment method: billing address and shipping address in your retail account? And what is your SkillId?

2 comments
10 |5000

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

Now that ISP is available in other countries like France, Is this rule still valid ? Or a French developer can now develop ISP skills while being located in FR ?

0 Likes 0 ·

Hi @GuillaumePelouas and sorry for taking so long to reply to you.

Since ISP is now available in France, you are able to develop skills with a French language model that are able to interact with the ISP service.

The ability to buy such products also depends on the country that the user has registered their account. For example, a French speaking user that has registered their account in the Brazilian Amazon portal will not be able to purchase ISP.

In order to change the country where your account is registered, you can go to your account's settings in the Amazon portal then click on "Manage content and devices" under "Digital content and devices". From the new page that opens, click on "Country/Region Settings" and then select your desired country.

Regards,
Barry

0 Likes 0 ·
JeffSavin avatar image
JeffSavin answered

Hi, I'm experiencing the same issue as JakeR. I'm physically in Canada trying to test my own skill's ISP, but I'm from the US and my developer account, my retail account associated with the developer account, and my echo device have US addresses. The following command shows my skill id and the associated product, which comes up as "PURCHASABLE."

ask api list-isp-for-skill -s amzn1.ask.skill.6d5f4537-7ae0-4112-bb0e-2a2a536e6a27 -g development
[
  {
    "editableState": "EDITABLE",
    "lastUpdated": "2019-01-03T04:13:03.003Z",
    "nameByLocale": {
      "en-US": "Valid Word List"
    },
    "pricing": {
      "amazon.com": {
        "defaultPriceListing": {
          "currency": "USD",
          "price": 2.99,
          "primeMemberPrice": 2.4
        },
        "releaseDate": "2019-01-01T00:00:00Z"
      }
    },
    "productId": "amzn1.adg.product.764acb7a-0fbe-4c52-9e26-add3dbc93148",
    "purchasableState": "PURCHASABLE",
    "referenceName": "word_list",
    "stage": "development",
    "status": "COMPLETE",
    "type": "ENTITLEMENT"
  }
]

However, in the skill, when I'm testing, the inSkillProducts endpoint returns the following:

{
  'nextToken': None,
  'truncated': False,
  'inSkillProducts': [
    {
      'entitlementReason': 'NOT_PURCHASED',
      'purchaseMode': 'TEST',
      'activeEntitlementCount': 0,
      'name': 'Valid Word List',
      'purchasable': 'NOT_PURCHASABLE',
      'summary': 'Make scoring easier by automatically seeing all the valid words for any given grid.',
      'referenceName': 'word_list',
      'productId': 'amzn1.adg.product.764acb7a-0fbe-4c52-9e26-add3dbc93148',
      'type': 'ENTITLEMENT',
      'entitled': 'NOT_ENTITLED'
    }
  ]
}

Any help on what could be the issue?

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.

Hello @JeffSavin and sorry it took so long to reply to you.

Are you still facing this issue? Can you confirm if the language of the device you are using to test your skill is set to English (United States)?

You can have a device with an address in the United States but with a different language.

Regards,
Barry

0 Likes 0 ·
newuser-716d22de-ca29-4a5d-b0b1-108baf12d453 avatar image
newuser-716d22de-ca29-4a5d-b0b1-108baf12d453 answered

Same issue.

It was working for me. Then stopped working today and I have the same messages as the guys above. I am in the UK and have a US account set up to do this, that was working fine yesterday.

Any ideas?

3 comments
10 |5000

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

I’m also seeing my products as ‘NOT_PURCHASABLE’, with a US developer account being used in the UK. This was working fine with the same account until today. The account has a US address associated with it.

1 Like 1 ·

Seems to be working again now. I did not change anything so must have been an Amazon Issue! Was down for at least 7 hours.

0 Likes 0 ·
newuser-3ec2300d-6a5f-4ddc-ba41-5f6f829b29e8 avatar image newuser-3ec2300d-6a5f-4ddc-ba41-5f6f829b29e8 newuser-716d22de-ca29-4a5d-b0b1-108baf12d453 ·

Yes, working again for me too this morning, without making any changes from my side.

0 Likes 0 ·