/** * Tip settings define how tips are calculated and distributed among staff. When * Wix Tips is installed, default settings are automatically created. You can't * delete these default settings but you can update them. Creating additional * settings allows business owners to customize tip screens for different payment * terminals or set specific presets for various products or services. */ export interface TipSettings extends TipSettingsIdentifierOneOf { /** * ID of the [location](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) * for which the tip settings apply. */ locationId?: string | null; /** * ID of the payment terminal for which the tip settings apply. Wix Tips doesn't * validate the ID you provide. * * Max: 30 characters */ paymentTerminalId?: string | null; /** * ID of the Wix user for whom the tip settings apply. For example, the site owner or a * [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site). */ userId?: string | null; /** * ID of the tip settings. * @readonly */ _id?: string | null; /** * Tip type. * * Supported values: * + `UNKNOWN_TIP_TYPE`: There is no information about the tip type. * + `PERCENTAGE`: The tip is calculated as a percentage of the subtotal for all related line items. * + `AMOUNT`: The tip is a fixed amount. */ tipType?: TipType; /** * Information about the tip choices that Wix Tips displays to customers during the * [eCommerce checkout](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup). * * Min: `1` preset * Max: `3` presets */ presets?: Preset[]; /** * Whether customer are allowed to tip during the * [eCommerce checkout](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup). */ allowCustomerTip?: boolean | null; /** * Whether the business owners are given the option to add a tip during the * payment collection flow in their dashboard. * * Default: `true` */ allowBusinessTipAtPayment?: boolean | null; /** * Whether customers can enter a custom tip amount. If set to `false`, customers * can only select a tip value from the available `presets` and can't enter a * custom amount. * * Default: `true` */ allowCustomAmount?: boolean | null; /** * Whether business owners are allowed to edit tip distributions. If set to * `false`, owners can't edit distributions after they were created. * * Default: `true` */ allowEditDistribution?: boolean | null; /** * How the tip is distributed among staff. * * Supported values: * `UNKNOWN_SPLIT_METHOD`: There is no information about the staff distribution method. * `EQUAL`: The tip is distributed equally among all staff. * `PROPORTIONAL`: The tip is distributed proportionally among staff. */ staffDistributionMethod?: StaffDistributionMethod; /** * Revision number, which increments by 1 each time `tipSettings` object is * updated. To prevent conflicting changes, the current revision must be passed * when updating `tipSettings`. Ignored when creating a `tipSettings` object. * @readonly */ revision?: string | null; /** * Date and time the tip settings were created in * `YYYY-MM-DDThh:mm:ss.sssZ` format. * @readonly */ _createdDate?: Date | null; /** * Date and time the tip settings were last updated * `YYYY-MM-DDThh:mm:ss.sssZ` format. * @readonly */ _updatedDate?: Date | null; /** * Whether these are the default tip settings. Wix Tips automatically creates * the default settings during the app's installation. You can't delete these * default settings but you can update them. Wix Tips uses the default settings * to calculate tips, unless you specify other settings. * @readonly */ default?: boolean | null; /** * ID of the app that has created the settings. See the list of app IDs for * [Wix business solutions](https://dev.wix.com/docs/rest/articles/getting-started/wix-business-solutions). */ appId?: string | null; /** * Custom field data for the `tipSettings` object. Extended fields must be * configured in the app dashboard before they can be accessed with API calls. */ extendedFields?: ExtendedFields; } /** @oneof */ export interface TipSettingsIdentifierOneOf { /** * ID of the [location](https://dev.wix.com/docs/sdk/backend-modules/business-tools/locations/introduction) * for which the tip settings apply. */ locationId?: string | null; /** * ID of the payment terminal for which the tip settings apply. Wix Tips doesn't * validate the ID you provide. * * Max: 30 characters */ paymentTerminalId?: string | null; /** * ID of the Wix user for whom the tip settings apply. For example, the site owner or a * [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site). */ userId?: string | null; } export declare enum TipType { /** There is no information about the tip type. */ UNKNOWN_TIP_TYPE = "UNKNOWN_TIP_TYPE", /** The tip is calculated as a percentage of the subtotal of all related line items. */ PERCENTAGE = "PERCENTAGE", /** The tip is a fixed amount. */ AMOUNT = "AMOUNT" } export interface Preset { /** * Value of the preset tip choice that's displayed to customers in the * [eCommerce checkout](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup). * For example, `5`, `10`, and `15` percent or `1`, `3`, and `5` USD. * * Min: `0` */ value?: number | null; /** * Whether this tip choice value is the dafault preset that's highlighted automatically in the * [eCommerce checkout](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup). * * Default: `false` */ default?: boolean | null; } export declare enum StaffDistributionMethod { /** There is no information about the staff distribution method. */ UNKNOWN_SPLIT_METHOD = "UNKNOWN_SPLIT_METHOD", /** All staff receive an equal amount of the tip. */ EQUAL = "EQUAL", /** Staff receive a proportional amount of the tip. */ PROPORTIONAL = "PROPORTIONAL" } export interface ExtendedFields { /** * Extended field data. Each key corresponds to the namespace of the app that created the extended fields. * The value of each key is structured according to the schema defined when the extended fields were configured. * * You can only access fields for which you have the appropriate permissions. * * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields). */ namespaces?: Record>; } export interface QueryTipSettingsRequest { /** WQL expression */ query: QueryV2; } export interface QueryV2 extends QueryV2PagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; /** * Filter object in the following format: * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: Record | null; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ sort?: Sorting[]; /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */ fields?: string[]; /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */ fieldsets?: string[]; } /** @oneof */ export interface QueryV2PagingMethodOneOf { /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; } export interface Sorting { /** Name of the field to sort by. */ fieldName?: string; /** Sort order. */ order?: SortOrder; } export declare enum SortOrder { ASC = "ASC", DESC = "DESC" } export interface Paging { /** Number of items to load. */ limit?: number | null; /** Number of items to skip in the current sort order. */ offset?: number | null; } export interface CursorPaging { /** Maximum number of items to return in the results. */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. */ cursor?: string | null; } export interface QueryTipSettingsResponse { /** Retrieved `tipSettings` objects. */ tipSettings?: TipSettings[]; /** Metadate for the paged set of retrieved `tipSettings` objects. */ pagingMetadata?: PagingMetadataV2; } export interface PagingMetadataV2 { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */ total?: number | null; /** Flag that indicates the server failed to calculate the `total` field. */ tooManyToCount?: boolean | null; /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */ cursors?: Cursors; } export interface Cursors { /** Cursor string pointing to the next page in the list of results. */ next?: string | null; /** Cursor pointing to the previous page in the list of results. */ prev?: string | null; } export interface UpdateTipSettingsRequest { /** Tip settings to update. */ tipSettings: TipSettings; } export interface UpdateTipSettingsResponse { /** Updated tip settings. */ tipSettings?: TipSettings; } export interface CreateTipSettingsRequest { /** Tip settings to create. */ tipSettings: TipSettings; } export interface CreateTipSettingsResponse { /** Created tip settings. */ tipSettings?: TipSettings; } export interface CreateDefaultTipSettingsRequest { /** Dafault tip settings to create. */ tipSettings: TipSettings; } export interface CreateDefaultTipSettingsResponse { /** Created default tip settings. */ tipSettings?: TipSettings; } export interface DeleteTipSettingsRequest { /** ID of the `tipSettings` object to delete. */ tipSettingsId: string | null; } export interface DeleteTipSettingsResponse { } export interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ _id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * Example: created/updated/deleted/started/completed/email_opened */ slug?: string; /** ID of the entity associated with the event. */ entityId?: string; /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */ eventTime?: Date | null; /** * Whether the event was triggered as a result of a privacy regulation application * (for example, GDPR). */ triggeredByAnonymizeRequest?: boolean | null; /** If present, indicates the action that triggered the event. */ originatedFrom?: string | null; /** * A sequence number defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } /** @oneof */ export interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } export interface EntityCreatedEvent { entity?: string; } export interface RestoreInfo { deletedDate?: Date | null; } export interface EntityUpdatedEvent { /** * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff. * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects. * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it. */ currentEntity?: string; } export interface EntityDeletedEvent { /** Entity that was deleted */ deletedEntity?: string | null; } export interface ActionEvent { body?: string; } export interface MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } export interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: WebhookIdentityType; } /** @oneof */ export interface IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; } export declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } export interface TipSettingsNonNullableFields { tipType: TipType; staffDistributionMethod: StaffDistributionMethod; } export interface QueryTipSettingsResponseNonNullableFields { tipSettings: TipSettingsNonNullableFields[]; } export interface UpdateTipSettingsResponseNonNullableFields { tipSettings?: TipSettingsNonNullableFields; } export interface CreateTipSettingsResponseNonNullableFields { tipSettings?: TipSettingsNonNullableFields; } export interface CreateDefaultTipSettingsResponseNonNullableFields { tipSettings?: TipSettingsNonNullableFields; } /** * Creates a query to retrieve a list of tip settings. * * The `queryTipSettings()` function builds a query to retrieve a list of tip settings and returns a `TipSettingsQueryBuilder` object. * * The returned object contains the query definition, which is typically used to run the query using the [find()](https://dev.wix.com/docs/sdk/backend-modules/ecom/tip-settings/tip-settings-query-builder/find) function. * * You can refine the query by chaining `TipSettingsQueryBuilder` functions onto the query. `TipSettingsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTipSettings()` returns. * * `queryTipSettings()` runs with the following `TipSettingsQueryBuilder` default that you can override: * * + `limit` is `50`. * + Sorted by `id` in ascending order. * * The functions that are chained to `queryTipSettings()` are applied in the order they are called. For example, if you apply `ascending("tipType")` and then `ascending("locationId")`, the results are sorted first by the `"tipType"`, and then, if there are multiple results with the same `"tipType"`, the items are sorted by `"locationId"`. * * The following `TipSettingsQueryBuilder` functions are supported for the `queryTipSettings()` function. For a full description of the tip settings object, see the object returned for the [items](https://dev.wix.com/docs/sdk/backend-modules/ecom/tip-settings/tip-settings-query-result/items) property in `TipSettingsQueryResult`. * @public * @documentationMaturity preview * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @permissionId WIX_TIPS.TIP_SETTINGS_READ * @applicableIdentity APP * @applicableIdentity VISITOR * @fqn wix.tips.settings.v1.TipSettingsService.QueryTipSettings */ export declare function queryTipSettings(): TipSettingsQueryBuilder; interface QueryCursorResult { cursors: Cursors; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } export interface TipSettingsQueryResult extends QueryCursorResult { items: TipSettings[]; query: TipSettingsQueryBuilder; next: () => Promise; prev: () => Promise; } export interface TipSettingsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ eq: (propertyName: 'locationId' | 'paymentTerminalId' | '_id' | 'tipType' | 'allowCustomerTip' | 'allowBusinessTipAtPayment' | 'allowCustomAmount' | 'allowEditDistribution' | 'default', value: any) => TipSettingsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ne: (propertyName: 'locationId' | 'paymentTerminalId' | '_id' | 'tipType' | 'allowCustomerTip' | 'allowBusinessTipAtPayment' | 'allowCustomAmount' | 'allowEditDistribution' | 'default', value: any) => TipSettingsQueryBuilder; /** @param propertyName - Property whose value is compared with `string`. * @param string - String to compare against. Case-insensitive. * @documentationMaturity preview */ startsWith: (propertyName: 'locationId' | 'paymentTerminalId' | '_id', value: string) => TipSettingsQueryBuilder; /** @param propertyName - Property whose value is compared with `values`. * @param values - List of values to compare against. * @documentationMaturity preview */ hasSome: (propertyName: 'locationId' | 'paymentTerminalId' | '_id' | 'tipType' | 'allowCustomerTip' | 'allowBusinessTipAtPayment' | 'allowCustomAmount' | 'allowEditDistribution' | 'default', value: any[]) => TipSettingsQueryBuilder; /** @documentationMaturity preview */ in: (propertyName: 'locationId' | 'paymentTerminalId' | '_id' | 'tipType' | 'allowCustomerTip' | 'allowBusinessTipAtPayment' | 'allowCustomAmount' | 'allowEditDistribution' | 'default', value: any) => TipSettingsQueryBuilder; /** @documentationMaturity preview */ exists: (propertyName: 'locationId' | 'paymentTerminalId' | '_id' | 'tipType' | 'allowCustomerTip' | 'allowBusinessTipAtPayment' | 'allowCustomAmount' | 'allowEditDistribution' | 'default', value: boolean) => TipSettingsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ ascending: (...propertyNames: Array<'locationId' | 'paymentTerminalId' | '_id' | 'tipType' | 'allowCustomerTip' | 'allowBusinessTipAtPayment' | 'allowCustomAmount' | 'allowEditDistribution' | 'default'>) => TipSettingsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ descending: (...propertyNames: Array<'locationId' | 'paymentTerminalId' | '_id' | 'tipType' | 'allowCustomerTip' | 'allowBusinessTipAtPayment' | 'allowCustomAmount' | 'allowEditDistribution' | 'default'>) => TipSettingsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. * @documentationMaturity preview */ limit: (limit: number) => TipSettingsQueryBuilder; /** @param cursor - A pointer to specific record * @documentationMaturity preview */ skipTo: (cursor: string) => TipSettingsQueryBuilder; /** @documentationMaturity preview */ find: () => Promise; } /** * Updates a `tipSettings` object. * * * You can't update the `default` field. * @param tipSettings - Tip settings to update. * @public * @documentationMaturity preview * @requiredField tipSettings * @param options - Options to use when updating tip settings. * @permissionId WIX_TIPS.TIP_SETTINGS_UPDATE * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @applicableIdentity APP * @returns Updated tip settings. * @fqn wix.tips.settings.v1.TipSettingsService.UpdateTipSettings */ export declare function updateTipSettings(tipSettings: TipSettings): Promise; /** * Creates a `tipSettings` object. * * * You can't create a `tipSettings` object with `{"default": true}`. * @param tipSettings - Tip settings to create. * @public * @documentationMaturity preview * @requiredField tipSettings * @permissionId WIX_TIPS.TIP_SETTINGS_CREATE * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @applicableIdentity APP * @returns Created tip settings. * @fqn wix.tips.settings.v1.TipSettingsService.CreateTipSettings */ export declare function createTipSettings(tipSettings: TipSettings): Promise; /** * Creates a default `tipSettings` object. * * * The call fails if there is already an existing default `tipSettings` object. * @param tipSettings - Dafault tip settings to create. * @public * @documentationMaturity preview * @requiredField tipSettings * @permissionId WIX_TIPS.TIP_SETTINGS_CREATE * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @applicableIdentity APP * @fqn wix.tips.settings.v1.TipSettingsService.CreateDefaultTipSettings */ export declare function createDefaultTipSettings(tipSettings: TipSettings): Promise; /** * Deletes a `tipSettings` object. * * * You can't delete the default `tipSettings` object. * @param tipSettingsId - ID of the `tipSettings` object to delete. * @public * @documentationMaturity preview * @requiredField tipSettingsId * @permissionId WIX_TIPS.TIP_SETTINGS_DELETE * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @applicableIdentity APP * @fqn wix.tips.settings.v1.TipSettingsService.DeleteTipSettings */ export declare function deleteTipSettings(tipSettingsId: string | null): Promise; export {};