Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/data/navigation/sections/graphql.js
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,10 @@ module.exports = [
title: "deleteCustomerAddress",
path: "/graphql/schema/customer/mutations/delete-address/",
},
{
title: "deleteCustomerAddressV2",
path: "/graphql/schema/customer/mutations/delete-address-v2/",
},
{
title: "exchangeExternalCustomerToken",
path: "/graphql/schema/customer/mutations/exchange-external-customer-token/",
Expand Down Expand Up @@ -631,6 +635,10 @@ module.exports = [
title: "updateCustomerAddress",
path: "/graphql/schema/customer/mutations/update-address/",
},
{
title: "updateCustomerAddressV2",
path: "/graphql/schema/customer/mutations/update-address-v2/",
},
{
title: "updateCustomerEmail",
path: "/graphql/schema/customer/mutations/update-email/",
Expand Down
85 changes: 85 additions & 0 deletions src/pages/graphql/schema/customer/mutations/delete-address-v2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
title: deleteCustomerAddressV2 mutation
---

# deleteCustomerAddressV2 mutation

Use the `deleteCustomerAddressV2` mutation to delete the specified customer address. It returns a Boolean value that indicates whether the operation was successful.

We recommend you use a customer token in the header of your call to delete a customer. However, you also can use [session authentication](https://developer.adobe.com/commerce/webapi/get-started/authentication/gs-authentication-session).

<InlineAlert variant="info" slots="text1" />

This mutation is part of the [Storefront Compatibility Package](https://experienceleague.adobe.com/developer/commerce/storefront/setup/configuration/storefront-compatibility/v248/). It will be added to Adobe Commerce 2.4.9.

## Syntax

```graphql
mutation {
deleteCustomerAddressV2(
uid: ID!
) {
Boolean
}
}
```

<!---
## Reference

The [`deleteCustomerAddressV2`](https://developer.adobe.com/commerce/webapi/graphql-api/saas/index.html#mutation-deleteCustomerAddressV2) reference provides detailed information about the types and fields defined in this mutation.
-->

## Example usage

The following call deletes a customer's address.

**Request:**

```graphql
mutation {
deleteCustomerAddressV2(uid: "ODU=")
}
```

**Response:**

```json
{
"data": {
"deleteCustomerAddressV2": true
}
}
```

## Input attributes

The `deleteCustomerAddressV2` mutation requires the following input:

Attribute | Data Type | Description
--- | --- | ---
`uid` | ID! | The unique ID for a `CustomerAddress` object.

## Output attributes

The `deleteCustomerAddressV2` mutation returns a Boolean value that indicates whether the operation was successful.

## Errors

Error | Description
--- | ---
`Address "uid" value must be specified` | The `uid` argument is null or empty.
`Could not find an address with ID "XXX"` | The customer address specified in the `uid` argument does not exist.
`Customer Address XXX is set as default billing address and cannot be deleted` | You cannot delete a default billing address.
`Customer Address XXX is set as default shipping address and cannot be deleted` | You cannot delete a default shipping address.
`Field "deleteCustomerAddressV2" argument "uid" requires type ID!, found "XXX".` | The specified `uid` argument value has the wrong type.
`Syntax Error: Expected Name, found )` | The `uid` argument was omitted or does not have a value.
`The current customer isn't authorized.` | The current customer is not currently logged in, or the customer's token does not exist in the `oauth_token` table.

## Related topics

* [customer query](../queries/customer.md)
* [createCustomer mutation](create.md)
* [updateCustomer mutation](update.md)
* [createCustomerAddress mutation](create-address.md)
* [updateCustomerAddress mutation](update-address.md)
4 changes: 4 additions & 0 deletions src/pages/graphql/schema/customer/mutations/delete-address.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ title: deleteCustomerAddress mutation

# deleteCustomerAddress mutation

<InlineAlert variant="warning" slots="text" />

This mutation has been deprecated in Adobe Commerce as a Cloud Service and will be deprecated in Adobe Commerce 2.4.9. We recommend using the [deleteCustomerAddressV2 mutation](./delete-address-v2.md) instead.

Use the `deleteCustomerAddress` mutation to delete the specified customer address. It returns a Boolean value that indicates whether the operation was successful.

We recommend you use a customer token in the header of your call to delete a customer. However, you also can use [session authentication](https://developer.adobe.com/commerce/webapi/get-started/authentication/gs-authentication-session).
Expand Down
2 changes: 2 additions & 0 deletions src/pages/graphql/schema/customer/mutations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ The customer mutations allow you to perform the following operations:
* [`createCustomerAddress`](create-address.md)
* [`createCustomerV2`](create-v2.md)
* [`deleteCustomerAddress`](delete-address.md)
* [`deleteCustomerAddressV2`](delete-address-v2.md)
* [`updateCustomer`](update.md)
* [`updateCustomerAddress`](update-address.md)
* [`updateCustomerAddressV2`](update-address-v2.md)
* [`updateCustomerEmail`](update-email.md)
* [`updateCustomerV2`](update-v2.md)

Expand Down
164 changes: 164 additions & 0 deletions src/pages/graphql/schema/customer/mutations/update-address-v2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
---
title: updateCustomerAddressV2 mutation
---

# updateCustomerAddressV2 mutation

Use the `updateCustomerAddressV2` mutation to update the customer's address.

To return or modify information about a customer, we recommend you use customer tokens in the header of your GraphQL calls. However, you also can use [session authentication](https://developer.adobe.com/commerce/webapi/get-started/authentication/gs-authentication-session).

<InlineAlert variant="info" slots="text1" />

This mutation is part of the [Storefront Compatibility Package](https://experienceleague.adobe.com/developer/commerce/storefront/setup/configuration/storefront-compatibility/v248/). It will be added to Adobe Commerce 2.4.9.

## Syntax

```graphql
mutation {
updateCustomerAddressV2(
uid: ID!,
input: CustomerAddressInput
) {
CustomerAddress
}
}
```

<!---
## Reference

The [`updateCustomerAddressV2`](https://developer.adobe.com/commerce/webapi/graphql-api/saas/index.html#mutation-updateCustomerAddressV2) reference provides detailed information about the types and fields defined in this mutation.
-->

## Example usage

### Update a customer address

The following call updates the customer's city and postcode.

**Request:**

```graphql
mutation {
updateCustomerAddressV2(uid:"ODU=", input: {
city: "New City"
postcode: "55555"
}) {
uid
city
postcode
}
}
```

**Response:**

```json
{
"data": {
"updateCustomerAddressV2": {
"uid": "ODU=",
"city": "New City",
"postcode": 55555
}
}
}
```

### Update a customer address with custom attributes

The following call updates the customer's city, postcode, and custom attributes. The merchant has previously created the `station` and `services` attributes for customer addresses.

**Request:**

```graphql
mutation {
updateCustomerAddressV2(uid: "ODU=", input: {
city: "New City"
postcode: "55555"
custom_attributesV2: [
{
attribute_code: "station",
value: "Times Sq - 42 St"
},
{
attribute_code: "services"
value: "507"
selected_options: [
{
uid: "NTA3"
value: "507"
}
]
}
]
}) {
uid
city
postcode
custom_attributesV2 {
code
... on AttributeValue {
value
}
... on AttributeSelectedOptions {
selected_options {
label
value
}
}
}
}
}
```

**Response:**

```json
{
"data": {
"updateCustomerAddressV2": {
"uid": "ODU=",
"city": "New City",
"postcode": 55555,
"custom_attributesV2": [
{
"code": "station",
"value": "Times Sq - 42 St"
},
{
"code": "services",
"selected_options": [
{
"label": "hospital",
"value": "507"
}
]
}
]
}
}
}
```

## Errors

Error | Description
--- | ---
`Address "uid" value must be specified` | The `uid` argument is null or empty.
`Could not find an address with ID "XXX"` | The customer address specified in the `uid` argument does not exist.
`Current customer does not have permission to address with ID "XXX"` | The customer tries to update the address of another customer.
`Field "updateCustomerAddressV2" argument "uid" of type "ID!" is required but not provided.` | The `uid` argument was omitted.
`Field "updateCustomerAddressV2" argument "uid" requires type ID!, found "XXX".` | The specified `uid` argument value has the wrong type.
`"input" value must be specified` | The `input` argument was omitted or was specified but is empty.
`Syntax Error: Expected Name, found )` | The `uid` and `input` arguments are omitted.
`The current customer isn't authorized.` | The current customer is not currently logged in, or the customer's token does not exist in the `oauth_token` table.

## Related topics

* [customer query](../queries/customer.md)
* [createCustomer mutation](create.md)
* [updateCustomer mutation](update.md)
* [createCustomerAddress mutation](create-address.md)
* [deleteCustomerAddress mutation](delete-address.md)
4 changes: 4 additions & 0 deletions src/pages/graphql/schema/customer/mutations/update-address.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ title: updateCustomerAddress mutation

# updateCustomerAddress mutation

<InlineAlert variant="warning" slots="text" />

This mutation has been deprecated in Adobe Commerce as a Cloud Service and will be deprecated in Adobe Commerce 2.4.9. We recommend using the [`updateCustomerAddressV2` mutation](./update-address-v2.md) instead.

Use the `updateCustomerAddress` mutation to update the customer's address.

To return or modify information about a customer, we recommend you use customer tokens in the header of your GraphQL calls. However, you also can use [session authentication](https://developer.adobe.com/commerce/webapi/get-started/authentication/gs-authentication-session).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ You can retrieve the token from the `CustomerOrder` object on the [`placeOrder`

## Reference

The `guestOrderByToken` reference provides detailed information about the types and fields defined in this query.
The [`guestOrderByToken`](https://developer.adobe.com/commerce/webapi/graphql-api/index.html#query-guestOrderByToken) reference provides detailed information about the types and fields defined in this query.

## Example usage

Expand Down
8 changes: 4 additions & 4 deletions src/pages/graphql/schema/orders/queries/guest-order.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ title: guestOrder query

# guestOrder query

Use the `guestOrder` query to retrieve details about an order placed by a guest or customer who is not logged in. To retrieve this information, the guest must supply the order number, email, and postal code used to create the order.
Use the `guestOrder` query to retrieve details about an order placed by a guest or customer who is not logged in. To retrieve this information, the guest must supply the order number, email, and last name that was used to create the order.

## Syntax

`{guestOrder(input: OrderInformationInput!) {CustomerOrder!}}`
`{guestOrder(input: GuestOrderInformationInput!) {CustomerOrder!}}`

## Reference

The `guestOrder` reference provides detailed information about the types and fields defined in this query.
The [`guestOrder`](https://developer.adobe.com/commerce/webapi/graphql-api/index.html#query-guestOrder) reference provides detailed information about the types and fields defined in this query.

## Example usage

Expand All @@ -24,7 +24,7 @@ The `guestOrder` reference provides detailed information about the types and fie
input: {
number: "000000001",
email: "test@example.com",
postcode: "12345-6789"
lastname: "User"
}
) {
status
Expand Down