younifyd
Menu

customerPaymentMethodCreateFromDuplicationData

Creates a vaulted payment method for a customer from duplication data. This data must be obtained from another shop within the same organization.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the customerPaymentMethodCreateFromDuplicationData action (under Customer).
  3. Fill in the fields below, then reference the result from later steps as {{customerpaymentmethodcreatefromduplicationdata.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 CustomerPaymentMethodCreateFromDuplicationData($customerId: ID!, $billingAddress: MailingAddressInput!, $encryptedDuplicationData: String!) {
  customerPaymentMethodCreateFromDuplicationData(
    customerId: $customerId
    billingAddress: $billingAddress
    encryptedDuplicationData: $encryptedDuplicationData
  ) {
    customerPaymentMethod {
      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
      instrument
      revokedAt
      revokedReason
    }
    userErrors {
      code
      field
      message
    }
  }
}

Variables

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

customerIdstringrequired

The ID of the customer.

billingAddressobjectrequired

The billing address.

address1string
address2string
citystring
companystring
countrystring
countryCodestring

One ofAFAXALDZADAOAIAGARAMAWACAUATAZBSBHBDBBBYBEBZBJBMBTBOBABWBVBRIOBNBGBFBIKHCACVBQKY

firstNamestring
idstring
lastNamestring
phonestring
provincestring
provinceCodestring
zipstring
encryptedDuplicationDatastringrequired

The encrypted payment method data.

json
{
  "customerId": "string",
  "billingAddress": {
    "address1": "string",
    "address2": "string",
    "city": "string",
    "company": "string",
    "country": "string",
    "countryCode": "AF",
    "firstName": "string",
    "id": "string",
    "lastName": "string",
    "phone": "string",
    "province": "string",
    "provinceCode": "string"
  },
  "encryptedDuplicationData": "string"
}

Response

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

customerPaymentMethodobject
customerobject38 fields
idstring
instrumentobject17 fields

This field can return one of several different object shapes — properties from every possible shape are shown together.

revokedAtstring
revokedReasonstring

One ofAUTHORIZE_NET_GATEWAY_NOT_ENABLEDAUTHORIZE_NET_RETURNED_NO_PAYMENT_METHODFAILED_TO_UPDATE_CREDIT_CARDSTRIPE_API_AUTHENTICATION_ERRORSTRIPE_API_INVALID_REQUEST_ERRORSTRIPE_GATEWAY_NOT_ENABLEDSTRIPE_RETURNED_NO_PAYMENT_METHODSTRIPE_PAYMENT_METHOD_NOT_CARDBRAINTREE_API_AUTHENTICATION_ERRORBRAINTREE_GATEWAY_NOT_ENABLEDBRAINTREE_RETURNED_NO_PAYMENT_METHODBRAINTREE_PAYMENT_METHOD_NOT_CARDPAYMENT_METHOD_VERIFICATION_FAILEDTHREE_D_SECURE_FLOW_IN_VERIFICATION_NOT_IMPLEMENTEDMANUALLY_REVOKEDFAILED_TO_RETRIEVE_BILLING_ADDRESSMERGEDCUSTOMER_REDACTEDTOO_MANY_CONSECUTIVE_FAILURESCVV_ATTEMPTS_LIMIT_EXCEEDED

userErrorsarray<object>
codeobject
fieldobject
messageobject

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