Skip to main content

Price visibility in standard APIs

The short answer​

Magento's own product, search and cart APIs follow the same rules as the storefront. If a visitor may not see a product's price on the storefront, the API answers without it for the same visitor. If the Add to Cart button is hidden, the API won't put the product in the cart. You don't set anything up for this: it works from HidePrice Pro 3.1.5 as soon as the module is turned on.

Who the visitor is depends on the token. A customer token is checked against that customer's group. A call without a token is treated as a guest, the NOT LOGGED IN group.

How it works​

The rules that decide what is hidden are the store settings and the product attributes: see Settings: General and Product attributes. How they combine per store view and customer group is explained in Store views and customer groups. This page only says what each API returns once a price or a button is hidden.

GraphQL product prices​

When the caller may not see a product's price, the products query and the other catalog queries answer:

Field Answer for a hidden price
price_range (bundles too) minimum_price and maximum_price with regular_price and final_price set to value: null, currency: null, and discount set to amount_off: null, percent_off: null.
price_tiers, tier_prices An empty list.
special_price, price_details null.
price (deprecated) minimalPrice, regularPrice and maximalPrice set to null.
fixed_product_taxes An empty list.
Prices of custom option values, bundle selections and downloadable links 0. The items themselves stay, so they can still be chosen.
custom_attributesV2 Price attributes such as price, special_price and tier_price are left out.

A configurable product's variants and a bundle's selection products are hidden together with their parent.

Price navigation goes too. Where prices can be hidden from the caller, the products query ignores price filters and sorting by price. Price buckets and the price sort option are left out of aggregations, filters and sort_fields.

An example: a guest calls the products query for a product whose price is hidden from guests, and gets an empty price_range. A customer of a group that sees prices sends the same query with a customer token and gets the price.

The catalog queries treat an admin or integration token as a guest: prices hidden from guests stay hidden.

REST and the search API​

Magento has a few REST routes that a guest or a customer may call for products:

  • GET /V1/products-render-info returns product data for display. For a hidden price, its price fields come back as 0 and the formatted prices as empty strings: final, minimal, maximal, regular and special price.
  • GET /V1/search, the anonymous search, takes no price filter and no sorting by price, and returns no price buckets where prices can be hidden from the caller.

A guest's products-render-info answer for a product with a hidden price, shortened to price_info:

{
"price_info": {
"final_price": 0,
"max_price": 0,
"max_regular_price": 0,
"minimal_regular_price": 0,
"special_price": 0,
"minimal_price": 0,
"regular_price": 0,
"formatted_prices": {
"final_price": "",
"max_price": "",
"minimal_price": "",
"max_regular_price": "",
"minimal_regular_price": "",
"special_price": "",
"regular_price": ""
}
}
}

The product routes such as GET /V1/products/<sku> need an admin or integration token in Magento itself. HidePrice Pro doesn't change their answer: an admin user or integration sees the prices, as in the admin. A call without a token or with a customer token gets Magento's 401 answer.

Carts through the API​

Cart calls over REST and GraphQL follow the same rule as the storefront cart:

  • A product whose Add to Cart button is hidden from the caller can't be added. The call fails with the message "… cannot be added to the cart.", which starts with the product name. The caller's group is the group of the customer token, or NOT LOGGED IN without one. The group stored on the cart is never used, because the API lets a caller change it.
  • A cart read through the API leaves out items whose Add to Cart button is hidden from the caller. Items added before the button was hidden are removed this way too.
  • When a guest cart is merged into a customer's cart on the storefront or through GraphQL, items hidden from that customer are removed. Over REST, they are left out the next time the cart is read.
  • Admin users and integrations calling the API can add any product.
  • Products another module vouches for stay: items of an accepted EasyQuote quote, and free gifts of a registered promotion module. See Cart exemptions and free gifts.

SOAP​

Magento's SOAP API uses the same service contracts as REST, and HidePrice Pro registers the same plugins for SOAP as for REST. products-render-info, the search API and the cart operations follow the same rules over SOAP as described above for REST. MageMe tests these rules over REST.

What this means for you​

  • A headless storefront or app shows the same hidden prices as your Luma or Hyvä storefront, provided it calls GraphQL with the customer's token.
  • Send the customer token on every catalog call. Without it, the customer is treated as a guest and sees what guests see.
  • Don't build price filters or price sorting into a headless catalog for customers who can't see prices. The API ignores them.
  • An integration that syncs products to another system gets real prices through the admin product routes. Protect that token like an admin login.

What's next​

Last reviewed November 28, 2026