Skip to main content
Using TypeScript? Check out our GraphQL SDK for a fully typed client.
Plain automatically derives a customer’s company for you, but you can also update it manually. The customer in question is identified by their id (ie c_...). With regards to the company, you can either specify an existing company using the ID we’ve generated (ie co_...), or pass the company domain, which we’ll use to derive the rest of the company’s info. If you wish to only remove the customer’s associated company, then you can pass null as the companyIdentifier. For this mutation you need the following permissions:
  • customer:edit
Mutation
mutation updateCustomerCompany($customerId: ID!, $companyDomainName: String!) {
  updateCustomerCompany(
    input: { customerId: $customerId, companyIdentifier: { companyDomainName: $companyDomainName } }
  ) {
    customer {
      id
      company {
        id
        name
        logoUrl
        domainName
      }
    }
    error {
      message
      type
      code
    }
  }
}
Variables
{
  "customerId": "c_01H14DFQ4PDYBH398J1E99TWSS",
  "companyDomainName": "nike.com"
}