MageSmith
MutationCustomer · Magento 2.4.9

createCustomerAddress

createCustomerAddress is a Magento 2 GraphQL mutation in the Customer module. Create a billing or shipping address for a customer or guest. It returns CustomerAddress and requires an Authorization header (Bearer customer token).

Last verified: against Magento 2.4.9.

Returns

CustomerAddress

Resolver class

Magento\CustomerGraphQl\Model\Resolver\CreateCustomerAddress

Arguments

input CustomerAddressInput! Required

Example request

Auto-generated from the SDL — paste-ready against your store's /graphql endpoint. Replace the host, store code, and any required values before running.

Headers

Content-Type
application/json
Store
default store view code; use 'default' for the single-store baseline
Authorization
Bearer <CUSTOMER_TOKEN> obtain from generateCustomerToken mutation

Query

mutation ($input: CustomerAddressInput!) {
  createCustomerAddress(input: $input) {
    id
    uid
    customer_id
    region {
      region_code
      region
      region_id
    }
    region_id
    country_id
    country_code
    street
    company
    telephone
    fax
    postcode
    city
    firstname
    lastname
    middlename
    prefix
    suffix
    vat_id
    default_shipping
    default_billing
    custom_attributes {
      attribute_code
      value
    }
    custom_attributesV2 {
      code
    }
    extension_attributes {
      attribute_code
      value
    }
  }
}

Variables

{
  "input": {}
}

Every Magento dev tool, in one hosted workspace.

Free to sign up. Nothing to install. Drafts, audits, and projects saved across every tool.