In the Google assistant ecosystem, transactions is a built-in feature to allow a streamlined, standardized way for chat and voice apps to make reservations and purchases of physical and digital goods.
Creating an OrderTurn
Narratory supports this out of the box through a special bot turn, the
OrderTurn. The OrderTurn comes with a few extra fields that it needs to present the order and receipts correctly to users.
The extra fields of an Orderturn are:
- orderType: the type of order, used when Google assistant phrases the question "Are you ready to book?" in addition to showing buttons and suggestions on devices that have a screen. Accepted values are
"BOOK" | "RESERVE" | "BUY" | "PLACE_ORDER" | "PAY" | "SEND" | "RESERVE" | "SCHEDULE" | "SUBSCRIBE"
- name: the name of the order, for presentation to the user on graphical interfaces. See below for an example.
- description: a description of the order, for presentation to the user on graphical interfaces. See below for an example.
- confirmationText: the status of the order when completed, for presentation to the user on graphical interfaces. See below for an example.
- merchantName: Optional. The name of the merchant conducting the order. If not set, it will use the agentName set in your
- onConfirmed: A BotTurn to be executed on a successful transaction. You likely want to use a DynamicBotTurn here to query some external order endpoint.
- onDeclined: A BotTurn to be executed on a declined/unsuccessful transaction.
Note, like any BotTurn, onConfirmed and onCancelled support UserTurns and followup BotTurns.
An example of a BotTurn follows:
For a happyflow, the user experience on a voice-only device would be:
On a device with a screen, the user experience would be:
If the user declines the transaction, it will instead be
Important notes regarding transactions
Currently transactions for Google assistant in Narratory is limited to reservations - i.e no payments. Additional support for physical paid transactions and digital transactions will be added shortly.