Skip to content

Commit 4c4d872

Browse files
committed
magento#589: Add a tutorial for the checkout workflow
1 parent 9b5d929 commit 4c4d872

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

guides/v2.3/graphql/tutorials/checkout/checkout-billing-address.md

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ contributor_name: Atwix
1111
contributor_link: https://www.atwix.com/
1212
---
1313

14+
{:.bs-callout .bs-callout-tip}
15+
Billing address must always be set.
16+
1417
Use [setBillingAddressOnCart]({{ page.baseurl }}/graphql/reference/quote.html#set-the-billing-address-on-cart-attributes) mutation query to set a billing address. GraphQl allows to add billing address in the next ways:
1518
- add new billing address
1619
- add new billing address and set it as a shipping addresses
@@ -96,7 +99,9 @@ where
9699
}
97100
```
98101

99-
###
102+
### Add a new address for billing and shipping
103+
104+
The following mutation adds a new billing address and sets it as a shipping address too.
100105

101106
**Request**
102107

@@ -106,19 +111,19 @@ mutation {
106111
input: {
107112
cart_id: "{{ CART_ID }}"
108113
billing_address: {
109-
address: {
114+
address: {
110115
firstname: "John"
111-
lastname: "Doe"
112-
company: "Company Name"
113-
street: ["320 N Crescent Dr", "Beverly Hills"]
114-
city: "Los Angeles"
115-
region: "CA"
116-
postcode: "90210"
117-
country_code: "US"
118-
telephone: "123-456-0000"
119-
save_in_address_book: false
120-
}
121-
# use_for_shipping: true
116+
lastname: "Doe"
117+
company: "Company Name"
118+
street: ["320 N Crescent Dr", "Beverly Hills"]
119+
city: "Los Angeles"
120+
region: "CA"
121+
postcode: "90210"
122+
country_code: "US"
123+
telephone: "123-456-0000"
124+
save_in_address_book: false
125+
}
126+
use_for_shipping: true
122127
}
123128
}
124129
) {
@@ -157,6 +162,7 @@ mutation {
157162
```
158163

159164
**Response**
165+
160166
```json
161167
{
162168
"data": {
@@ -204,7 +210,6 @@ mutation {
204210
}
205211
```
206212

207-
208213
### Use the existing customer address
209214

210215
**Request**
@@ -214,7 +219,7 @@ mutation {
214219
input: {
215220
cart_id: "{{ CART_ID }}"
216221
billing_address: {
217-
customer_address_id: 937
222+
customer_address_id: {{ CUSTOMER_ADDRESS_ID }}
218223
}
219224
}
220225
) {
@@ -226,7 +231,9 @@ mutation {
226231
}
227232
}
228233
```
234+
229235
**Request**
236+
230237
```text
231238
mutation {
232239
setBillingAddressOnCart(

0 commit comments

Comments
 (0)