Gratuity

By default, once a customer checks out, the Order with Google flow displays a tip selector, allowing the customer to choose the amount of gratuity to be included with their order.

Restaurants send the chosen amount in SubmitOrderRequestMessage in a LineItem of type GRATUITY inside ProposedOrder.otherItem.

Alternatively, restaurants can have a required gratuity amount or refuse to accept gratuity. You can support these use cases in the CheckoutResponseMessage.

If a restaurant refuses to accept gratuity:

  1. Add a line item of type GRATUITY with a blank amount inside ProposedOrder.otherItems in CheckoutResponseMessage.

JSON

{
  "name": "Tip",
  "type": "GRATUITY",
  "price": {
      "type":"ESTIMATE",
      "amount": {
        "currencyCode":"USD"
    }
  }
}

If a restaurant requires a fixed gratuity:

  1. Add a line item of type GRATUITY with a fixed amount inside ProposedOrder.otherItems in CheckoutResponseMessage.

JSON

{
  "name": "Required Tip",
  "type": "GRATUITY",
  "price": {
    "type": "ESTIMATE",
    "amount": {
      "currencyCode": "USD",
      "units": "3",
      "nanos": 100000000
    }
  },
  "gratuityExtension": {
    "gratuityType": "MANDATORY"
  }
}

If a restaurant suggests a gratuity and gives the customer the option to modify:

  1. Add a line item of type GRATUITY with a fixed amount inside ProposedOrder.otherItems in CheckoutResponseMessage and add gratuityExtension with gratuityType value of USER_MODIFIABLE.

JSON

{
  "name": "Suggested Tip",
  "type": "GRATUITY",
  "price": {
    "type": "ESTIMATE",
    "amount": {
      "currencyCode": "USD",
      "units": "3",
      "nanos": 100000000
    }
  },
  "gratuityExtension": {
    "gratuityType": "USER_MODIFIABLE"
  }
}