/** * A tip holds information about how much a customer has tipped, how the tip is * distributed among staff, and the associated order’s line item subtotal. */ export interface Tip { /** * ID of the tip. Identical to the `code` of the related `order.additionalFee`. * @readonly */ _id?: string | null; /** * Subtotal of all line items from the [eCommerce order](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) * that's related to the tip. In the response of * [previewTip()](https://dev.wix.com/docs/sdk/backend-modules/ecom/tips/preview-tip), * there is no related eCommerce order. Then, value of this field corresponds to * the sum of all line item prices passed in the request. * @readonly */ lineItemSubtotal?: string | null; /** * Total amount of the tip. * * Min: `0.00` */ amount?: string | null; /** * Details about how the tip is shared among staff. Available only if at least * one staff member receives part of the tip, and it's not entirely allocated to * the business. * * Max: 50 distributions */ distributions?: TipDistribution[]; /** * Undistributed tip amount. Calculated as the difference between `tip.amount` * and the sum of all `tip.tipDistributions.amount` values. * * Min: `0.01` * @readonly */ undistributedAmount?: string | null; } export interface TipDistribution { /** * ID of the tip distribution. * @readonly */ _id?: string | null; /** * ID of the tip associated with the distribution. Matches the corresponding * `order.additionalFee.code`. * @readonly */ tipId?: string | null; /** Information about the business staff receiving the tip distribution. */ staff?: Staff; /** * Amount of the tip distribution. * * Min: `0.00` */ amount?: string | null; /** * Details about the related line items from the * [eCommerce order](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup). * */ lineItemInfo?: LineItemInfo[]; /** * Details of how the customer is charged for the tip. Available only if the * [transcation](https://dev.wix.com/docs/sdk/backend-modules/ecom/order-transactions/setup) * has been created. */ transaction?: Transaction; /** * ID of the [eCommerce order](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup) * associated with the tip distribution. Identical for all distributions that * belong to the same tip. * @readonly */ orderId?: string | null; /** * Date and time the distribution was created in * `YYYY-MM-DDThh:mm:ss.sssZ` format. * @readonly */ _createdDate?: Date | null; } export interface CommonIdentificationData extends CommonIdentificationDataIdOneOf { /** ID of a site visitor who hasn't logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor who has logged in to the site. */ memberId?: string; /** * ID of a Wix user. For example, the site owner or a * [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** * ID of the [contact](https://dev.wix.com/docs/sdk/backend-modules/crm/contacts/introduction) * in the site's [CRM by Ascend](https://www.wix.com/ascend/crm) system. */ contactId?: string | null; } /** @oneof */ export interface CommonIdentificationDataIdOneOf { /** ID of a site visitor who hasn't logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor who has logged in to the site. */ memberId?: string; /** * ID of a Wix user. For example, the site owner or a * [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site). */ wixUserId?: string; /** ID of an app. */ appId?: string; } export declare enum IdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } export interface Staff { /** * ID of the staff receiving the tip. Matches `staffMemberId` if available, or * `identificationData.wixUserId` if not. * @readonly */ _id?: string | null; /** * Staff name. Matches `staffMember.name` if the staff is a * Bookings staff member, * or the [contact](https://dev.wix.com/docs/sdk/backend-modules/crm/contacts/introduction)'s * `info.name` if not. * * Max: 500 characters * @readonly */ name?: string | null; /** * ID of the Bookings staff member. * Available only if the staff is a staff member and not a * [site collaborator](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site). */ staffMemberId?: string | null; /** * Identification data. Available only if the staff is a * [contact](https://dev.wix.com/docs/rest/crm/members-contacts/contacts/contacts/contact-v4/contact-object) * on the Wix site. Note that not all site collaborators are also * [staff members](https://dev.wix.com/docs/rest/business-solutions/bookings/staff-members/introduction). */ identificationData?: CommonIdentificationData; } export interface LineItemInfo { /** * IDs of the line items associated with the tip. * * Min: 1 character * Max: 100 characters */ lineItemId?: string | null; /** * Information about the line item and the corresponding catalog. Catalogs * include Wix Bookings and Wix Stores. */ catalogReference?: CatalogReference; /** * Price of the line item. * * Min: `0.00` */ price?: string | null; /** * Name of the line item, which is identical to: * + `product.name` for [Stores](https://dev.wix.com/docs/sdk/backend-modules/stores/products/introduction). * + `service.name` for [Bookings](https://dev.wix.com/docs/sdk/backend-modules/bookings/introduction). * * Min: 1 character * Max: 200 characters */ name?: string | null; /** * Quantity of the line item. * * Min: `1` * Max: `100000` (one hundred thousand) */ quantity?: number | null; } export interface CatalogReference { /** * ID of the line item within its catalog, corresponding to: * + `product.id` for [Stores](https://dev.wix.com/docs/rest/business-solutions/stores/about-wix-stores). * + `service.id` for [Bookings](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings). */ catalogItemId?: string | null; /** * ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/wix-business-solutions) * to which the catalog belongs. * * Supported app IDs: * + [Wix Tips](https://www.wix.com/app-market/wix-tips): `"869a50c8-dd38-4324-b201-e33dc0747a5f"` * + [Wix Stores](https://www.wix.com/app-market/wix-stores): `"215238eb-22a5-4c36-9e7b-e7c08025e04e"` * + [Wix Bookings](https://www.wix.com/app-market/bookings): `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"` * + [Wix Restaurants Orders](https://www.wix.com/app-market/web-solution/wix-restaurants-orders-new): `"13e8d036-5516-6104-b456-c8466db39542"` */ appId?: string | null; } export interface Transaction { /** ID of the transaction that's associated with the tip distribution. */ _id?: string | null; /** * Date and time the transaction was created in `YYYY-MM-DDThh:mm:ss.sssZ` * format. Isn't identical to the time the customer was actually charged. */ date?: Date | null; } export declare enum Source { /** There is no information about who created the tip distributions. */ UNKNOWN_SOURCE = "UNKNOWN_SOURCE", /** The customer added the tip distributions via an external payment terminal. */ POS = "POS", /** The customer added the tip distributions during an online [ecommerce checkout](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction). */ WEB = "WEB", /** The business added the tip distributions on behalf of the customer in the site's dashboard. */ DASHBOARD = "DASHBOARD" } export interface PreviewTipRequest { /** * Information about the line items to preview the tip for. * * Min: 1 line item * Max: 50 line items */ lineItemInfo: LineItemInfo[]; /** * Information about how to calculate the total tip amount and the distribution * amounts. */ tipChoice: TipChoice; /** * ID of the tip settings used to preview the tip. If you don't provide a * `tipSettingsId`, the `staffDistributionMethod` is based on the site's * default tip settings. */ tipSettingsId?: string | null; } export interface TipChoice { /** Value of the tip choice. */ value?: string | null; /** * Type of the tip choice. * * Supported values: * + `UNKNOWN_TIP_TYPE`: There is no information about the tip type. * + `PERCENTAGE`: The tip is calculated as a percentage of the subtotal of associated line items. * + `AMOUNT`: The tip is a fixed value, pre-configured from the relevant settings presets. * + `CUSTOM`: The customer, or the business on behalf of the customer, manually set a tip amount, which may not match any preset values. */ tipType?: TipType; } 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 associated line items. */ PERCENTAGE = "PERCENTAGE", /** The tip is a fixed value, pre-configured from the relevant settings presets. */ AMOUNT = "AMOUNT", /** The customer, or the business on behalf of the customer, manually set a tip amount, which may not match any preset values. */ CUSTOM = "CUSTOM" } export interface PreviewTipResponse { /** Tip. */ tip?: Tip; } export interface GetTipByOrderIdRequest { /** ID of the order to retrieve the tip for. */ orderId: string | null; } export interface GetTipByOrderIdResponse { /** Retrieved tip. */ tip?: Tip; } export interface GetTipByDraftOrderIdRequest { /** ID of the draft order to retrieve the tip for. */ draftOrderId: string | null; } export interface GetTipByDraftOrderIdResponse { /** Retrieved tip. */ tip?: Tip; } export interface GetTipChoiceRequest { /** * ID of the [eCommerce purchase flow](https://dev.wix.com/docs/rest/business-solutions/e-commerce/wix-e-commerce-platform-handbook/overview/architecture-data-flow) * to retrieve the tip choice for. */ purchaseFlowId: string | null; } export interface GetTipChoiceResponse { /** Tip choice that's currently selected for the given purchase flow. */ tipChoice?: TipChoice; } export interface UpdateTipChoiceRequest { /** * Tip choice to select for the purchase flow. The call fails if you provide a * value for `tipChoice.tipType` that doesn't match the relevant tip settings * configuration. For example: * + `AMOUNT` when `tipSettings.tipType` isn't `AMOUNT`. * + `PERCENTAGE` when `tipSettings.tipType` isn't `PERCENTAGE`. * + `CUSTOM` when `tipSettings.allowCustomTip` is `false`. */ tipChoice: TipChoice; /** * ID of the purchase flow that's associated with the * [eCommerce order](https://dev.wix.com/docs/rest/business-solutions/e-commerce/order/introduction) */ purchaseFlowId: string | null; } export interface UpdateTipChoiceResponse { /** * Tip choice currently selected in the * [eCommerce checkout](https://dev.wix.com/docs/rest/business-solutions/e-commerce/checkout/introduction) * for the given purchase flow. */ tipChoice?: TipChoice; } export interface SetTipOnOrderRequest extends SetTipOnOrderRequestIdentifierOneOf { /** ID of the order for which to set the tip. */ orderId?: string | null; /** Tip to set on the order. */ tip: Tip; } /** @oneof */ export interface SetTipOnOrderRequestIdentifierOneOf { /** ID of the order for which to set the tip. */ orderId?: string | null; } export interface SetTipOnOrderResponse { /** Set tip. */ tip?: Tip; /** Information about the order on which the tip was set. */ orderInfo?: OrderInfo; } export interface OrderInfo extends OrderInfoIdentifierOneOf { /** Order ID. */ orderId?: string | null; /** ID of the order's additional fee that's associated with the tip. */ additionalFeeId?: string | null; /** Price of the order's additional fee that's associated with the tip. */ additionalFeePrice?: Price; } /** @oneof */ export interface OrderInfoIdentifierOneOf { /** Order ID. */ orderId?: string | null; } export interface Price { /** Amount of the additional fee that's associated with the tip. */ amount?: string; /** * Amount formatted with currency symbol. * * Max: 100 characters * @readonly */ formattedAmount?: string; } export interface RemoveTipFromOrderRequest extends RemoveTipFromOrderRequestIdentifierOneOf { /** ID of the order from which to remove the tip. */ orderId?: string | null; } /** @oneof */ export interface RemoveTipFromOrderRequestIdentifierOneOf { /** ID of the order from which to remove the tip. */ orderId?: string | null; } export interface RemoveTipFromOrderResponse { /** Information about the order from which the tip was removed. */ orderInfo?: OrderInfo; } export interface CreateTipDistributionsRequest { /** * Tip distributions to create. * * Min: 1 distribution * Max: 50 distributions */ tipDistributions?: TipDistribution[]; /** ID of the tip for which to create distributions. */ tipId?: string | null; } export interface CreateTipDistributionsResponse { /** * ID of the tip for which the distributions were created. * @readonly */ tipId?: string | null; /** Created tip distributions. */ tipDistributions?: TipDistribution[]; } export interface DeleteTipDistributionsRequest extends DeleteTipDistributionsRequestDeleteByOneOf { /** ID of the tip for which to delete all associated tip distributions. */ tipId?: string | null; /** ID of the order for which to delete all associated tip distributions. */ orderId?: string | null; } /** @oneof */ export interface DeleteTipDistributionsRequestDeleteByOneOf { /** ID of the tip for which to delete all associated tip distributions. */ tipId?: string | null; /** ID of the order for which to delete all associated tip distributions. */ orderId?: string | null; } export interface DeleteTipDistributionsResponse { } export interface AddTipDistributionsToOrderRequest extends AddTipDistributionsToOrderRequestIdentifierOneOf { /** ID of the order for which to add tip distributions. */ orderId?: string | null; /** Tip distributions to add to the order. */ tipDistributions: TipDistribution[]; } /** @oneof */ export interface AddTipDistributionsToOrderRequestIdentifierOneOf { /** ID of the order for which to add tip distributions. */ orderId?: string | null; } export interface AddTipDistributionsToOrderResponse { /** Tip distributions that were added to the order. */ tipDistributions?: TipDistribution[]; /** Information about the order to which the tip distributions were added. */ orderInfo?: OrderInfo; } export interface QueryTipDistributionsRequest { /** WQL expression. */ query: CursorQuery; } export interface CursorQuery extends CursorQueryPagingMethodOneOf { /** 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[]; } /** @oneof */ export interface CursorQueryPagingMethodOneOf { /** 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 CursorPaging { /** Number of items to load. */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * You can get 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 QueryTipDistributionsResponse { /** Retrieved tip distributions. */ tipDistributions?: TipDistribution[]; /** Paging metadata. */ pagingMetadata?: CursorPagingMetadata; } export interface CursorPagingMetadata { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ cursors?: Cursors; /** * Indicates if there are more results after the current page. * If `true`, another page of results can be retrieved. * If `false`, this is the last page. */ hasNext?: boolean | null; } export interface Cursors { /** Cursor pointing to next page in the list of results. */ next?: string | null; /** Cursor pointing to previous page in the list of results. */ prev?: string | null; } export interface SumTipDistributionAmountsRequest { /** * 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; } export interface SumTipDistributionAmountsResponse { /** Total amount of tip distributions matching the filter. */ totalAmount?: string | null; } export interface ApplyTipDistributionsRequest { /** ID of the tip for which all tip distributions are applied to the order. */ tipId?: string | null; /** ID of the order for which to apply all tip distributions. */ orderId?: string | null; /** Whether to query by order ID or tip ID. */ queryBy?: QueryBy; } export declare enum QueryBy { UNKNOWN_QUERY_BY = "UNKNOWN_QUERY_BY", ORDER = "ORDER", TIP = "TIP" } export interface ApplyTipDistributionsResponse { /** Applied tip distributions. */ tipDistributions?: TipDistribution[]; } export interface PublishTipDistributionsCreatedEventRequest { /** The tip distributions that will be published on the event. */ tipDistributions?: TipDistribution[]; /** The tip ID of the distributions */ tipId?: string | null; /** The order ID that the tip is connected to */ orderId?: string | null; } export interface PublishTipDistributionsCreatedEventResponse { } export interface TipDistributionsCreated { /** ID of the tip to which the distribution belongs. */ tipId?: string | null; /** * Created tip distributions. * * Min: 1 tip distribution * Max: 100 tip distributions */ tipDistributions?: TipDistribution[]; /** The order ID that the tip is connected to */ orderId?: string | null; /** The undistributed tip amount */ undistributedAmount?: string | null; } 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" } interface CommonIdentificationDataNonNullableFields { anonymousVisitorId: string; memberId: string; wixUserId: string; appId: string; identityType: IdentityType; } interface StaffNonNullableFields { identificationData?: CommonIdentificationDataNonNullableFields; } interface TipDistributionNonNullableFields { staff?: StaffNonNullableFields; source: Source; } interface TipNonNullableFields { distributions: TipDistributionNonNullableFields[]; } export interface PreviewTipResponseNonNullableFields { tip?: TipNonNullableFields; } export interface GetTipByOrderIdResponseNonNullableFields { tip?: TipNonNullableFields; } export interface GetTipByDraftOrderIdResponseNonNullableFields { tip?: TipNonNullableFields; } interface TipChoiceNonNullableFields { tipType: TipType; } export interface GetTipChoiceResponseNonNullableFields { tipChoice?: TipChoiceNonNullableFields; } export interface UpdateTipChoiceResponseNonNullableFields { tipChoice?: TipChoiceNonNullableFields; } interface PriceNonNullableFields { amount: string; formattedAmount: string; } interface OrderInfoNonNullableFields { additionalFeePrice?: PriceNonNullableFields; } export interface SetTipOnOrderResponseNonNullableFields { tip?: TipNonNullableFields; orderInfo?: OrderInfoNonNullableFields; } export interface RemoveTipFromOrderResponseNonNullableFields { orderInfo?: OrderInfoNonNullableFields; } export interface AddTipDistributionsToOrderResponseNonNullableFields { tipDistributions: TipDistributionNonNullableFields[]; orderInfo?: OrderInfoNonNullableFields; } export interface QueryTipDistributionsResponseNonNullableFields { tipDistributions: TipDistributionNonNullableFields[]; } /** * Previews a tip for a list of line items. * * * If you provide the Wix Bookings app ID `13d21c63-b5ec-5912-8397-c3a5ddb27a97` as `lineItemInfo.catalogReference.appId`, the response includes tip * distributions for each associated Bookings staff member. * * If you don't provide a `tipSettingsId`, the `staffDistributionMethod` is * based on the site's default tip settings. * @param lineItemInfo - Information about the line items to preview the tip for. * * Min: 1 line item * Max: 50 line items * @public * @documentationMaturity preview * @requiredField lineItemInfo * @requiredField lineItemInfo.catalogReference.appId * @requiredField lineItemInfo.catalogReference.catalogItemId * @requiredField lineItemInfo.price * @requiredField options.tipChoice * @requiredField options.tipChoice.tipType * @requiredField options.tipChoice.value * @param options - Options to use when previewing a tip. * @permissionId WIX_TIPS.TIP_PREVIEW * @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.tip.v1.TipsService.PreviewTip */ export declare function previewTip(lineItemInfo: LineItemInfo[], options?: PreviewTipOptions): Promise; export interface PreviewTipOptions { /** * Information about how to calculate the total tip amount and the distribution * amounts. */ tipChoice: TipChoice; /** * ID of the tip settings used to preview the tip. If you don't provide a * `tipSettingsId`, the `staffDistributionMethod` is based on the site's * default tip settings. */ tipSettingsId?: string | null; } /** * Retrieves the tip that's associated with an * [eCommerce order](https://dev.wix.com/docs/sdk/backend-modules/ecom/orders/setup). * @param orderId - ID of the order to retrieve the tip for. * @public * @documentationMaturity preview * @requiredField orderId * @permissionId WIX_TIPS.TIP_READ * @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.tip.v1.TipsService.GetTipByOrderId */ export declare function getTipByOrderId(orderId: string | null): Promise; /** * Retrieves the tip that's associated with an eCommerce draft order. * * *
* * __Important:__ * The eCommerce Draft Orders API is currently under development and not yet available to users. * *
* @param draftOrderId - ID of the draft order to retrieve the tip for. * @public * @documentationMaturity preview * @requiredField draftOrderId * @permissionId WIX_TIPS.TIP_READ * @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.tip.v1.TipsService.GetTipByDraftOrderId */ export declare function getTipByDraftOrderId(draftOrderId: string | null): Promise; /** * Retrieves the tip choice that's currently selected by the customer for a specific [eCommerce checkout](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup). * If the customer hasn't yet selected a tip choice, the response is empty. * @param purchaseFlowId - ID of the [eCommerce purchase flow](https://dev.wix.com/docs/rest/business-solutions/e-commerce/wix-e-commerce-platform-handbook/overview/architecture-data-flow) * to retrieve the tip choice for. * @public * @documentationMaturity preview * @requiredField purchaseFlowId * @permissionId WIX_TIPS.TIP_GET_CHOICE * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @applicableIdentity APP * @applicableIdentity VISITOR * @fqn wix.tips.tip.v1.TipsService.GetTipChoice */ export declare function getTipChoice(purchaseFlowId: string | null): Promise; /** * Updates the tip choice that's currently selected by the customer for a specific [eCommerce checkout](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup). * @param tipChoice - Tip choice to select for the purchase flow. The call fails if you provide a * value for `tipChoice.tipType` that doesn't match the relevant tip settings * configuration. For example: * + `AMOUNT` when `tipSettings.tipType` isn't `AMOUNT`. * + `PERCENTAGE` when `tipSettings.tipType` isn't `PERCENTAGE`. * + `CUSTOM` when `tipSettings.allowCustomTip` is `false`. * @public * @documentationMaturity preview * @requiredField options * @requiredField options.purchaseFlowId * @requiredField tipChoice * @param options - Options to use when updating a tip choice. * @permissionId WIX_TIPS.TIP_UPDATE_CHOICE * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @applicableIdentity APP * @applicableIdentity VISITOR * @fqn wix.tips.tip.v1.TipsService.UpdateTipChoice */ export declare function updateTipChoice(tipChoice: TipChoice, options: UpdateTipChoiceOptions): Promise; export interface UpdateTipChoiceOptions { /** * ID of the purchase flow that's associated with the * [eCommerce order](https://dev.wix.com/docs/rest/business-solutions/e-commerce/order/introduction) */ purchaseFlowId: string | null; } /** * Updates the tip choice that's currently selected by the customer for a specific [eCommerce checkout](https://dev.wix.com/docs/sdk/backend-modules/ecom/checkout/setup). * @public * @documentationMaturity preview * @requiredField options.tip * @requiredField options.tip.distributions.transaction._id * @requiredField options.tip.distributions.transaction.date * @param options - Options to use when setting a tip on an order. * @permissionId WIX_TIPS.TIP_SET * @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.tip.v1.TipsService.SetTipOnOrder */ export declare function setTipOnOrder(options?: SetTipOnOrderOptions): Promise; export interface SetTipOnOrderOptions extends SetTipOnOrderRequestIdentifierOneOf { /** ID of the order for which to set the tip. */ orderId?: string | null; /** Tip to set on the order. */ tip: Tip; } /** * Removes a tip from an * [eCommerce order](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction). * * * If no tip exists on the order, the call succeeds and the response contains an * empty `OrderInfo` object. * * The call fails if the customer has already been charged for at least one of * the associated tip distributions. * @public * @documentationMaturity preview * @param options - Options to use when removing a tip from an order. * @permissionId WIX_TIPS.TIP_REMOVE * @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.tip.v1.TipsService.RemoveTipFromOrder */ export declare function removeTipFromOrder(options?: RemoveTipFromOrderOptions): Promise; export interface RemoveTipFromOrderOptions extends RemoveTipFromOrderRequestIdentifierOneOf { /** ID of the order from which to remove the tip. */ orderId?: string | null; } /** * Adds tip distributions to an * [eCommerce order](https://dev.wix.com/docs/rest/business-solutions/e-commerce/orders/introduction). * * * If no tip exists on the order, an `additionalFee` is added and the total tip * amount is equal to the sum of all distribution amounts. If a tip is already * present, the existing `additionalFee` is replaced and the total tip amount is * increased by the sum of the new tip distributions. * * The call fails if: * + The order's `paymentStatus` is either `FULLY_REFUNDED` or `PARTIALLY_REFUNDED`. * + Any of the tip distribution amounts is zero or negative. * @public * @documentationMaturity preview * @requiredField options.tipDistributions * @requiredField options.tipDistributions.transaction._id * @requiredField options.tipDistributions.transaction.date * @param options - Options to use when adding tip distributions to an order. * @permissionId WIX_TIPS.TIP_DISTRIBUTION_ADD * @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.tip.v1.TipsService.AddTipDistributionsToOrder */ export declare function addTipDistributionsToOrder(options?: AddTipDistributionsToOrderOptions): Promise; export interface AddTipDistributionsToOrderOptions extends AddTipDistributionsToOrderRequestIdentifierOneOf { /** ID of the order for which to add tip distributions. */ orderId?: string | null; /** Tip distributions to add to the order. */ tipDistributions: TipDistribution[]; } /** * Creates a query to retrieve a list of tip distributions. * * The `queryTipDistributions()` function builds a query to retrieve a list of tip distributions and returns a `TipDistributionsQueryBuilder` 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/tips/tip-distributions-query-builder/find) function. * * You can refine the query by chaining `TipDistributionsQueryBuilder` functions onto the query. `TipDistributionsQueryBuilder` functions enable you to sort, filter, and control the results that `queryTipDistributions()` returns. * * `queryTipDistributions()` runs with the following `TipDistributionsQueryBuilder` default that you can override: * * + `limit` is `50` * * The functions that are chained to `queryTipDistributions()` are applied in the order they are called. For example, if you apply `ascending("transaction.transactionDate")` and then `ascending("staff.id")`, the results are sorted first by the `"transaction.transactionDate"`, and then, if there are multiple results with the same `"transaction.transactionDate"`, the items are sorted by `"staff.id"`. * * When setting a date filter remember to use * [UTC time](https://en.wikipedia.org/wiki/Coordinated_Universal_Time). * * The following `TipDistributionsQueryBuilder` functions are supported for the `queryTipDistributions()` function. For a full description of the tip distributions object, see the object returned for the [items](https://dev.wix.com/docs/sdk/backend-modules/ecom/tips/tip-distributions-query-result/items) property in `TipDistributionsQueryResult`. * * @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_DISTRIBUTION_READ * @applicableIdentity APP * @fqn wix.tips.tip.v1.TipsService.QueryTipDistributions */ export declare function queryTipDistributions(): TipDistributionsQueryBuilder; interface QueryCursorResult { cursors: Cursors; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } export interface TipDistributionsQueryResult extends QueryCursorResult { items: TipDistribution[]; query: TipDistributionsQueryBuilder; next: () => Promise; prev: () => Promise; } export interface TipDistributionsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ eq: (propertyName: '_id', value: any) => TipDistributionsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ ne: (propertyName: '_id', value: any) => TipDistributionsQueryBuilder; /** @param propertyName - Property whose value is compared with `string`. * @param string - String to compare against. Case-insensitive. * @documentationMaturity preview */ startsWith: (propertyName: '_id', value: string) => TipDistributionsQueryBuilder; /** @param propertyName - Property whose value is compared with `values`. * @param values - List of values to compare against. * @documentationMaturity preview */ hasSome: (propertyName: '_id', value: any[]) => TipDistributionsQueryBuilder; /** @documentationMaturity preview */ in: (propertyName: '_id', value: any) => TipDistributionsQueryBuilder; /** @documentationMaturity preview */ exists: (propertyName: '_id', value: boolean) => TipDistributionsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ ascending: (...propertyNames: Array<'_id'>) => TipDistributionsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. * @documentationMaturity preview */ descending: (...propertyNames: Array<'_id'>) => TipDistributionsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. * @documentationMaturity preview */ limit: (limit: number) => TipDistributionsQueryBuilder; /** @param cursor - A pointer to specific record * @documentationMaturity preview */ skipTo: (cursor: string) => TipDistributionsQueryBuilder; /** @documentationMaturity preview */ find: () => Promise; } /** * Sums tip distribution amounts, given the provided filtering. * @param filter - 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` * @public * @documentationMaturity preview * @requiredField filter * @permissionId WIX_TIPS.TIP_DISTRIBUTION_READ * @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.tip.v1.TipsService.SumTipDistributionAmounts */ export declare function sumTipDistributionAmounts(filter: Record | null): Promise; export {};