Company and catalog graphql api

Solved

Company and catalog graphql api

Ggarret
Visitor
3 0 0

 

Hello everyone, I'm looking for a way to associate a company location with a price catalog using the GraphQL API. I haven't found any information on this topic. Can you help me? Thanks in advance.

 

 

Accepted Solution (1)

ShopifyDevSup
Shopify Staff
1453 238 501

This is an accepted solution.

Hey @Ggarret , you can create and associate a catalog with a company location by passing the company location ID in the context field of the catalogCreate or catalogUpdate mutation.

 

- https://shopify.dev/docs/apps/b2b/getting-started#step-2-create-a-b2b-catalog

 

Once you have that, you can assign a price list to a catalog. https://shopify.dev/docs/apps/b2b/catalogs#step-1-associate-a-price-list-with-the-catalog 

 

Hope that helps, 

 

- Kyle G.

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 501

This is an accepted solution.

Hey @Ggarret , you can create and associate a catalog with a company location by passing the company location ID in the context field of the catalogCreate or catalogUpdate mutation.

 

- https://shopify.dev/docs/apps/b2b/getting-started#step-2-create-a-b2b-catalog

 

Once you have that, you can assign a price list to a catalog. https://shopify.dev/docs/apps/b2b/catalogs#step-1-associate-a-price-list-with-the-catalog 

 

Hope that helps, 

 

- Kyle G.

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

Kalen_Jordan
Shopify Partner
526 18 78

If you want to add individual locations to a catalog you might want to look at the catalogContextUpdate mutation:

https://shopify.dev/docs/api/admin-graphql/2024-04/mutations/catalogContextUpdate

If you just pass in one location ID to the catalogUpdate mutation you're going to remove it from other locations it was assigned to.