applyBookingFeesToOrder( )


Applies booking fees to an eCommerce order.

The booking fees are added as a single additional fee to the eCommerce order. The order's additionalFee.lineItemIds array is set to the list of corresponding booking IDs. By default, the additionalFee.price.amount is the sum of all booking fee prices. But you may provide a priceOverride instead. The override price can't be higher than the sum of all booking fees.

Apply Booking Fees to Order also updates the prices of all affected line items in the relevant eCommerce order to zero. After a cancellation fee is applied to an eCommerce order, the cancellation fee's price.value is updated to 0.00 and its trigger is set to UNKNOWN_TRIGGER. You can retrieve the fee amount from the corresponding additionalFee object of the eCommerce order with Search Orders.

If you apply multiple booking fees to an eCommerce order, they either all fail or all succeed together. For example, the call fails if the booking fees are associated with different eCommmerce orders.

Authentication
  • When developing websites or building an app with Blocks, this method may require elevated permissions, depending on the identity of the user calling it and the calling user's permissions.
  • When building apps without Blocks or for headless projects, you can only call this method directly when authenticated as a Wix app or Wix user identity. When authenticated as a different identity, you can call this method using elevation.
  • Elevation permits users to call methods they typically cannot access. Therefore, you should only use it intentionally and securely.
Permissions
Manage Bookings
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
bookingIdsArray<string>Required

IDs of the bookings for which to apply booking fees to an eCommerce order.


optionsApplyBookingFeesToOrderOptions

Options to use when applying booking fees to an eCommerce order.

Returns
Return Type:Promise<ApplyBookingFeesToOrderResponse>
Errors
403Permission Denied

There is 1 error with this status code.

404Not Found

There are 2 errors with this status code.

409Already Exists

There is 1 error with this status code.

428Failed Precondition

There are 9 errors with this status code.

500Internal

There are 2 errors with this status code.

This method may also return standard errors. Learn more about standard Wix errors.

Did this help?