import { RequestOptionsFactory } from '@wix/sdk-types'; /** * 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. */ export declare function createAccount(payload: object): RequestOptionsFactory; /** * 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. */ export declare function earnPoints(payload: object): RequestOptionsFactory; /** * 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. */ export declare function adjustPoints(payload: object): RequestOptionsFactory; /** * 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. */ export declare function getAccount(payload: object): RequestOptionsFactory; /** * 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. */ export declare function queryLoyaltyAccounts(payload: object): RequestOptionsFactory; /** * 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. */ export declare function getProgramTotals(payload: object): RequestOptionsFactory; /** Retrieves the currently logged-in member's account. */ export declare function getCurrentMemberAccount(payload: object): RequestOptionsFactory; /** * 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. */ export declare function getAccountBySecondaryId(payload: object): RequestOptionsFactory; /** * > **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. * @deprecated It has been replaced with QueryLoyaltyAccounts(), and will be removed on 2025-06-01. */ export declare function listAccounts(payload: object): RequestOptionsFactory; /** * Retrieves a list of accounts, given the provided filters and search capabilities. * Search is executed on the account's name and email values. */ export declare function searchAccounts(payload: object): RequestOptionsFactory; /** * 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). */ export declare function countAccounts(payload: object): RequestOptionsFactory; /** * 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. */ export declare function bulkAdjustPoints(payload: object): RequestOptionsFactory;