User Lookup

User Lookup allows for user attribution to transactions through the checkout process. There are various flows supported by the APIs below; their usage is dependent on the desired workflow.

User Lookup API

Supports user lookups by exact match. If a transaction payload was provided, offers returned will also have a discount amount. When searching exact match, the search criteria used must be unique per user account. If multiple rows are returned, an error will be returned from the API and the cashier must to provide an alternative lookup value for that user account.

For more information on this process flow, consult your Customer Success contact.

Endpoint

This API offers the following endpoint:

Copy
REST Endpoint
POST /api/2.0/lookup
        

Endpoint Parameters

Not applicable.

Request Object

When this endpoint runs, it passes in a User Lookup request object. When using this API, pass in the request_payload as the User Lookup object, which is detailed in the following table:

Request Properties for User Lookup

Property Type
Required/Optional
Description
email string
optional
Email associated with the desired user account.
phone string
optional
Phone number that is associated with the desired user account. Format required is numbers only.
user_id string
optional
ID of the user account.
external_customer_id string
optional
External ID associated with the desired user account. This ID can include a customer's assigned loyalty card number.
transaction Transaction
optional

If the transaction object is passed, SessionM analyzes the associated set of offers to determine which ones may be applicable to the given transaction. Note that only catalog and store restrictions are checked; store restrictions are skipped if no store_id is provided. The response of this API will contain only the eligible offers, along with discount details.

If this value is not provided, all offers in the user’s wallet will be returned and no discount application details will be provided. If an order is changed, call the lookup endpoint again and provide the modified transaction, specifying user_id in the lookup argument.

Response Object

Response Properties for User Lookup

Property Type
Required/Optional
Description
users user[]
required
Result from the lookup.

Response Properties for User

Property Type
Required/Optional
Description
user_reference_id string
required
Contains the user_id for the account.
user_account_id string
optional
Only returned in full responses.
first_name string
optional
First name of the user.
last_name string
optional
Last name of the user.
phone string
optional
Phone number of the user.
email string
optional
Email for the user.
points decimal (Nullable)
optional
Summary of spendable points for the user account. This will only be returned for programs that have configured it to be returned in a user lookup.
profile_fields KVP(string,string)
optional
Key value pair collection housing profile fields with values that are configured for the integration. Key will be the profile field and the value will be the value for the profile field.
offers Discount[]
optional
Offers for the user account. Only returned if the full user account is returned and will contain discount information if a transaction was provided.
point_accounts PointAccount[] Detailed description of all point accounts associated with this user account. If multiple point accounts are associated with this user account, this will return details for each account.

Response Properties for Point Account Objects

Property Type Required Description
account_name string Yes Name of the point account.
user_point_account_id string No ID of the user point account.
point_account_id string Yes ID of the point account
grouping_label string Yes Grouping to which the point account belongs.
available_balance decimal Yes Available points.
life_time_value decimal Yes Lifetime points for the account.