Search code examples
alexa-skills-kitalexa-slot

How do I create a Slot that accepts a currency amount


I want to receive a dollar amount in my utterance. So, for example, if I ask Alexa:

Send $100.51 to Kroger.

(pronounced, One hundred dollars and fifty one cents) I want to receive the value 100.51 in a proper slot.

I have tried searching and I defined my utterance slots like this:

"slots": [
    {
        "name": "Amount",
        "type": "AMAZON.NUMBER"
    } 
]

But on JSON input I only get this result:

"slots": {
    "Amount": {
        "name": "Amount",
        "value": "?"
    }
}

How can I make Alexa accepts currency values?


Solution

  • I'm a bit confused by what you wrote in your last sentence and the code, but I'll confirm that there is no built-in intent or slot for handling currency.

    So, you'll have to do it manually using AMAZON.NUMBER slot type as you seem to be trying.

    I would imagine that you will want to create utterences with two AMAZON.NUMBER slots - one for dollars and one for cents.