How to get company location that placed an order B2B

Topic summary

Core Issue:
Developers need to identify which specific company location placed a B2B order to retrieve its billing address, particularly when companies have multiple locations.

Initial Solution:
The purchasingEntity field on the Order object (accessible via GraphQL) provides the company location that placed the order, as shown in a shared screenshot.

Related Implementation Problems:

  • Multiple users report issues creating orders via Shopify’s REST API where company shipping locations aren’t being properly associated with orders
  • Orders imported from ERP systems through middleware (like Alumio) fail to display company location data
  • Even when using GraphQL’s orderCreate mutation with companyLocationId, customer.toAssociate.id, and address fields, created orders lack both shipping and billing addresses

Current Status:
The thread remains unresolved. One contributor suggests the REST API may not support this functionality and recommends using GraphQL’s orderCreate mutation with the company location ID field instead. Documentation around B2B order creation with company locations is noted as insufficient.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

Hi there,

So I am try to build a flow that needs information from the specific company location that placed an order (the company will have multiple locations), so I can get the billing address of that specific location of the company. I know GraphQL can pull all locations of the company, but how do I get just the location that had placed the order? Or is there a field on Shopify liquid that does that? Thanks!

Check out the purchasing entity on the Order object:

Hey Kalen Jordan,

We are creating orders from shopify REST API and we are facing issue to add the company shipping locations on the order can you suggest any solution for that.

The Orders are coming from the ERP software and we are using Alumio as a middleware please let me know if you have any solution.

1 Like

Oh so you’re saying that when the order is created from alumio it’s not setting the company location on the order?

Yes, we are having the issue with shipping location is not displaying in the order and alone not in the company locations.

Yes, we are having the issue with shipping location is not displaying in the order and alone not in the company locations, could you please help us fixing the issue.

1 Like

We are facing issue with the API we want to send the details of company, customer and shipping location in the order so order will display in the locations.

In that case you’d need to fix the import. Not sure if it’s possible in rest, but I do see the company location ID field as an input in the graphql order create. I could help you build that if you were interested. Link is in my signature.

We face a similar issue with our app.

We use the orderCreate mutation and provide a companyLocationId, customer.toAssociate.id, billingAddress and shippingAddress but the created order ends up having neither a shipping nor a billing address.

It is very poorly documented what is going on there… :slightly_frowning_face:

Hi @Jannik-Wempe for app/api specific problems you likely want to go to the actual dev forums.
And leave feedback on the specific docs pages(scroll to bottom > click Was this section helpful?
https://shopify.community.dev