younifyd
Menu

companyAssignCustomerAsContact

Adds an existing Customer as a contact to a Company. Companies are business entities that make purchases from the merchant's store.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the companyAssignCustomerAsContact action (under Company).
  3. Fill in the fields below, then reference the result from later steps as {{companyassigncustomerascontact.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 CompanyAssignCustomerAsContact($companyId: ID!, $customerId: ID!) {
  companyAssignCustomerAsContact(companyId: $companyId, customerId: $customerId) {
    companyContact {
      company {
        contactCount
        contactsCount
        createdAt
        customerSince
        defaultCursor
        defaultRole
        externalId
        hasTimelineComment
        id
        lifetimeDuration
        locationsCount
        mainContact
        name
        note
        ordersCount
        totalSpent
        updatedAt
      }
      createdAt
      customer {
        amountSpent
        canDelete
        companyContactProfiles
        createdAt
        dataSaleOptOut
        defaultAddress
        defaultEmailAddress
        defaultPhoneNumber
        displayName
        email
        emailMarketingConsent
        firstName
        hasTimelineComment
        id
        identityProviderSubjects
        lastName
        lastOrder
        legacyResourceId
        lifetimeDuration
        locale
        market
        mergeable
        multipassIdentifier
        note
        numberOfOrders
        phone
        productSubscriberStatus
        smsMarketingConsent
        state
        statistics
        tags
        taxExempt
        taxExemptions
        taxSettings
        unsubscribeUrl
        updatedAt
        validEmailAddress
        verifiedEmail
      }
      id
      isMainContact
      lifetimeDuration
      locale
      title
      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 contact to.

customerIdstringrequired

The ID of the customer to assign as the contact.

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

Response

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

companyContactobject
companyobject17 fields
createdAtstring
customerobject38 fields
idstring
isMainContactboolean
lifetimeDurationstring
localestring
titlestring
updatedAtstring
userErrorsarray<object>
codeobject
fieldobject
messageobject

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

companyAssignCustomerAsContact — Shopify — Documentation