Customers and roles
Rules such as “wholesale customers pay 20% less” depend on who is shopping. The Store API and the price-preview endpoint use the WordPress user of the request:- Guests get guest prices.
- Signed-in customers get their prices when the request is authenticated with the WordPress cookie and a nonce, an application password, or JWT if you use a JWT plugin.
Cache price responses per customer group, never across them. A CDN that caches
/wp-json/ for everyone would show one customer’s wholesale price to the next.