When you create a company in the admin panel it allows you to select from an existing customer. WHen you create one in the API (https://shopify.dev/docs/api/admin-graphql/unstable/mutations/companyCreate#field-companycreateinput-companycontact) it only seems to allow creation of a new customer with the new company.
How do i create a new company and attach an existing customer through the API?
Anybody know?
1 Like
Hi @quickfire ,
You are correct.
Currently when you are creating a company for B2B you only have the option to do so with a ‘new contact’ and not an existing one. However, once you have created a company via the api, you can use the companyAssignCustomerAsContact mutation to add in an existing customer.
This is a good example of the subtle differences between what you can do in the admin vs what you can accomplish via the API. I will pass this along to our development team for future consideration.
Hope that helps!
Currently cant even add a company via the GraphQL API - “Invalid input” is what you get