- Action ID
actions.intent.GET_ORDER
- Description
- Search and view previous orders placed in an app. Populate the name of the ordered item using
the
order.orderedItem.name
intent parameter. Filter orders by date of the order using theorder.orderDate
intent parameter.
Locale support
Functionality | Locales |
---|---|
Preview creation using App Actions test tool | en-US, en-GB, en-CA, en-IN, en-BE, en-SG, en-AU, es-ES, pt-BR, id-ID |
User invocation from Google Assistant | en-US, en-GB, en-CA, en-IN, en-BE, en-SG, en-AU, es-ES, pt-BR, id-ID |
Example queries
Other supported fields
The following fields represent information that users often provide to disambiguate their needs or otherwise improve their results:
order.@type
order.orderDate
order.orderedItem.@type
order.orderedItem.name
Android widgets and slices
We recommend implementing Android widgets for this built-in intent. A widget presents information or interaction options from your app to improve user engagement in Google Assistant. Widgets are available for App Actions implementations using shortcuts.xml.
If you have a legacy App Actions implementation using
actions.xml, use
Android slices instead. We recommend
migrating your
implementation to shortcuts.xml
to take advantage of widgets
fulfillment and other improvements.
Supported text values by field
Sample XML files
For information about the shortcuts.xml
schema, see Create shortcuts.xml.
Handle BII parameters
shortcuts.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample shortcuts.xml -->
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<capability android:name="actions.intent.GET_ORDER">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="YOUR_UNIQUE_APPLICATION_ID"
android:targetClass="YOUR_TARGET_CLASS">
<!-- Eg. orderDate = "2018-06-17T15:00Z" -->
<parameter
android:name="order.orderDate"
android:key="orderDate"/>
<!-- Eg. name = "example name" -->
<parameter
android:name="order.orderedItem.name"
android:key="name"/>
</intent>
</capability>
</shortcuts>
actions.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample actions.xml -->
<actions>
<action intentName="actions.intent.GET_ORDER">
<fulfillment urlTemplate="myapp://custom-deeplink{?orderDate,name}">
<!-- e.g. orderDate = "2018-06-17T15:00Z" -->
<!-- (Optional) Require a field eg.orderDate for fulfillment with required="true" -->
<parameter-mapping urlParameter="orderDate" intentParameter="order.orderDate" required="true" />
<!-- e.g. name = "example name" -->
<parameter-mapping urlParameter="name" intentParameter="order.orderedItem.name" />
</fulfillment>
<!-- Provide a fallback fulfillment with no required parameters. For example, to your app search or router deeplink -->
<fulfillment urlTemplate="myapp://deeplink" />
</action>
</actions>
JSON-LD sample
The following JSON-LD sample provides some example values that you can use in the App Actions test tool:
{ "@context": "http://schema.org", "@type": "Order", "orderDate": "2018-06-17T15:00Z", "orderedItem": { "@type": "Product", "name": "example name" } }