younifyd
Menu

companyLocationAssignRoles

Assigns roles on a company location.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the companyLocationAssignRoles action (under Company).
  3. Fill in the fields below, then reference the result from later steps as {{companylocationassignroles.response.data}}.

Query

This is the mutation the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
mutation CompanyLocationAssignRoles($companyLocationId: ID!, $rolesToAssign: [CompanyLocationRoleAssign!]!) {
  companyLocationAssignRoles(
    companyLocationId: $companyLocationId
    rolesToAssign: $rolesToAssign
  ) {
    roleAssignments {
      company {
        contactCount
        contactsCount
        createdAt
        customerSince
        defaultCursor
        defaultRole
        externalId
        hasTimelineComment
        id
        lifetimeDuration
        locationsCount
        mainContact
        name
        note
        ordersCount
        totalSpent
        updatedAt
      }
      companyContact {
        company
        createdAt
        customer
        id
        isMainContact
        lifetimeDuration
        locale
        title
        updatedAt
      }
      companyLocation {
        billingAddress
        buyerExperienceConfiguration
        company
        createdAt
        currency
        defaultCursor
        externalId
        hasTimelineComment
        id
        locale
        market
        name
        note
        orderCount
        ordersCount
        phone
        shippingAddress
        taxExemptions
        taxRegistrationId
        taxSettings
        totalSpent
        updatedAt
      }
      createdAt
      id
      role {
        id
        name
        note
      }
      updatedAt
    }
    userErrors {
      code
      field
      message
    }
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

companyLocationIdstringrequired

The location whose roles are being assigned.

rolesToAssignarray<object>required

The roles to assign.

companyContactRoleIdstringrequired
companyContactIdstringrequired
json
{
  "companyLocationId": "string",
  "rolesToAssign": [
    {
      "companyContactRoleId": "string",
      "companyContactId": "string"
    }
  ]
}

Response

Read the result with {{companylocationassignroles.response.data.data.companyLocationAssignRoles}}. If the API returns errors, the step fails and they are at {{companylocationassignroles.response.data.errors}}.

roleAssignmentsarray<object>
companyobject
companyContactobject
companyLocationobject
createdAtobject
idobject
roleobject
updatedAtobject
userErrorsarray<object>
codeobject
fieldobject
messageobject

Need more? See the Shopify guide for connection setup and behaviour shared by every action.

companyLocationAssignRoles — Shopify — Documentation