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
- Add a step and choose the Shopify connector.
- Pick the customerAddressCreate action (under Customer).
- 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.
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.
{
"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}}.
Need more? See the Shopify guide for connection setup and behaviour shared by every action.
Was this page helpful?