Anchor to section titled 'undefined'

companyLocationAssignRoles
mutation

Requires write_customers access scope or write_companies access scope. Also: The API client must be installed on a Shopify Plus store.

Assigns roles on a company location.


Anchor to companyLocationId
companyLocationId
required

The location whose roles are being assigned.

The roles to assign.


Was this section helpful?

A list of newly created assignments of company contacts to a company location.

The list of errors that occurred from executing the mutation.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation companyLocationAssignRoles($companyLocationId: ID!, $rolesToAssign: [CompanyLocationRoleAssign!]!) {
  companyLocationAssignRoles(companyLocationId: $companyLocationId, rolesToAssign: $rolesToAssign) {
    roleAssignments {
      # CompanyContactRoleAssignment fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "companyLocationId": "gid://shopify/<objectName>/10079785100",
  "rolesToAssign": [
    {
      "companyContactId": "gid://shopify/<objectName>/10079785100",
      "companyContactRoleId": "gid://shopify/<objectName>/10079785100"
    }
  ]
}
input CompanyLocationRoleAssign {
  companyContactId: ID!
  companyContactRoleId: ID!
}