Skip to content
IvaSure add-ons and services for SureCart storesJoin the POD waitlist

REST API

2 min read
Published
Category
Reference

Live filtering is served by a small REST surface under ivasure/v1. It is the same data the storefront uses, so anything the filter can do, a client of yours can do too.

The endpoints

RouteMethodAccess
/ivasure/v1/filters/schemaGETPublic
/ivasure/v1/filters/queryGETPublic
/ivasure/v1/filters/reindexPOSTRequires manage_sc_shop_settings or manage_options

schema describes the filter - which facets exist, their terms and counts. query answers a filtered request: the same description, plus the matching products.

Parameters

Both read endpoints accept the same URL parameters the storefront uses, so a filtered address can be handed to the API unchanged.

Filtered exactly as the storefront would
GET /wp-json/ivasure/v1/filters/query?ks_room=bedroom
Send currentUrl, or the returned url is not useful
The response includes a canonical url for the filtered view, built from the page the request came from. Without currentUrl there is nothing to build it from, so it echoes the REST address instead. The storefront always sends it; current_url is accepted as a synonym.

What query returns

KeyContains
stateThe parsed filter state: prefix, operator, selections, price, rating, page.
activeCountHow many filters are applied.
activeItemsOne entry per applied filter, with the label to show on a chip.
facetsEvery facet with its terms and counts.
foundTotal matching products.
maxPagesPages at the current page size.
paginationRendered pagination, when there is more than one page.
htmlThe rendered results grid.
urlCanonical URL for this filtered view.
emptyStateTextWhat to show when nothing matched.
zeroRelaxationsSuggested single removals when a combination matched nothing.

Rate limiting

CallerBudgetCounted per
Anonymous300 per minuteIP address, user agent and language together
Signed in60 per minuteUser ID
The smaller number is the more generous one
A signed-in budget is per person. An anonymous budget is per visitor fingerprint, which a whole office behind one address can share - hence the entropy in the key, and hence the larger figure.

Over the limit the endpoint returns 429. The storefront treats that as “keep what is on screen” rather than showing an error, so a shopper who trips it sees the products they already had and the next request works.

Both the limits and the window are filterable, and sites behind a CDN can correct the client IP - see the filter reference.

Save to list