- Action ID
actions.intent.CREATE_OFFER
- Description
-
Construct a listing for a product or service to sell. Populate the name, price, and brand of the product to sell using the
offer.itemOffered.name
,offer.price
, andoffer.itemOffered.brand.name
parameters, respectively.Your app must confirm with the user before posting a listing.
Locale support
Functionality Locales Preview creation using App Actions test tool en-US User invocation from Google Assistant en-US
Example queries
Recommended fields
The following fields represent essential information that users often provide in queries that trigger this built-in intent:
offer.itemOffered.name
offer.price
Other supported fields
The following fields represent information that users often provide to disambiguate their needs or otherwise improve their results:
offer.@type
offer.itemOffered.@type
offer.itemOffered.brand.@type
offer.itemOffered.brand.name
offer.priceCurrency
Supported text values by field
Inventory availability by field
Sample XML files
For information about the actions.xml
schema, see Create actions.xml. For information about the shortcuts.xml
schema, see Create shorcuts.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.CREATE_OFFER">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="YOUR_UNIQUE_APPLICATION_ID"
android:targetClass="YOUR_TARGET_CLASS">
<!-- Eg. price = "20" -->
<parameter
android:name="offer.price"
android:key="price"/>
<!-- Eg. priceCurrency = "USD" -->
<parameter
android:name="offer.priceCurrency"
android:key="priceCurrency"/>
<!-- Eg. itemOfferedName = "example name" -->
<parameter
android:name="offer.itemOffered.name"
android:key="itemOfferedName"/>
<!-- Eg. brandName = "example brand" -->
<parameter
android:name="offer.itemOffered.brand.name"
android:key="brandName"/>
</intent>
</capability>
</shortcuts>
actions.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample actions.xml -->
<actions>
<action intentName="actions.intent.CREATE_OFFER">
<fulfillment urlTemplate="myapp://custom-deeplink{?price,priceCurrency,itemOfferedName,brandName}">
<!-- e.g. price = "20" -->
<!-- (Optional) Require a field eg.price for fulfillment with required="true" -->
<parameter-mapping urlParameter="price" intentParameter="offer.price" required="true" />
<!-- e.g. priceCurrency = "USD" -->
<parameter-mapping urlParameter="priceCurrency" intentParameter="offer.priceCurrency" />
<!-- e.g. itemOfferedName = "example name" -->
<parameter-mapping urlParameter="itemOfferedName" intentParameter="offer.itemOffered.name" />
<!-- e.g. brandName = "example brand" -->
<parameter-mapping urlParameter="brandName" intentParameter="offer.itemOffered.brand.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>
Use web inventory
offer.itemOffered.name
is a field
that supports web inventory.
In the following example, Google Assistant performs a web search for the user
query and determines the fulfillment URL. Assistant filters for search results
that match the provided urlFilter
value of
https://www.mywebsite.com/link1/.*
.
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.CREATE_OFFER">
<intent
android:action="android.intent.action.VIEW"
android:targetPackage="YOUR_UNIQUE_APPLICATION_ID"
android:targetClass="YOUR_TARGET_CLASS">
<parameter android:name="offer.price">
<data android:pathPattern="https://www.mywebsite.com/link1/.*"/>
</parameter>
<parameter android:name="offer.priceCurrency">
<data android:pathPattern="https://www.mywebsite.com/link2/.*"/>
</parameter>
<parameter android:name="offer.itemOffered.name">
<data android:pathPattern="https://www.mywebsite.com/link3/.*"/>
</parameter>
<parameter android:name="offer.itemOffered.brand.name">
<data android:pathPattern="https://www.mywebsite.com/link4/.*"/>
</parameter>
</intent>
</capability>
</shortcuts>
actions.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- This is a sample actions.xml -->
<actions>
<action intentName="actions.intent.CREATE_OFFER">
<!-- Use URL from entity match for deep link fulfillment -->
<!-- Example: url = 'https://www.mywebsite.com/link1/item1' -->
<fulfillment urlTemplate="{@url}" />
<!-- Provide a fallback fulfillment with no required parameters. For example, to your app search or router deeplink -->
<fulfillment urlTemplate="myapp://deeplink" />
<!-- Define parameters with web inventories using urlFilter -->
<parameter name="offer.itemOffered.name">
<entity-set-reference urlFilter="https://www.mywebsite.com/link1/.*" />"/>
</parameter>
</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": "Offer", "itemOffered": { "@type": "Product", "brand": { "@type": "Brand", "name": "example brand" }, "name": "example name" }, "price": 20, "priceCurrency": "USD" }