The Tips API allows app developers to manage tips for eCommerce orders. You can also preview tips and how they would be distributed to staff members before an order is created.
With the Tips API, your app can:
See also:
It's important to note the following points before starting to code:
additionalFee
. The tip's ID is stored in the additionalFee.code
field of the order.For a comprehensive glossary of Wix Bookings terms, see Terminology.
To use the Tips API, install the @wix/ecom
package using npm or Yarn:
or
Then import { tips }
from @wix/ecom
:
This article shares some possible use cases you could support, as well as a sample flow that supports each use case. This can be a helpful jumping off point for your planning.
You could add a customer tip for the staff to an eCommerce order.
To add a tip to an order:
{ "paymentStatus": { "$in": ["NOT_PAID", "PARTIALLY_PAID"]}}
in the filter
. Save the returned order IDs, included line items,
priceSummary.subTotal.formattedAmount
, and all additional details that you
want to display to the business owners later in the flow.TIP_NOT_FOUND
error.paymentTerminalId
.presets
and the order's
priceSummary.subTotal.formattedAmount
to the business owner. Save the
business owner's tip choice.price
for all the order's line items and save the returned tip
.tip
object from the previous step.You could let business owners adjust a staff member's share and add a distribution for another staff.
To adjust tip distributions:
{ "paymentStatus": { "$in": ["NOT_PAID", "PARTIALLY_PAID"]}}
in the filter
. Save the returned order IDs, included line items,
priceSummary.subTotal.formattedAmount
, and all additional details that you
want to display to the business owners later in the flow.tip
is returned. If
an order has no tip, the call fails with a TIP_NOT_FOUND
error. Save all
returned tip
objects including their distributions
.staff.id
and the distribution amount they
receive.You could display a dashboard to the business owners that allows them to manage tips by staff member.
To create a tip dashboard:
staff.id
.staff.id
and the list of order IDs. Be sure to save
the orderId
for each distribution.This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Adds tip distributions to an eCommerce order.
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:
paymentStatus
is either FULLY_REFUNDED
or PARTIALLY_REFUNDED
.
Options to use when adding tip distributions to an order.
There is 1 error with this status code.
There are 2 errors with this status code.
There is 1 error with this status code.
There are 2 errors with this status code.
There are 3 errors with this status code.
This method may also return standard errors. Learn more about standard Wix errors.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
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.
ID of the draft order to retrieve the tip for.
There are 2 errors with this status code.
This method may also return standard errors. Learn more about standard Wix errors.