Wholesale-only access with new Customer Accounts (non-B2B) — recommended approach?

Thanks for the thoughtful questions! Your current approach is working as designed, so you should keep using it.

As of API version 2025-01, Customer Account API access tokens are accepted directly by the Storefront API. The storefrontCustomerAccessTokenCreate deprecation changelog covers the migration path, which says to obtain a token via the CA API OAuth flow and then “use this access token directly with the Storefront API.” The publicly documented mechanism is the @inContext buyer identity directive for cart operations, but the broader token compatibility you’re seeing with the customer query is also intentional and part of the same migration. The docs haven’t caught up to reflect every SFAPI surface that accepts the new token yet, but what you’re doing with context.customerAccount.getAccessToken() in Hydrogen is consistent with how the platform works going forward.

On the deprecation concern, the legacy customer accounts announcement says “The Storefront API customer mutations will be deprecated, with more details coming soon.” That targets the legacy mutations (customerAccessTokenCreate, customerCreate, etc.), not the customer query itself. The customer query was updated to accept Customer Account API tokens as part of the migration to the new auth system, so it’s on the new path rather than the legacy one.

On the order data gap, the Customer Account API’s LineItem type has no variant or product connection and doesn’t support metafields on line items. You get product ID, variant ID, title, SKU, and pricing, but you can’t traverse to product or variant metafields from there. The Storefront API’s OrderLineItem does give you the variant connection to the full ProductVariant object (with metafields and a product connection that also has metafields), so the chain lineItem -> variant -> metafield and lineItem -> variant -> product -> metafield works through the SFAPI but not the CA API. No public roadmap for expanding the CA API schema here. Your approach of authenticating via CA API OAuth and querying order data through the Storefront API is the right way to bridge that.

Hope this helps!

1 Like