> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # CollectAppliedBookingFees # Package: pricing # Namespace: BookingFees # Method link: https://dev.wix.com/docs/api-reference/business-solutions/bookings/pricing/booking-fees/collect-applied-booking-fees.md ## Permission Scopes: Manage Bookings: SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS ## Introduction Collects booking fees by charging the customer using the payment method that's saved on the corresponding [eCommerce order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/introduction.md)
__Warning:__ Currently, there is no validation that prevents idempotent requests. This means that your code must make sure to not charge customers multiple times for the same booking fee. You could use [List Transactions For Single Order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/order-transactions/list-transactions-for-single-order.md) to check which charges were made previously for an eCommerce order.An HTTP status of `200` means that all booking fees were successfully collected. Any other HTPP status means that collection failed. Collects the order's `additionalFees.price.amount` that's related to the booking fees. If there are multiple additional fees on the eCommerce order, the amount that's collected differs from `priceSummary.totalAdditionalFees.amount`. Possible failure reasons include: + The order's `status` isn't `APPROVED`. + There is no payment method saved on the order. + The order's `balanceSummary.balance.amount` is lower than the `additionalFees.price.amount` to collect. + The order's `additionalFeeId` doesn't belong to a Wix Bookings cancellation fee. --- ## REST API ### Schema ``` Method: collectAppliedBookingFees Description: Collects booking fees by charging the customer using the payment method that's saved on the corresponding [eCommerce order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/introduction.md)
__Warning:__ Currently, there is no validation that prevents idempotent requests. This means that your code must make sure to not charge customers multiple times for the same booking fee. You could use [List Transactions For Single Order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/order-transactions/list-transactions-for-single-order.md) to check which charges were made previously for an eCommerce order.An HTTP status of `200` means that all booking fees were successfully collected. Any other HTPP status means that collection failed. Collects the order's `additionalFees.price.amount` that's related to the booking fees. If there are multiple additional fees on the eCommerce order, the amount that's collected differs from `priceSummary.totalAdditionalFees.amount`. Possible failure reasons include: + The order's `status` isn't `APPROVED`. + There is no payment method saved on the order. + The order's `balanceSummary.balance.amount` is lower than the `additionalFees.price.amount` to collect. + The order's `additionalFeeId` doesn't belong to a Wix Bookings cancellation fee. URL: https://www.wixapis.com/v1/booking-fees/collect Method: POST # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: orderId, additionalFeeId Method parameters: param name: additionalFeeId | type: additionalFeeId | description: GUID of the additional fee that's related to all given booking fees. | required: true param name: businessNotification | type: BusinessNotification - name: notifyBusiness | type: boolean | description: Whether to notify the business about changes made to the booking fees. Default is false. - name: message | type: string | description: Optional custom message to send. param name: orderId | type: orderId | description: GUID of the eCommerce order that includes the booking fees as a single `additionalFee`. | required: true Return type: CollectAppliedBookingFeesResponse - name: collectedPrice | type: Price | description: Collected amount. - name: amount | type: string | description: Amount. - name: formattedAmount | type: string | description: Amount formatted with currency symbol. Possible Errors: HTTP Code: 400 | Status Code: INVALID_ARGUMENT | Application Code: FEE_IS_NOT_BOOKING_FEE | Description: The specified additional fee isn't a booking fee. HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ADDITIONAL_FEE_NOT_FOUND | Description: Couldn't find the additional fee. HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: ORDER_NOT_FOUND | Description: Couldn't find the order. HTTP Code: 428 | Status Code: FAILED_PRECONDITION | Application Code: ORDER_BALANCE_NON_POSITIVE | Description: The order balance is `0` or negative. There is no outstanding amount to collect. ``` ### Examples ### Collect booking fees ```curl curl -X POST \ 'https://www.wixapis.com/_api/booking-fees/v1/booking-fees/collect' \ -H 'Authorization:
__Warning:__ Currently, there is no validation that prevents idempotent requests. This means that your code must make sure to not charge customers multiple times for the same booking fee. You could use [List Transactions For Single Order](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/orders/order-transactions/list-transactions-for-single-order.md) to check which charges were made previously for an eCommerce order.An HTTP status of `200` means that all booking fees were successfully collected. Any other HTPP status means that collection failed. Collects the order's `additionalFees.price.amount` that's related to the booking fees. If there are multiple additional fees on the eCommerce order, the amount that's collected differs from `priceSummary.totalAdditionalFees.amount`. Possible failure reasons include: + The order's `status` isn't `APPROVED`. + There is no payment method saved on the order. + The order's `balanceSummary.balance.amount` is lower than the `additionalFees.price.amount` to collect. + The order's `additionalFeeId` doesn't belong to a Wix Bookings cancellation fee. # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present. Required parameters: orderId, options.additionalFeeId, options Method parameters: param name: options | type: CollectAppliedBookingFeesOptions none | required: true - name: additionalFeeId | type: string | description: GUID of the additional fee that's related to all given booking fees. | required: true - name: businessNotification | type: BusinessNotification | description: Information about whether to notify the business about failing to collect the booking fees from the customer and the message to send. - name: notifyBusiness | type: boolean | description: Whether to notify the business about changes made to the booking fees. Default is false. - name: message | type: string | description: Optional custom message to send. param name: orderId | type: string | description: GUID of the eCommerce order that includes the booking fees as a single `additionalFee`. | required: true Return type: PROMISE