Transactions let your app handle purchases (for example, pick-up, delivery, or tickets).
Integrating transactions into your app lets you create natural, conversational ordering experiences that are more seamless than websites and mobile apps.
Here's an example ordering experience with a shoe store app:
The user flow for a transaction is as follows:
- Get information from the user that may be required for the transaction, e.g delivery or shipping information.
- Build a "cart" of products, services, or actions.
- Propose the item(s) to the user.
- Process the accepted order.
- Display the finalized order.
While the user is building their "cart", you may need to collect their delivery or shipping information to determine things like price and service availability. Your app can request the user's permission for Google to share their delivery address with your app.
Once they are ready to check out, your app triggers an order confirmation experience by providing the structured order data to the Transactions API:
The user can then authorize the purchase and accept or reject the order. We provide a built-in experience enabling users to change their payment settings, delivery address, etc.
If the user authorizes the purchase, your app should immediately respond by confirming that the order is active. You do this by providing the Transactions API with a structured receipt. This is presented to the user as a rich receipt "card" as part of their interaction with your app:
You can then continue the dialog with the user. You might take this opportunity to let them create an account on your app so that they can earn rewards or re-order their favorite items.
A detailed version of the receipt will appear in the user's Assistant order history. Later, you can use the order ID associated with this receipt to send structured order updates. Important updates will be sent to the user as push notifications.
Requirements for Transactions
The following steps show the high-level overview of building an app using transactions:
- Create a project in the Actions Console and opt-in to Transactions
- Use Dialogflow or other tools to build your app:
- Create a "cart assembly" experience to guide the user to build an order
- Prepare a payment method -- you can:
- Link the user's Google account with your web service to access a payment method that the user has on file with you
- Use Stripe, Braintree, or Vantiv to charge a credit card the user has stored with Google
- Take payment "on fulfillment" (e.g. cash on delivery)
- Propose the order to the user with the
- Once the user accepts, send a structured receipt
- Support and test both Sandbox and Production modes. Test the Transactions API only on iOS and Android M+N devices -- not the Actions Web Simulator
- Use the Conversation Send API to provide structured order update notifications throughout the life of the order.
- Submit your app via the Actions Console
For next steps, read our transactions developer guide to get started.