Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Specify Customer, Company and Location when creating B2B order

Solved

Specify Customer, Company and Location when creating B2B order

kfredericks
Shopify Partner
5 0 0

We need to be able to create and update orders via API, with specific customers tied to specific locations.

 

For example, when creating an order via REST or GraphQL, how can I specify the Customer's Company and the Location within that company?

Accepted Solution (1)

ShopifyDevSup
Shopify Staff
1453 238 527

This is an accepted solution.

Hi @kfredericks 👋
 

You should be able to load the B2B PurchasingCompany object to the `Order.purchasingEntity` field. 

 

Hope that helps!

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

View solution in original post

Replies 2 (2)

ShopifyDevSup
Shopify Staff
1453 238 527

This is an accepted solution.

Hi @kfredericks 👋
 

You should be able to load the B2B PurchasingCompany object to the `Order.purchasingEntity` field. 

 

Hope that helps!

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

kfredericks
Shopify Partner
5 0 0

This is the solution.

 

The PurchasingEntity can be a union on the PurchasingCompany object, which includes both the company id and the location id