Customer
magento-2Conta, endereços, senha, preferências e tokens do cliente.
customer
Customer token
Returns information about the logged-in customer, including addresses, orders, store credit history and wishlist.
Customer
The customer query returns information about the logged-in customer, store credit history and the customer's wishlist. Customer tokens in GraphQL call headers are recommended, although session authentication is also supported.
{
customer {
firstname
lastname
email
addresses {
street
city
region { region_code }
postcode
country_code
telephone
}
}
}
customerOrders
Deprecated
Customer token
Deprecated. Returns the authenticated customer's order history. Use the orders field on the Customer type instead.
Deprecated
Use customer { orders } instead. Removed in favor of the nested orders field on the Customer type.
Substituído por POST customer .
CustomerOrders
Deprecated — use customer { orders } diretamente.
The customerOrders query returns a list of orders placed by the logged-in customer, exposing order, invoice and shipment data managed by the Sales module. Adobe recommends migrating to the orders field nested under the customer query.
{
customerOrders {
items {
order_number
id
created_at
grand_total
status
}
}
}
customer.orders
Customer token
List orders for the authenticated customer (nested field on the Customer type, supports pagination and filtering).
CustomerOrders
Retrieves the orders placed by the authenticated customer as a nested field on the Customer type. Supports pagination (pageSize, currentPage) and filtering.
{
customer {
orders(pageSize: 10, currentPage: 1) {
total_count
items {
number
order_date
status
total {
grand_total { value currency }
shipping_handling { total_amount { value } }
}
items { product_name product_sku quantity_ordered }
}
}
}
}
createCustomerV2
Since 2.4.7
Guest
Creates a new customer account. Supersedes the legacy createCustomer mutation and accepts CustomerCreateInput.
CustomerCreateInput
Returns: CustomerOutput
The createCustomerV2 mutation creates a new customer account. It supersedes the earlier createCustomer mutation and takes a CustomerCreateInput object, which differs from the input used by updateCustomerV2. Starting with Adobe Commerce 2.4.7, custom attributes may be supplied during account creation.
mutation {
createCustomerV2(
input: {
firstname: "Bob"
lastname: "Loblaw"
email: "bobloblaw@example.com"
password: "b0bl0bl@w"
is_subscribed: true
}
) {
customer {
firstname
lastname
email
is_subscribed
}
}
}| Field | Type | Description |
|---|---|---|
firstname | String! | Customer's first name (required). |
lastname | String! | Customer's last name (required). |
email | String! | Customer's email address (required). |
password | String | Account password. |
is_subscribed | Boolean | Newsletter subscription flag. |
gender | Int | Gender code (1 = Male, 2 = Female). |
custom_attributes | [AttributeValueInput!] | Optional custom attribute assignments (2.4.7+). |
updateCustomerV2
Customer token
Updates the personal information of the authenticated customer. Supersedes updateCustomer and uses CustomerUpdateInput.
CustomerUpdateInput
Returns: CustomerOutput
The updateCustomerV2 mutation updates personal information on an existing customer account. It supersedes the earlier updateCustomer mutation and takes a CustomerUpdateInput object rather than CustomerInput. No single attribute is strictly required on update — provide only the fields you want to change. To change the email address, use the dedicated updateCustomerEmail mutation instead.
mutation {
updateCustomerV2(
input: {
firstname: "Robert"
is_subscribed: false
}
) {
customer {
firstname
is_subscribed
}
}
}
changeCustomerPassword
Customer token
Changes the password of the currently logged-in customer.
Customer
Use the changeCustomerPassword mutation to change the password of the logged-in customer. Customer tokens in GraphQL call headers are recommended; session authentication is also supported.
mutation {
changeCustomerPassword(
currentPassword: "roni_cost3@example.com"
newPassword: "roni_cost4@example.com"
) {
id
email
}
}| Argument | Type | Description |
|---|---|---|
currentPassword | String! | The customer's existing password. |
newPassword | String! | The new password to set. |
requestPasswordResetEmail
Guest
Customer token
Sends an email containing a password reset token to the specified address.
Boolean
The requestPasswordResetEmail mutation initiates a password reset by sending an email to the given address. It returns true when the reset process starts successfully and the email is sent; false otherwise. The email contains a URL with a token used by the subsequent resetPassword mutation.
mutation {
requestPasswordResetEmail(
email: "roni_cost@example.com"
)
}| Argument | Type | Required |
|---|---|---|
email | String | Yes |
resetPassword
Guest
Customer token
Completes the password reset flow using the token delivered by requestPasswordResetEmail.
Boolean
The resetPassword mutation resets the password for a registered customer using the reset token and email address from requestPasswordResetEmail. It returns true on success, false otherwise. The new password must comply with the store's password policies.
mutation {
resetPassword(
email: "roni_cost@example.com",
resetPasswordToken: "gh80pkjGdsPyiXc0sUUXswX1uGN7crUr",
newPassword: "new_password"
)
}| Argument | Type | Required | Description |
|---|---|---|---|
email | String | Yes | Customer's email address. |
resetPasswordToken | String | Yes | Reset token received by email. |
newPassword | String | Yes | The new password to set. |
createCustomerAddress
Customer token
Creates a new address for the authenticated customer.
CustomerAddressInput
Returns: CustomerAddress
Use the createCustomerAddress mutation to create an address for the logged-in customer. Customer tokens in GraphQL call headers are recommended; session authentication is also supported.
Syntax: createCustomerAddress(input: CustomerAddressInput!): CustomerAddress
mutation {
createCustomerAddress(input: {
region: {
region: "Arizona"
region_code: "AZ"
}
country_code: US
street: ["123 Main Street"]
telephone: "7777777777"
postcode: "77777"
city: "Phoenix"
firstname: "Bob"
lastname: "Loblaw"
default_shipping: true
default_billing: false
}) {
id
region { region region_code }
country_code
street
telephone
postcode
city
default_shipping
default_billing
}
}
updateCustomerAddress
Customer token
Updates a customer address identified by its unique ID. The V2 variant (Storefront Compatibility Package, 2.4.9+) uses a string uid.
CustomerAddressInput
Returns: CustomerAddress
Use updateCustomerAddress (or updateCustomerAddressV2 from the Storefront Compatibility Package, shipping with Adobe Commerce 2.4.9) to update an existing customer address. The V2 variant takes the address uid (ID!) and a CustomerAddressInput and supports custom attributes via custom_attributesV2.
mutation {
updateCustomerAddressV2(
uid: "ODU="
input: {
city: "Austin"
postcode: "78701"
}
) {
id
city
postcode
}
}| Argument | Type | Description |
|---|---|---|
uid | ID! | The unique identifier of the customer address. |
input | CustomerAddressInput | Fields to update on the address. |
deleteCustomerAddress
Customer token
Deletes a customer address identified by its ID. Returns a Boolean indicating success.
Boolean
Use deleteCustomerAddress (or deleteCustomerAddressV2 from the Storefront Compatibility Package, shipping with Adobe Commerce 2.4.9) to delete a specific customer address. The mutation returns a Boolean indicating whether the deletion succeeded.
mutation {
deleteCustomerAddressV2(uid: "ODU=")
}| Argument | Type | Description |
|---|---|---|
uid | ID! | The unique ID of the CustomerAddress object. |
countries
Guest
Customer token
Returns all countries in which the store can do business, with their ISO codes, localized names and available regions.
Country
The countries query returns all countries in which the store can do business. Use the country query for information about a single country.
query {
countries {
id
two_letter_abbreviation
three_letter_abbreviation
full_name_locale
full_name_english
available_regions {
id
code
name
}
}
}
country
Guest
Customer token
Returns information about a specific country identified by its ISO code, including available regions.
Country
The country query retrieves information about a specific country, including its localized names and available regions. Use the countries query to list all supported countries.
Accepts a single argument id (String), typically the ISO two-letter abbreviation (for example "AU" or "BR").
query {
country(id: "AU") {
id
two_letter_abbreviation
three_letter_abbreviation
full_name_locale
full_name_english
available_regions {
id
code
name
}
}
}
confirmEmail
Guest
Completes customer activation by confirming the email address with the confirmation key sent during sign-up.
ConfirmEmailInput
Returns: CustomerOutput
The confirmEmail mutation completes the customer activation flow by validating the email address. Adobe Commerce sends a confirmation key during account creation; the customer supplies it to confirm their email.
mutation {
confirmEmail(input: {
email: "roni_cost@example.com"
confirmation_key: "abcde"
}) {
customer {
email
}
}
}| Field | Type | Description |
|---|---|---|
email | String | The customer's email address. |
confirmation_key | String | The confirmation token emailed by Adobe Commerce. |
resendConfirmationEmail
Guest
Resends the account confirmation email to a customer who has not yet completed activation.
Boolean
The resendConfirmationEmail mutation resends the confirmation email to a customer who has not completed activation. It returns true on success, false otherwise.
mutation ResendConfirmationEmail {
resendConfirmationEmail(email: "roni_cost@example.com")
}| Argument | Type | Required |
|---|---|---|
email | String | Yes |
deleteCustomer
Customer token
Deletes the authenticated customer account.
Permite apagar a conta do cliente logado. Respeita GDPR. Em algumas versões pode não estar habilitada — verifique a config customer/account_delete/enabled no admin antes de usar.