merchant_id
(the
ID of the customer in your store or platform).
For convenience, the full program configuration, as returned by the Get
Configuration endpoint,
is also included in the response.
If you’re building your own headless web UI, you should generally call this once on each
page load, or, for a mobile app, once per “session”, e.g. when the customer opens or
resumes the app.
Compared to the read-only Get Customer endpoint, this endpoint can create and
enroll customers, and will trigger any relevant rules.
- if no matching customer exists in LoyaltyLion for the given
merchant_id
, a new customer will be created, potentially enrolled into the program, and returned - if a matching customer is found in LoyaltyLion, they may be enrolled and returned
- “join program” rule if the customer was just enrolled from this session
- “pageview” rule if the
channel
isweb
and they’re viewing a relevant page - “download mobile app” rule if the
channel
ismobile
Authorizations
An API key linked to a Program in LoyaltyLion, with a set of permissions (scopes). API keys can be created manually, or acquired through an OAuth2 flow. The API key should be provided as a Bearer
token in the Authorization
header
Path Parameters
Your LoyaltyLion Site ID. If a new customer is created from this API call, they'll be created in this Site, which is relevant for multi-site programs
Query Parameters
The sales channel from which this request is made. Must be provided as this query parameter, or the X-LoyaltyLion-Channel
header
web
, pos
, mobile
Body
Body
The customer involved in this session. If the customer does not yet exist in LoyaltyLion, they will be created with these properties
Additional information about this session, which can facilitate triggering rules, or improve program analytics
If you're using cart-based rewards (like free products), you should provide a serialized version of the current customer cart here. This is used to determine which rewards are eligible for the current cart (taking cart requirements into account), and also to remove and refund any product redemptions that are no longer valid
If the current cart is empty, or does not yet exist (typical on Shopify, before the the shopper has interacted with the cart), you should pass { "kind": "empty" }
to explicitly indicate an empty cart for the purposes of cart requirements
When passing a cart, check the requested_cart_actions
field in the response for any actions you should perform with the cart, such as removing any reward product lines that are no longer valid
An empty cart. This can be used to quickly indicate a cart that is empty or, for platforms like Shopify, used when a cart does not yet exist because the shopper has not yet added any items to it
{ "kind": "empty" }
Response
200
The sales channel for which this response was generated
web
, pos
, mobile
ISO 4217
code indicating the currency for any financial values in this response
"usd"
ISO 639-1
code indicating the language used for any text in this response
en
, de
, es
, fr
, it
, nl
, sv
The customer matched by merchant_id
. The customer's state
property indicates if the customer is a member of the program (enrolled
), not a member (guest
), or has been blocked from the program (blocked
)
The complete program configuration. This is the same configuration that is returned by the Get Configuration endpoint
If you included a serialized cart with the request, this may contain a list of requested actions to do with the cart, such as removing any reward items that are no longer valid