Documentation Index
Fetch the complete documentation index at: https://docs.uselayers.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Layers supports Shopify B2B catalogs end-to-end. When a storefront request includes anidentity.companyLocationId, Layers resolves the catalog assigned to that company location and automatically:
- Restricts search, browse, and block results to the products in that catalog.
- Returns prices and compare-at prices from the catalog’s price list (falling back to market pricing, then variant pricing).
- Hides collections that are excluded from the catalog — requests for those collections return a
404.
companyLocationId is in context, Layers hides B2B-only products, variants, and inventory locations from retail traffic. Retail (DTC) requests never see B2B-only data, and B2B requests never see products outside their assigned catalog.
When to use this
Use B2B catalogs if your store sells to companies through Shopify B2B and you need:- Different product assortments per company or company location.
- Custom price lists per buyer, including currency and compare-at overrides.
- Collection-level access control (some collections visible to retail, some only to specific B2B buyers).
- A single Layers integration that serves both your DTC storefront and your B2B storefront.
How it works
Sync
Layers syncs the following objects from Shopify on install, on each catalog resync, and through real-time webhooks:- Catalogs — title, status, and the assigned price list.
- Catalog products — the set of products and variants each catalog grants access to.
- Catalog price list — per-variant price and compare-at price overrides, including currency.
- Catalog collections — which collections are included or excluded from the catalog.
- Companies and company locations — including which catalogs are assigned to each location.
companies/* and company_locations/* Shopify webhook topics.
Required Shopify access scopes
B2B sync requires the following scopes in addition to the standard Layers scopes:read_customersread_publicationsread_price_lists
Visibility at query time
On every storefront request, Layers checks foridentity.companyLocationId:
- Company location in context — Layers looks up the catalog assigned to that location. Only products assigned to that catalog appear in results, only collections included in that catalog can be browsed, and pricing is sourced from the catalog’s price list.
- No company location in context — B2B-only products, variants, and inventory locations are filtered out, so retail traffic only sees DTC-eligible inventory.
companyLocationId that does not exist, is not synced yet, or has no catalog assigned, the request fails closed — no products are returned. This prevents accidental leaks of retail inventory through unknown IDs.
Pricing precedence
When a catalog is in context, Layers resolves each variant’sprice and compare_at_price in this order:
- Catalog price list — the override defined for the variant in the catalog’s price list, if present.
- Market pricing — the contextual price for the request’s market, if markets sync is enabled and a market is in context.
- Variant pricing — the default Shopify variant price.
Using identity.companyLocationId
Pass the Shopify B2B company location GID for the authenticated buyer on every storefront request.
Shopify B2B company location GID — for example,
gid://shopify/CompanyLocation/123456789. Omit this field for retail traffic. When present, Layers looks up the catalog assigned to the company location and uses it to scope products, pricing, and collections.identity.customerId.
Request example
FAQs
Q: What happens if I send acompanyLocationId that Layers hasn’t synced yet? A: The request returns zero results. Layers fails closed on unknown company locations so retail inventory is never exposed through an unrecognized ID. Q: Does this work with markets and localized pricing?
A: Yes. Catalog pricing takes precedence, then market pricing, then the default variant price. Mixing B2B and markets is fully supported. Q: Do I need to change anything for DTC traffic?
A: No. Retail requests that omit
companyLocationId continue to work exactly as before, with B2B-only products and inventory locations filtered out automatically.
Q: Are autocomplete suggestions catalog-aware? A: Not yet. Search, browse, blocks, and similar-products endpoints honor
identity.companyLocationId. Catalog-aware autocomplete is on the roadmap.
Q: Where do company and location records come from? A: Layers syncs Shopify B2B companies, their locations, and the catalogs assigned to each location. You only need to pass
companyLocationId at request time — the underlying company, location, and catalog metadata is maintained automatically.
For help wiring identity.companyLocationId into your storefront, contact support.