Hi,
I’m new to Shopify and I’m working on the GraphQL APIs. I’m looking for a way to get all Companies info for Approved Companies. Or more specifically, where a customer is approved for ordering. Or at least looking for a way to distinguish their status. I haven’t been able to understand where to see this through the Graph APIs.
Any pointers would be greatly appreciated.
Thanks you
Hi @mariounkel ,
The Company object in GraphQL doesn’t have an “Approved” field, but our guide on creating companies mentions that “A companyContact must be added to create orders and draft orders.”
The companies query can be used to retrieve a list of your store’s companies, and their contactRoles connection could also be used to determine their eligibility for making orders.
Hope that helps!
Hi,
Thanks for your answer. Yes I found the link. This gave me the info I was looking for. And with this I will filter out the companies that have a least 1 role assignment.
query MyQuery {
companies(first: 10) {
edges {
node {
id
name
externalId
locations(first: 1) {
edges {
node {
name
roleAssignments(first: 10) {
edges {
node {
role {
name
}
}
}
}
}
}
}
contacts(first: 10, query: "isMainContact:true") {
edges {
node {
isMainContact
id
customer {
email
multipassIdentifier
}
}
}
}
}
}
}
}