Skip to main content
POST
cURL
Explicitly enroll a customer into the loyalty program. Use this when the shopper has asked to join, for example by clicking a “Join the program” button in your storefront or mobile app. This endpoint bypasses the program’s enrollment strategy entirely, which makes it the answer for programs configured for opt-in enrollment, where initializing a session deliberately doesn’t enroll anyone. It’s also safe to call on an auto-enroll program — calling it for an already-enrolled customer is a no-op. The customer must already exist in LoyaltyLion. If no customer matches the given merchant_id, a 404 response will be returned. On a headless storefront running an opt-in program, the normal sequence is Initialize Session — which creates a customer who doesn’t exist yet and leaves them as a guest — then this endpoint once they click join. The enrolled property is true only when this request performed the enrollment. If the customer was already a member it will be false and nothing has changed, so treat it as “did I just enroll them”, not “are they enrolled” — use customer.state for the latter. The customer property is the customer in their post-enrollment state. It’s safe to retry this endpoint, and concurrent calls (e.g. a double-clicked button, or two open tabs) will only enroll the customer once. If the customer is blocked from the program, they can’t be enrolled, and a 422 response will be returned with a customer_blocked code. As with enrollment from a session, enrolling a customer may trigger program rules, most notably a “join program” rule, if one is configured.

Authorizations

Authorization
string
header
required

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

site_id
number
required

Your LoyaltyLion Site ID

merchant_id
string
required

The ID of the customer in your platform or ecommerce store.

For Shopify stores, you can pass either a GID or a regular numeric ID. If you do pass a GID you must encode it as a URL parameter, e.g. gid%3A%2F%2Fshopify%2FCustomer%2F1001

Minimum string length: 1

Query Parameters

channel
enum<string>

The sales channel from which this request is made

Available options:
web,
pos,
mobile
language
string

The language to use for the request. If not provided, the site's default language will be used

Pattern: ^[a-z]{2,3}$|^[a-z]{2,3}-[a-z0-9]{2,4}$
country
string

ISO 3166-1 alpha-2 country code for the customer. Used to filter rewards by country availability. If not provided, the site default is used

Response

200

enrolled
boolean
required

A boolean indicating whether this request enrolled the customer. If the customer was already enrolled, this will be false and no other state will have changed

customer
object
required

The customer object in its post-enrollment state. If the customer was already enrolled, this represents their existing state