Menu
customerAddressCreate
Creates a new MailingAddress for a Customer. Use the customer's access token to identify them.
Use it in a workflow
- Add a step and choose the Shopify Storefront 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($customerAccessToken: String!, $address: MailingAddressInput!) {
customerAddressCreate(
customerAccessToken: $customerAccessToken
address: $address
) {
customerAddress {
address1
address2
city
company
country
countryCode
countryCodeV2
firstName
formattedArea
id
lastName
latitude
longitude
name
phone
province
provinceCode
zip
}
customerUserErrors {
code
field
message
}
userErrors {
field
message
}
}
}
Variables
Pass these as a JSON object in the step's Variables field.
{
"customerAccessToken": "string",
"address": {
"address1": "string",
"address2": "string",
"city": "string",
"company": "string",
"country": "string",
"firstName": "string",
"lastName": "string",
"phone": "string",
"province": "string",
"zip": "string"
}
}
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 Storefront guide for connection setup and behaviour shared by every action.
Was this page helpful?