younifyd
Menu

customerAddressCreate

Creates a new MailingAddress for a Customer. You can optionally set the address as the customer's default address.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the customerAddressCreate action (under Customer).
  3. Fill in the fields below, then reference the result from later steps as {{customeraddresscreate.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 CustomerAddressCreate($customerId: ID!, $address: MailingAddressInput!, $setAsDefault: Boolean) {
  customerAddressCreate(
    customerId: $customerId
    address: $address
    setAsDefault: $setAsDefault
  ) {
    address {
      address1
      address2
      city
      company
      coordinatesValidated
      country
      countryCode
      countryCodeV2
      firstName
      formattedArea
      id
      lastName
      latitude
      longitude
      name
      phone
      province
      provinceCode
      timeZone
      validationResultSummary
      zip
    }
    userErrors {
      field
      message
    }
  }
}

Variables

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

customerIdstringrequired

The ID of the customer.

addressobjectrequired

Specifies the fields to use when creating the address.

address1string
address2string
citystring
companystring
countrystring
countryCodestring

One ofAFAXALDZADAOAIAGARAMAWACAUATAZBSBHBDBBBYBEBZBJBMBTBOBABWBVBRIOBNBGBFBIKHCACVBQKY

firstNamestring
idstring
lastNamestring
phonestring
provincestring
provinceCodestring
zipstring
setAsDefaultboolean

Whether to set the address as the customer's default address.

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

Response

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

addressobject
address1string
address2string
citystring
companystring
coordinatesValidatedboolean
countrystring
countryCodestring
countryCodeV2string

One ofAFAXALDZADAOAIAGARAMAWACAUATAZBSBHBDBBBYBEBZBJBMBTBOBABWBVBRIOBNBGBFBIKHCACVBQKY

firstNamestring
formattedAreastring
idstring
lastNamestring
latitudenumber
longitudenumber
namestring
phonestring
provincestring
provinceCodestring
timeZonestring
validationResultSummarystring

One ofNO_ISSUESERRORWARNING

zipstring
userErrorsarray<object>
fieldobject
messageobject

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