Skip to content

Loyalty Portal Config

Admin-facing endpoints for reading and updating a workspace's loyalty portal configuration — the branding, visible sections, and custom CSS that drive the public loyalty portal. Both endpoints are workspace-scoped and require Bearer-token auth from a member of the workspace.

These manage the internal config record (including logo_file_id and audit fields). The end-user-facing, slug-keyed view of the same data is served by the Public Loyalty Portal API.


Get Loyalty Portal Config

GET /wallethero-api/workspace/:workspaceId/loyalty-portal-config

Returns the workspace's loyalty portal config. If none exists yet, a default config is created (enabled, all sections shown) and returned.

Auth: Bearer token — workspace member

Path Parameters

ParameterTypeDescription
workspaceIdstring (UUID)Workspace identifier

Example Request

bash
curl "https://api.wallethero.app/wallethero-api/workspace/WORKSPACE_ID/loyalty-portal-config" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response (200)

json
{
  "data": {
    "id": "lpc00000-0000-0000-0000-000000000001",
    "workspace_id": "WORKSPACE_ID",
    "is_enabled": true,
    "logo_file_id": "f1000000-0000-0000-0000-000000000001",
    "primary_color": "#1a1a1a",
    "background_color": "#ffffff",
    "welcome_title": "Welcome back!",
    "welcome_subtitle": "Track your points and rewards.",
    "show_tier": true,
    "show_rewards": true,
    "show_redemption_history": true,
    "show_referral": true,
    "cta_label": "View rewards",
    "custom_css": null,
    "date_created": "2026-01-10T12:00:00.000Z",
    "date_updated": "2026-02-01T08:30:00.000Z",
    "user_created": "u1000000-0000-0000-0000-000000000001",
    "user_updated": "u1000000-0000-0000-0000-000000000001"
  }
}

SDK

typescript
const { data: config } = await wh.loyaltyPortalConfig.get(workspaceId);

Update Loyalty Portal Config

PUT /wallethero-api/workspace/:workspaceId/loyalty-portal-config

Updates the workspace's loyalty portal config. The config record is created first if it does not exist, then the supplied fields are applied. All body fields are optional; only the provided fields are changed.

Auth: Bearer token — workspace member

Path Parameters

ParameterTypeDescription
workspaceIdstring (UUID)Workspace identifier

Request Body

FieldTypeRequiredDescription
is_enabledbooleanNoWhether the public loyalty portal is enabled
logo_file_idstring (UUID) | nullNoDirectus file ID of the portal logo
primary_colorstring | nullNoPrimary brand color (max 20 chars; hex/CSS color value)
background_colorstring | nullNoBackground color (max 20 chars; hex/CSS color value)
welcome_titlestring | nullNoWelcome heading (max 255 chars)
welcome_subtitlestring | nullNoWelcome subheading (max 2000 chars)
show_tierbooleanNoShow the tier section
show_rewardsbooleanNoShow the rewards section
show_redemption_historybooleanNoShow the redemption history section
show_referralbooleanNoShow the referral section
cta_labelstring | nullNoCall-to-action button label (max 120 chars)
custom_cssstring | nullNoCustom CSS injected into the portal (max 50000 chars)

Example Request

bash
curl -X PUT "https://api.wallethero.app/wallethero-api/workspace/WORKSPACE_ID/loyalty-portal-config" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "is_enabled": true,
    "primary_color": "#1a1a1a",
    "welcome_title": "Welcome back!",
    "show_referral": false
  }'

Response (200)

json
{
  "data": {
    "id": "lpc00000-0000-0000-0000-000000000001",
    "workspace_id": "WORKSPACE_ID",
    "is_enabled": true,
    "logo_file_id": "f1000000-0000-0000-0000-000000000001",
    "primary_color": "#1a1a1a",
    "background_color": "#ffffff",
    "welcome_title": "Welcome back!",
    "welcome_subtitle": "Track your points and rewards.",
    "show_tier": true,
    "show_rewards": true,
    "show_redemption_history": true,
    "show_referral": false,
    "cta_label": "View rewards",
    "custom_css": null,
    "date_updated": "2026-02-15T10:00:00.000Z",
    "user_updated": "u1000000-0000-0000-0000-000000000001"
  }
}

SDK

typescript
const { data: config } = await wh.loyaltyPortalConfig.update(workspaceId, {
  is_enabled: true,
  primary_color: "#1a1a1a",
  welcome_title: "Welcome back!",
  show_referral: false,
});

WalletHero Documentation