younifyd
Menu

customerMerge

Merges two customers. The customerOneId and customerTwoId arguments don't guarantee which customer is kept.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the customerMerge action (under Customer).
  3. Fill in the fields below, then reference the result from later steps as {{customermerge.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 CustomerMerge($customerOneId: ID!, $customerTwoId: ID!, $overrideFields: CustomerMergeOverrideFields) {
  customerMerge(
    customerOneId: $customerOneId
    customerTwoId: $customerTwoId
    overrideFields: $overrideFields
  ) {
    job {
      done
      id
      query {
        appDiscountTypes
        availableBackupRegions
        availableCarrierServices
        availableLocales
        backupRegion
        businessEntities
        catalogOperations
        collectionConditionMetafieldDefinitions
        collectionRulesConditions
        consentPolicyRegions
        currentAppInstallation
        currentStaffMember
        deliveryPromiseSettings
        financeAppAccessPolicy
        financeKycInformation
        fulfillmentConstraintRules
        giftCardConfiguration
        inventoryProperties
        locationsAvailableForDeliveryProfiles
        metafieldDefinitionTypes
        onlineStore
        pendingOrdersCount
        primaryMarket
        privacySettings
        publicApiVersions
        serverPixel
        shop
        shopBillingPreferences
        shopifyPaymentsAccount
        storeCreditConfiguration
        taxonomy
      }
    }
    resultingCustomerId
    userErrors {
      code
      field
      message
    }
  }
}

Variables

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

customerOneIdstringrequired

The ID of one customer to merge. This customer isn't guaranteed to be kept.

customerTwoIdstringrequired

The ID of another customer to merge. This customer is kept when neither customer has an email address.

overrideFieldsobject

The field-specific overrides for default customer merge rules.

customerIdOfFirstNameToKeepstring
customerIdOfLastNameToKeepstring
customerIdOfEmailToKeepstring
customerIdOfPhoneNumberToKeepstring
customerIdOfDefaultAddressToKeepstring
notestring
tagsarray<string>
json
{
  "customerOneId": "string",
  "customerTwoId": "string",
  "overrideFields": {
    "customerIdOfFirstNameToKeep": "string",
    "customerIdOfLastNameToKeep": "string",
    "customerIdOfEmailToKeep": "string",
    "customerIdOfPhoneNumberToKeep": "string",
    "customerIdOfDefaultAddressToKeep": "string",
    "note": "string",
    "tags": [
      "string"
    ]
  }
}

Response

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

jobobject
doneboolean
idstring
queryobject31 fields
resultingCustomerIdstring
userErrorsarray<object>
codeobject
fieldobject
messageobject

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