younifyd
Menu

companyAssignMainContact

Assigns the main contact for the company.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the companyAssignMainContact action (under Company).
  3. Fill in the fields below, then reference the result from later steps as {{companyassignmaincontact.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 CompanyAssignMainContact($companyId: ID!, $companyContactId: ID!) {
  companyAssignMainContact(
    companyId: $companyId
    companyContactId: $companyContactId
  ) {
    company {
      contactCount
      contactsCount {
        count
        precision
      }
      createdAt
      customerSince
      defaultCursor
      defaultRole {
        id
        name
        note
      }
      externalId
      hasTimelineComment
      id
      lifetimeDuration
      locationsCount {
        count
        precision
      }
      mainContact {
        company
        createdAt
        customer
        id
        isMainContact
        lifetimeDuration
        locale
        title
        updatedAt
      }
      name
      note
      ordersCount {
        count
        precision
      }
      totalSpent {
        amount
        currencyCode
      }
      updatedAt
    }
    userErrors {
      code
      field
      message
    }
  }
}

Variables

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

companyIdstringrequired

The ID of the company to assign the main contact to.

companyContactIdstringrequired

The ID of the company contact to be assigned as the main contact.

json
{
  "companyId": "string",
  "companyContactId": "string"
}

Response

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

companyobject
contactCountnumber
contactsCountobject2 fields
createdAtstring
customerSincestring
defaultCursorstring
defaultRoleobject3 fields
externalIdstring
hasTimelineCommentboolean
idstring
lifetimeDurationstring
locationsCountobject2 fields
mainContactobject9 fields
namestring
notestring
ordersCountobject2 fields
totalSpentobject2 fields
updatedAtstring
userErrorsarray<object>
codeobject
fieldobject
messageobject

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

companyAssignMainContact — Shopify — Documentation