This guide will be removed on April 29, 2022. Please use our new, easier-to-use Toast technical documentation site. All updated content is on the new site.

Search

The search workflow occurs when a restaurant employee selects the Rewards button in the Toast POS app and the restaurant guest has not already provided an identifying card or other form of loyalty program account identification.

Search workflow

  1. The restaurant employee selects the Rewards button in the Toast POS app and enters identifying information (name, email address, or phone number) about a restaurant guest.

  2. The POS sends a search request to your loyalty program integration. The request body includes a TransactionInformationSearch object holding identifying information about the restaurant guest.

  3. Your loyalty program integration responds to the search request. The request body includes a ResponseSearch object holding list of loyalty accounts that match the search criteria. The HTTP header for the response includes a 200 HTTP response code if there is at least one account found or a 404 HTTP response code if there are no accounts found.

  4. The restaurant employee selects the correct account or cancels the workflow.

Loyalty account search request

{
  "toastTransactionType":"LOYALTY_SEARCH",
  "searchTransactionInformation":{
    "searchCriteria":{
      "firstName":"James",
      "lastName":"Smith",
      "email":null,
      "phone":null
    }
  },
  "checkTransactionInformation":null,
  "reverseTransactionInformation":null
}

Successful loyalty account search response (200 HTTP code)

{
  "searchResponse":{
    "accounts":[
      {
        "identifier":"1",
        "firstName":"james",
        "lastName":"smith",
        "phone":"1111111111",
        "email":"a1@toasttab.com",
        "pointsBalance":401
      }
    ]
  },
  "transactionStatus":"ACCEPT"
}

1

You may return a pointsBalance in your response to a LOYALTY_SEARCH request, but this balance will not display on the POS. The points balance only displays on the POS in response to LOYALTY_INQUIRE requests.

Loyalty account search response with no accounts found (404 HTTP code)

{
  "transactionStatus":"ERROR_ACCOUNT_INVALID"
}