Anchor to section titled 'undefined'

customerAddressCreate
mutation

Requires unauthenticated_write_customers access scope.

Creates a new address for a customer.


The customer mailing address to create.

Anchor to customerAccessToken
customerAccessToken
required

The access token used to identify the customer.


Was this section helpful?

The new customer address object.

The list of errors that occurred from executing the mutation.

The list of errors that occurred from executing the mutation. Use customerUserErrors instead.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation customerAddressCreate($address: MailingAddressInput!, $customerAccessToken: String!) {
  customerAddressCreate(address: $address, customerAccessToken: $customerAccessToken) {
    customerAddress {
      # MailingAddress fields
    }
    customerUserErrors {
      # CustomerUserError fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "address": {
    "address1": "<your-address1>",
    "address2": "<your-address2>",
    "city": "<your-city>",
    "company": "<your-company>",
    "country": "<your-country>",
    "firstName": "<your-firstName>",
    "lastName": "<your-lastName>",
    "phone": "<your-phone>",
    "province": "<your-province>",
    "zip": "<your-zip>"
  },
  "customerAccessToken": "<your-customerAccessToken>"
}
input MailingAddressInput {
  address1: String
  address2: String
  city: String
  company: String
  country: String
  firstName: String
  lastName: String
  phone: String
  province: String
  zip: String
}