POST
/
v2
/
sites
/
{site_id}
/
webviews
/
sessions
cURL
curl --request POST \
  --url https://api.loyaltylion.com/v2/sites/{site_id}/webviews/sessions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "channel": "<string>",
  "language": "en",
  "currency": "usd",
  "customer": {
    "merchant_id": "1000001",
    "email": "alice@example.com"
  }
}'
{
  "webview_session": {
    "url": "https://platform.loyaltylion.com/webview/f7bd16c",
    "expires_at": "2025-03-03T00:00:00Z"
  }
}
Required scopes: write_customersThis endpoint has a rate limit of 100 requests per second
Create a short-lived WebView session for a site. This session includes a URL that can be used to render an embedded Loyalty Page in a WebView. If you have an authenticated customer, you can include their ID and email when creating the session. This will allow rendering a WebView with a customer context, allowing the customer to view their points and redeem rewards.
You must only include a customer when generating an WebView session if you have already authenticated them in your app, i.e. using Shopify’s own authentication, or multipass.

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

Body

application/json

Body

channel
string
required

The name of your app. Can contain only alphanumeric characters, dots and underscores

Minimum length: 2
language
string

The current language as an ISO 639-1 code, e.g. en. If language is not provided or is not supported by this site, the default language will be used instead

Example:

"en"

currency
string

The current currency as an ISO 4217 currency code, e.g. usd. If currency is not provided or is not supported by this site, the default currency will be used instead

Example:

"usd"

customer
object

Customer to include in the resulting WebView content. If included, the rendered webview will be scoped to this customer. This means the customer will be able to see their points and redeem rewards

Response

201

webview_session
object
required

The created session, which includes a URL that can be used as the source for a WebView