Company's catalog pricing for headless using customer accounts and storefront APIs not working

I am trying to support company pricing for my headless app using the customer account and storefront APIs.

I have set up authentication using the customer account API (Customer Account API reference) and pass the customer email, accessToken, and companyLocationId to the storefront cartCreate mutation for buyerIdentity when creating the cart. I am also appending logged_in=true to the cart’s checkout url when sending the customer to checkout.

When testing this with a test account, the checkout page for the URL shows that the customer is logged in (or at least there is an account section on the page which is not editable and shows the customer’s email) but the pricing does not reflect the company’s catalog pricing based on the location passed (companyLocationId).

What am I doing wrong? Thanks so much!

Hey @craig-martin - I did a bit of digging into this on our end, and from what you’re describing there it seems like it should be working, so it’s odd that the issue is popping up for you. One thing to double check though is to see if the customer attached to the cart you’re creating is assigned to a specific company location: Headless with B2B

If you’ve confirmed that, just ping me here in this thread and I can take another look (If you can share the shop ID/location ID and customer ID, I can do some more digging on my end to investigate further).

Hope this helps a little bit though.

In my own aspect I think you should try and resolve your malware bugs and robots txt

Hey Alan! I am burying my head in shame: i had a bug which meant the companyLocationId in the buyerIdentity for the cartCreate mutation was not being passed in. Thank you so much for your quick response and encouraging me to double check, and I’m so sorry for the noise!

1 Like