Setup

To use the Tiers API, install the @wix/loyalty package using npm or Yarn:

Copy
1
npm install @wix/loyalty

or

Copy
1
yarn add @wix/loyalty

Then import { tiers } from @wix/loyalty:

Copy
1
import { tiers } from '@wix/loyalty'
Was this helpful?
Yes
No

bulkCreateTiers( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Creates up to 20 tiers.

The name for a tier and the amount of required points to qualify for a tier can only exist for a single tier. Attempts to create a tier with a tierDefinition.name or requiredPoints that already exists will return an error.

To create a single tier, use createTier().

Note: You must have a Business VIP Premium plan or a Scale Premium plan to add tiers.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Loyalty
Learn more about permission scopes.
Copy
function bulkCreateTiers(tiers: Array<Tier>): Promise<BulkCreateTiersResponse>
Method Parameters
tiersArray<Tier>Required

Tiers to create.

Returns
Return Type:Promise<BulkCreateTiersResponse>
Was this helpful?
Yes
No

createTier( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Creates a tier.

The name for a tier and the amount of required points to qualify for a tier can only exist for a single tier. Attempts to create a tier with a tierDefinition.name or requiredPoints that already exists will return an error.

To create up to 20 tiers at once, use bulkCreateTiers().

Note: You must have a Business VIP Premium plan or a Scale Premium plan to add tiers.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Loyalty
Learn more about permission scopes.
Copy
function createTier(tier: Tier): Promise<Tier>
Method Parameters
tierTierRequired

Tier to create.

Returns
Return Type:Promise<Tier>
Was this helpful?
Yes
No

deleteTier( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Deletes a loyalty tier.

Note: This endpoint requires visitor or member authentication.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Loyalty
Learn more about permission scopes.
Copy
function deleteTier(tierId: string, revision: string): Promise<void>
Method Parameters
tierIdstringRequired

ID of the tier to delete.


revisionstringRequired

Current revision of the tier to delete.

Was this helpful?
Yes
No

getTier( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a loyalty tier.

To retrieve a list of all of a site's tiers, use listTiers().

Permission Scopes

For app development, you must have one of the following permission scopes:
Read Loyalty
Manage Loyalty
Learn more about permission scopes.
Copy
function getTier(tierId: string): Promise<Tier>
Method Parameters
tierIdstringRequired

ID of the tier to retrieve.

Returns
Return Type:Promise<Tier>
Was this helpful?
Yes
No

getTiersProgramSettings( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves the settings for the tiers program.

Tiers program settings apply globally to all tiers in the program.

Note: This endpoint requires visitor or member authentication.

Permission Scopes

For app development, you must have one of the following permission scopes:
Read Loyalty
Manage Loyalty
Learn more about permission scopes.
Copy
function getTiersProgramSettings(): Promise<GetTiersProgramSettingsResponse>
Request
This method does not take any parameters
Returns
Return Type:Promise<GetTiersProgramSettingsResponse>
Was this helpful?
Yes
No

listTiers( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Retrieves a list of a site's tiers.

To retrieve a specific tier, use getTier().

Permission Scopes

For app development, you must have one of the following permission scopes:
Read Loyalty
Manage Loyalty
Learn more about permission scopes.
Copy
function listTiers(): Promise<ListTiersResponse>
Request
This method does not take any parameters
Returns
Return Type:Promise<ListTiersResponse>
Was this helpful?
Yes
No

updateTier( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Updates a loyalty tier.

Use this endpoint to update tier-specific settings, such as the name and the required points threshold of an individual loyalty tier. To update global settings that apply to all of a site's loyalty tiers, use updateTiersProgramSettings().

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Loyalty
Learn more about permission scopes.
Copy
function updateTier(_id: string, tier: UpdateTier): Promise<Tier>
Method Parameters
_idstringRequired

Tier ID.


tierUpdateTierRequired

Tier info to update.

Returns
Return Type:Promise<Tier>
Was this helpful?
Yes
No

updateTiersProgramSettings( )

Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Updates the global settings of a loyalty tier program.

Use this endpoint to update settings that apply to all of a site's loyalty tiers. To update tier-specific settings for an individual tier, use updateTier().

By default, the status of a tiers program is set to "DISABLED" and must be manually updated to "ACTIVE" using this endpoint or through a site owner's dashboard.

Note: The status, revision, and rollingWindow parameters must be passed to update the tiers program settings. The baseTierDefinition fields are not required, however, if you don't pass them they will reset to their default values of empty fields.

Permission Scopes

For app development, you must have one of the following permission scopes:
Manage Loyalty
Learn more about permission scopes.
Copy
function updateTiersProgramSettings(programSettings: TiersProgramSettings): Promise<UpdateTiersProgramSettingsResponse>
Method Parameters
programSettingsTiersProgramSettingsRequired

Settings for the tiers program.

Returns
Return Type:Promise<UpdateTiersProgramSettingsResponse>
Was this helpful?
Yes
No