See all services → Shopify Plus Partner
API Developer

Audit B2B Location Access in the Customer Account API

Shopify narrowed what B2B customers can read through the Customer Account API across all versions. Company locations, tax identifiers, contacts, and orders from former companies now return null or empty results.

Executive summary

What changed

The GraphQL schema is unchanged. What changed is the data behind it: some fields now return null, an empty list, or fewer results depending on the signed-in customer's roles.

CompanyContact.locations returns an empty list unless the contact belongs to the current customer. A customer still reads the locations where they hold a role, through their own contact's locations field, through Company.locations, and through companyLocation by ID. On a CompanyLocation where they have no role, taxIdentifier returns null, and contacts and roleAssignments come back null or empty.

Order visibility also narrowed. When a merchant removes a customer from a company, order and draftOrder lookups by ID refuse that company's records, and customer.orders and customer.draftOrders exclude them. Personal orders remain listed. This applies to every API version, so pinning an older one does not avoid it.

Why it matters

This is a behavioural change rather than a schema change, which makes it easy to miss. Nothing breaks at the query layer: queries still validate, responses still conform, and a portal reading a location's taxIdentifier through another contact renders an empty field where a VAT number used to sit. The failure mode is a blank in production, not an error in CI.

For most merchants this is the correct behaviour. A buyer assigned to the Toronto location of a 40-location distributor should not read tax identifiers and contact rosters for Vancouver. If your portal surfaced that, it exposed more than intended.

The second half carries more operational weight. Removing a customer from a company now also withdraws their access to that company's order history, including orders they placed themselves. That changes what happens when a buyer moves between divisions, and support should know before the first ticket arrives. Our B2B commerce portal practice covers the role modelling involved.

Role-specific impact

Use-case example

Real-world scenario

An industrial supplier on Shopify Plus runs a headless B2B portal where each buyer sees a company overview listing every location, its tax identifier, and its contacts. Roughly 60 of their 400 company accounts have more than one location, and buyers there were reading data for locations they had no role in. Those panels now render empty, so the portal looks broken rather than correctly restricted. The fix took about a day: scope the overview to the buyer's own locations and add an empty state explaining that access is role-based. They also found two buyers whose order history had shrunk after a reassignment, and updated their offboarding runbook accordingly.

Implementation checklist

  1. Search your portal code for reads of CompanyContact.locations, Company.locations, companyLocation, taxIdentifier, contacts, and roleAssignments.
  2. Confirm the UI handles null and empty responses with a deliberate empty state rather than a blank panel or a crash.
  3. Check anywhere you resolve a location through an order's purchasingEntity, a common path to data the buyer may no longer read.
  4. Test with a multi-location company account using a contact who holds a role at only one location.
  5. Test a customer removed from a company and verify the order history view degrades gracefully instead of erroring on refused IDs.
  6. Update your offboarding runbook for the loss of order visibility, and brief support so a restricted field is not escalated as a portal bug.

FAQ

Q: Do we need to change our GraphQL queries or migrate to a newer API version?

A: No. The schema is identical and the change applies to all versions. Queries keep working, but the data is scoped to the signed-in customer's roles, so the work is in how your interface handles missing values.

Q: Can a customer removed from a company still see the orders they placed for it?

A: No. Those orders and draft orders are excluded from customer.orders and customer.draftOrders, and lookups by ID are refused. Personal orders are unaffected, so export what the buyer needs before removing the contact.

Resources

CompanyLocation object in the Shopify Customer Account API

Need guidance? Talk to Makro.