Price Preference Hooks - Admin Components
The price preference hooks retrieve price preferences from the Medusa backend. A price preference controls how prices are displayed and entered for a region or a currency, such as whether prices are tax inclusive.
These hooks are built on TanStack Query. Use them in your widgets and UI routes.
usePricePreferences#
Retrieve a paginated list of price preferences. Pass query parameters to filter the price preferences, for example by attribute or value.
Parameters#
Returns
Along with the following, the hook returns the rest of TanStack Query's useQuery result.
pricePreferencesQueryKeys#
pricePreferencesQueryKeys is the query key factory for price preference queries. Use all, lists(), list(query), details(), and detail(id) to build the keys that the hook above registers.
Use it to invalidate cached price preference data after a custom mutation: