Skip to content

Commit

Permalink
Adjust warning blocks in address pages
Browse files Browse the repository at this point in the history
  • Loading branch information
IKarbowiak committed Feb 5, 2025
1 parent fa3373c commit dbd8090
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 163 deletions.
96 changes: 3 additions & 93 deletions docs/developer/checkout/address.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ input data:
### Important Notes

The setting is treated as part of the address and cannot be provided independently in the mutation input.
Attempting to set `saveShippingAddress` or `saveBillingAddres`s without including the corresponding
Attempting to set `saveShippingAddress` or `saveBillingAddress` without including the corresponding
`shippingAddress` or `billingAddress` will result in an error.

For example, providing `saveShippingAddress` in the `checkoutCreate` mutation without including `shippingAddress` will raise an error:
Expand Down Expand Up @@ -596,96 +596,6 @@ invalid input data:
```

:::warning
Each time the shipping address is updated, the saveAddress flag resets to its default value.
To ensure the correct setting is applied, you must explicitly provide the `saveAddress` value in the input.
1. Setting a shipping address with `saveAddress: false`.
```graphql
mutation checkoutShippingAddressUpdate(
$id: ID,
$shippingAddress: AddressInput!
$saveAddress: Boolean
){
checkoutShippingAddressUpdate(
id: $id
shippingAddress: $shippingAddress
saveAddress: $saveAddress
) {
errors {
field
message
code
}
checkout {
id
shippingAddress {
id
postalCode
firstName
lastName
country {
code
}
}
}
}
}
```
input data:
```json
{
"id": "Q2hlY2tvdXQ6MjU1MmYxYTctN2Q3MC00ODg5LTg1OWYtNGNiNWNlMGI4Zjhk",
"saveAddress": false,
"shippingAddress": {
"firstName": "John",
"lastName": "Doe",
"streetAddress1": "1470 Pinewood Avenue",
"city": "Michigan",
"postalCode": "49855",
"country": "US",
"countryArea": "MI"
}
}
```

2. Updating the address without specifying `saveAddress`.
If `saveAddress` is not provided in the request, the updated address will be saved in the customer’s address book.
```graphql
mutation checkoutShippingAddressUpdate(
$id: ID,
$shippingAddress: AddressInput!
){
checkoutShippingAddressUpdate(
id: $id
shippingAddress: $shippingAddress
) {
errors {
field
message
code
}
checkout {
id
shippingAddress {
id
postalCode
firstName
lastName
country {
code
}
}
}
}
}
```
input data:
```json
{
"id": "Q2hlY2tvdXQ6MjU1MmYxYTctN2Q3MC00ODg5LTg1OWYtNGNiNWNlMGI4Zjhk"
"shippingAddress": { "postalCode": "12-333"}
}
```


If you want to ensure the address is not saved, you must explicitly provide `saveAddress: false` in step 2.
Any update to the address, even a partial change, resets the `saveAddress` flag to its default behavior.
To ensure the correct setting is applied, explicitly provide the `saveAddress` value with each update.
:::
73 changes: 3 additions & 70 deletions docs/developer/order/address.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -127,73 +127,6 @@ invalid input data:
```

:::warning
Each time the shipping address is updated, the saveAddress flag resets to its default value.
To ensure the correct setting is applied, you must explicitly provide the `saveAddress` value in the input.
1. Setting a shipping address with `saveShippingAddress: true`.
```graphql
mutation DraftOrderUpdate(
$id: ID!,
$input: DraftOrderInput!,
) {
draftOrderUpdate(
id: $id,
input: $input
) {
order {
userEmail
externalReference
}
}
}
```
example input data:
```json
{
"id": "T3JkZXI6ZGJlZjkxZmQtMjMxZS00ZGNmLTk5ZGMtNGQxOTBhNDFjYTQ1",
"input": {
"shippingAddress": {
"firstName": "John"
"lastName": "Doe"
"streetAddress1": "1470 Pinewood Avenue"
"city": "Michigan"
"postalCode": "49855"
"country": "US"
"countryArea": "MI"
},
"saveShippingAddress": true
}
}
```
2. Updating the address without specifying `saveShippingAddress`.
If `saveShippingAddress` is not provided in the request, the updated address will be not saved in the customer’s address book.
```graphql
mutation DraftOrderUpdate(
$id: ID!,
$input: DraftOrderInput!,
) {
draftOrderUpdate(
id: $id,
input: $input
) {
order {
userEmail
externalReference
}
}
}
```

Example input data:
```json
{
"id": "T3JkZXI6ZGJlZjkxZmQtMjMxZS00ZGNmLTk5ZGMtNGQxOTBhNDFjYTQ1",
"input": {
"shippingAddress": {
"postalCode": "49666"
}
}
}
```

If you want to ensure the address is saved, you must explicitly provide `saveShippingAddress: true` in step 2.
:::
Any update to the address, even a partial change, resets the `saveAddress` flag to its default behavior.
To ensure the correct setting is applied, explicitly provide the `saveAddress` value with each update.
:::

0 comments on commit dbd8090

Please sign in to comment.