import { EventDefinition, HttpClient } from '@wix/sdk-types'; import { AccountCreatedEnvelope, AccountPointsUpdatedEnvelope, AccountRewardAvailabilityUpdatedEnvelope, AccountUpdatedEnvelope, AdjustPointsOptions, AdjustPointsResponse, AdjustPointsResponseNonNullableFields, BulkAdjustPointsOptions, BulkAdjustPointsResponse, CountAccountsOptions, CountAccountsResponse, CountAccountsResponseNonNullableFields, CreateAccountResponse, CreateAccountResponseNonNullableFields, EarnPointsOptions, EarnPointsResponse, EarnPointsResponseNonNullableFields, GetAccountBySecondaryIdOptions, GetAccountBySecondaryIdResponse, GetAccountBySecondaryIdResponseNonNullableFields, GetCurrentMemberAccountResponse, GetCurrentMemberAccountResponseNonNullableFields, GetProgramTotalsResponse, GetProgramTotalsResponseNonNullableFields, ListAccountsOptions, ListAccountsResponse, ListAccountsResponseNonNullableFields, LoyaltyAccount, LoyaltyAccountNonNullableFields, LoyaltyAccountsQueryBuilder, SearchAccountsOptions, SearchAccountsResponse, SearchAccountsResponseNonNullableFields } from './loyalty-v1-account-accounts.universal.js'; export declare const __metadata: { PACKAGE_NAME: string; }; export declare function createAccount(httpClient: HttpClient): CreateAccountSignature; interface CreateAccountSignature { /** * Creates a loyalty account for one of a site's contacts. * * The `createAccount()` function returns a Promise that resolves to the new loyalty account when it is created. * * To create a new loyalty account, the customer must first be a site contact with a contact ID. The site must also have an active loyalty program before loyalty accounts can be created. * * >**Note:** Only visitors with **Manage Loyalty** [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can create a loyalty account. * @param - Contact ID for a Wix site contact. See the [Contacts API](wix-crm-backend/contacts) to learn more. */ (contactId: string): Promise; } export declare function earnPoints(httpClient: HttpClient): EarnPointsSignature; interface EarnPointsSignature { /** * Adds points to a loyalty account. * * The `earnPoints()` function returns a Promise that resolves to the updated loyalty account. * * Only a positive amount can be added using the `earnPoints()` function, to manually adjust an account's balance for a negative amount, use [`adjustPoints()`](wix-loyalty-v2/accounts/adjustpoints). * * The `earnPoints()` function allows customers to manually earn points to their loyalty accounts. To use this function you must include an `appId` and an `idempotencyKey`. Any string can be set as the `appId` or `idempotencyKey`. In contrast to when an account earns points through an action taken on your site, the `appId` automatically sets to the source app that generates the points. The transaction `type` is `"EARN"` for points earned this way. * * >**Note:** Only visitors with **Manage Loyalty** [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can earn loyalty points. * @param - Loyalty account ID. * @param - Earn points info. */ (accountId: string, options?: EarnPointsOptions | undefined): Promise; } export declare function adjustPoints(httpClient: HttpClient): AdjustPointsSignature; interface AdjustPointsSignature { /** * Adjusts the point balance of a loyalty account. * * The `adjustPoints()` function returns a Promise that resolves to the updated loyalty account. * * To adjust the points balance of an account you must include an `accountId`, a `revision` number, and the adjustment to make. You can also leave a description to explain the reason for the points adjustment. * * There are two ways to adjust the points of a loyalty account: * - `balance` allows you to set the total points balance to this new amount. The transaction `type` will return as `"ADJUST"`. * - `amount` allows you to alter the points balance by this amount. This amount can be a positive number to increase the points balance or a negative number to decrease the balance. The transaction type will return as `"GIVE"`. * * An account may not be adjusted to a negative balance. If you pass values in both the `balance` and the `amount` parameters then the `balance` adjustment takes effect and the `amount` adjustment is ignored. * * >**Note:** Only visitors with **Manage Loyalty** [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can manually adjust points in a loyalty account. * @param - Loyalty account ID. * @param - Options to use when adjusting points. */ (accountId: string, options?: AdjustPointsOptions | undefined): Promise; } export declare function getAccount(httpClient: HttpClient): GetAccountSignature; interface GetAccountSignature { /** * Retrieves an account using the loyalty account ID. * * The `getAccount()` function returns a Promise that resolves to the specified loyalty account when it is retrieved. * * You can also get an account using a secondary ID, such as a contact ID or a member ID with the [`getAccountBySecondaryId()`](wix-loyalty-v2/accounts/getaccountbysecondaryid) function. * * >**Note:** Only visitors with **Manage Loyalty** [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can retrieve a loyalty account. * @param - ID of the account to retrieve. * @returns Retrieved loyalty account. */ (_id: string): Promise; } export declare function queryLoyaltyAccounts(httpClient: HttpClient): QueryLoyaltyAccountsSignature; interface QueryLoyaltyAccountsSignature { /** * Creates a query to retrieve a list of accounts. * * The `queryLoyaltyAccounts()` function builds a query to retrieve a list of events and returns a `LoyaltyAccountsQueryBuilder` object. * * The returned object contains the query definition, which is typically used to run the query using the `find()` function. * * You can refine the query by chaining `LoyaltyAccountsQueryBuilder` functions onto the query. `LoyaltyAccountsQueryBuilder` functions enable you to sort, filter, and control the results `queryLoyaltyAccounts()` returns. * * `queryLoyaltyAccounts()` runs with these `LoyaltyAccountsQueryBuilder` defaults, which you can override: * * - skip(0) * - limit(50) * - descending("_createdDate") * * The functions that are chained to `queryLoyaltyAccounts()` are applied in the order they're called. For example, if you apply ascending('points.balance') and then descending('points.earned'), the results are sorted first by the balance, and then, if there are multiple results with the same balance, the items are sorted by earned points. */ (): LoyaltyAccountsQueryBuilder; } export declare function getProgramTotals(httpClient: HttpClient): GetProgramTotalsSignature; interface GetProgramTotalsSignature { /** * Retrieves the total amount of points earned, redeemed, and adjusted for the entire loyalty program. * * The `getProgramTotals()` function returns a Promise that resolves to the combined total points for all loyalty accounts in the program. * * The `balance` is the current total of points outstanding, while the `earned`, `adjusted`, and `redeemed` amounts are the all-time accumulated amounts. The totals include the amounts for all loyalty accounts. * * >**Note:** Only visitors with **Manage Loyalty** [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can retrieve the loyalty program totals. */ (): Promise; } export declare function getCurrentMemberAccount(httpClient: HttpClient): GetCurrentMemberAccountSignature; interface GetCurrentMemberAccountSignature { /** * Retrieves the currently logged-in member's account. */ (): Promise; } export declare function getAccountBySecondaryId(httpClient: HttpClient): GetAccountBySecondaryIdSignature; interface GetAccountBySecondaryIdSignature { /** * Retrieves the loyalty account of the specified site contact or member. * * The `getAccountBySecondaryId()` function returns a Promise that resolves to the specified loyalty account when it is retrieved. * * This function gets a loyalty account using either a customer's contact ID or member ID. You can also get an account using the loyalty account ID with the [`getAccount()`](wix-loyalty-v2/accounts/getaccount) function. * * >**Note:** Only visitors with **Manage Loyalty** [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can retrieve a loyalty account. * @param - ID of the customer to retrieve loyalty account for. */ (options?: GetAccountBySecondaryIdOptions | undefined): Promise; } export declare function listAccounts(httpClient: HttpClient): ListAccountsSignature; interface ListAccountsSignature { /** * > **Deprecation Notice** * > * > **This method has been replaced with [Query Loyalty Accounts](https://dev.wix.com/docs/sdk/backend-modules/loyalty/accounts/query-loyalty-accounts) and will be removed on June 30, 2025. If your app uses this method, we recommend updating your code as soon as possible.** * * Retrieves a list of loyalty accounts, given the provided filters. * * The `listAccounts()` function returns a Promise that resolves to a list of loyalty accounts. * * You can retrieve selected loyalty accounts with an array of `contactIds` or retrieve a list of all of a site's loyalty accounts * with an empty request parameter. Use the `cursorPaging` parameters to limit how many items load at a time. * * >**Note:** Only visitors with **Manage Loyalty** [permissions](https://support.wix.com/en/article/roles-permissions-accessing-roles-permissions) can retrieve loyalty accounts. * @param - Options to use when retrieving a list of loyalty accounts. * @deprecated */ (options?: ListAccountsOptions | undefined): Promise; } export declare function searchAccounts(httpClient: HttpClient): SearchAccountsSignature; interface SearchAccountsSignature { /** * Retrieves a list of accounts, given the provided filters and search capabilities. * Search is executed on the account's name and email values. * @returns Accounts found through provided search capabilities, along with paging and aggregation data of the results. */ (options?: SearchAccountsOptions | undefined): Promise; } export declare function countAccounts(httpClient: HttpClient): CountAccountsSignature; interface CountAccountsSignature { /** * Retrieves the count of found accounts, given the provided filters and search capabilities. * * This endpoint can help find the total count of accounts when used alongside [Search Accounts](https://dev.wix.com/docs/rest/crm/loyalty-program/accounts/search-accounts). * @returns Count of accounts found for given search query */ (options?: CountAccountsOptions | undefined): Promise; } export declare function bulkAdjustPoints(httpClient: HttpClient): BulkAdjustPointsSignature; interface BulkAdjustPointsSignature { /** * Updates points balance of multiple accounts. * Depending on the BulkAdjustPointsRequest.type: * amount - provided amount of points is appended to the accounts balance * balance - accounts balance is set to the provided amount * * Returns id of the asyncInfra job that takes care of the points adjustment. */ (options?: BulkAdjustPointsOptions | undefined): Promise; } export declare const onAccountCreated: EventDefinition; export declare const onAccountPointsUpdated: EventDefinition; export declare const onAccountRewardAvailabilityUpdated: EventDefinition; export declare const onAccountUpdated: EventDefinition; export { AccountCreatedEnvelope, AccountPointsUpdatedEnvelope, AccountRewardAvailabilityUpdatedEnvelope, AccountToUpsert, AccountUpdatedEnvelope, ActionEvent, AdjustPointsOptions, AdjustPointsRequest, AdjustPointsRequestTypeOneOf, AdjustPointsResponse, AdjustPointsResponseNonNullableFields, Aggregation, AggregationData, AggregationKindOneOf, AggregationResults, AggregationResultsResultOneOf, AggregationResultsScalarResult, AggregationType, ApplicationError, BaseEventMetadata, BillingReference, BulkAccountResult, BulkActionMetadata, BulkAdjustPointsOptions, BulkAdjustPointsRequest, BulkAdjustPointsRequestTypeOneOf, BulkAdjustPointsResponse, BulkUpsertAccountsRequest, BulkUpsertAccountsResponse, CancellationDetails, Contact, ContactSyncRequest, ContractSwitchReason, ContractSwitchType, ContractSwitched, CountAccountsOptions, CountAccountsRequest, CountAccountsResponse, CountAccountsResponseNonNullableFields, CreateAccountRequest, CreateAccountResponse, CreateAccountResponseNonNullableFields, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, CursorSearch, CursorSearchPagingMethodOneOf, Cursors, Cycle, CycleCycleSelectorOneOf, DateHistogramAggregation, DateHistogramAggregationInterval, DateHistogramResult, DateHistogramResults, DomainEvent, DomainEventBodyOneOf, EarnPointsOptions, EarnPointsRequest, EarnPointsRequestActivityDetailsOneOf, EarnPointsResponse, EarnPointsResponseNonNullableFields, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, ExportAccountsRequest, ExportAccountsResponse, FirstTransaction, FocalPoint, FollowedSocialMedia, GetAccountBySecondaryIdOptions, GetAccountBySecondaryIdRequest, GetAccountBySecondaryIdRequestIdOneOf, GetAccountBySecondaryIdResponse, GetAccountBySecondaryIdResponseNonNullableFields, GetAccountRequest, GetAccountResponse, GetAccountResponseNonNullableFields, GetCurrentMemberAccountRequest, GetCurrentMemberAccountResponse, GetCurrentMemberAccountResponseNonNullableFields, GetProgramTotalsRequest, GetProgramTotalsResponse, GetProgramTotalsResponseNonNullableFields, GroupByAggregation, GroupByAggregationKindOneOf, GroupByValueResults, IdentificationData, IdentificationDataIdOneOf, Image, IncludeMissingValuesOptions, Initiator, Interval, IntervalUnit, ItemMetadata, ListAccountsOptions, ListAccountsRequest, ListAccountsResponse, ListAccountsResponseNonNullableFields, ListUserAccountsRequest, ListUserAccountsResponse, LoyaltyAccount, LoyaltyAccountForMetaSite, LoyaltyAccountNonNullableFields, LoyaltyAccountsQueryBuilder, LoyaltyAccountsQueryResult, MessageEnvelope, MissingValues, Mode, NestedAggregation, NestedAggregationItem, NestedAggregationItemKindOneOf, NestedAggregationResults, NestedAggregationResultsResultOneOf, NestedAggregationType, NestedResultValue, NestedResultValueResultOneOf, NestedResults, NestedValueAggregationResult, OneTime, Paging, PagingMetadataV2, Points, PointsExpiration, PointsUpdated, PriceIncreaseTrigger, ProductAdjustment, ProductPriceIncreaseData, ProviderName, QueryLoyaltyAccountsRequest, QueryLoyaltyAccountsResponse, QueryLoyaltyAccountsResponseNonNullableFields, QueryV2, QueryV2PagingMethodOneOf, RangeAggregation, RangeAggregationResult, RangeBucket, RangeResult, RangeResults, ReactivationData, ReactivationReasonEnum, RecurringChargeAttemptFailed, RecurringChargeSucceeded, RedeemDeterminedAmountOfPointsRequest, RedeemDeterminedAmountOfPointsResponse, RedeemPointsRequest, RedeemPointsResponse, RefundTransactionRequest, RefundTransactionResponse, RestoreInfo, Results, RewardAvailabilityUpdated, RollingWindow, ScalarAggregation, ScalarResult, ScalarType, SearchAccountsOptions, SearchAccountsRequest, SearchAccountsResponse, SearchAccountsResponseNonNullableFields, SearchDetails, SetMissingMemberIdRequest, SetMissingMemberIdResponse, SortDirection, SortOrder, SortType, Sorting, Status, Subscription, SubscriptionAssigned, SubscriptionAutoRenewTurnedOff, SubscriptionAutoRenewTurnedOn, SubscriptionCancelled, SubscriptionCreated, SubscriptionEvent, SubscriptionEventEventOneOf, SubscriptionNearEndOfPeriod, SubscriptionPendingChange, SubscriptionStatus, SubscriptionTransferred, SubscriptionUnassigned, Tier, TierDefinition, TierTotal, TiersProgramSettings, TiersProgramSettingsChanged, TiersProgramSettingsPeriodOneOf, TiersRollingUpdate, UnassignReason, UpdateTrigger, ValueAggregation, ValueAggregationOptionsOneOf, ValueAggregationResult, ValueResult, ValueResults, WebhookIdentityType, } from './loyalty-v1-account-accounts.universal.js';