I am trying to create a company using the GraphQL API, assign a user to that company, and then allow that user to order.
First I create the company using the createCompany mutation
Next I create a contact (that shows up as a customer) using the companyContactCreate mutation
I have then tried a couple of different methods to assign the newly created contact/customer.
First I queried the company to get the role IDs and then used the companyContactAssignRole mutation to assign the ordering role to the contact I just created. This gave me an error that the company contact does not exist.
The second method I tried was that after using the companyCreateContact mutation I then tried the mutation. Which gave me the error that Customer is already associated with a company contact
Just to be sure I then tried the companyContactAssignRole again and got the same error that company contact does not exist.
This sugests to me that there is a call I am missing or my workflow isn’t correct. I would appreciate if anyone can suggest the correct sequence of calls to
- Create a company
- Create and assign a user to that company
- Allow that user to make orders from that company