Search.../

queryLoyaltyCoupons( )

Developer Preview

Retrieves a list of loyalty coupons, given the provided paging, filtering, and sorting.

Admin Method

This function requires elevated permissions to run. This function is not universal and runs only on the backend.

Syntax

function queryLoyaltyCoupons(query: QueryV2): Promise<QueryLoyaltyCouponResponse>

queryLoyaltyCoupons Parameters

NAME
TYPE
DESCRIPTION
query
QueryV2

WQL expression

Returns

Return Type:

Promise<
QueryLoyaltyCouponResponse
>
NAME
TYPE
DESCRIPTION
loyaltyCoupons
Array<
LoyaltyCoupon
>

Retrieved loyalty coupons.

metadata
PagingMetadataV2

Metadata.

Was this helpful?

queryLoyaltyCoupons example

Copy Code
1import { coupons } from 'wix-loyalty.v2';
2
3 async function queryLoyaltyCoupons(query) {
4 try {
5 const result = await coupons.queryLoyaltyCoupons(query);
6
7 return result;
8 } catch (error) {
9 console.error(error);
10 // Handle the error
11 }
12 }
13