Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 17b019b

Browse files
committed
Refactored docs Order creation API endpoints updated for guest users #6086
1 parent 8091323 commit 17b019b

File tree

4 files changed

+22
-44
lines changed

4 files changed

+22
-44
lines changed

src/guides/v2.2/rest/tutorials/orders/order-add-items.md

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ functional_areas:
1616

1717
This article shows how to add a simple product, a downloadable product, and a [bundle product](https://glossary.magento.com/bundle-product) to the cart.
1818

19-
This calls are performed on behalf of a customer, and the customer's token is specified in the [authorization](https://glossary.magento.com/authorization) header.
19+
These calls are performed on behalf of a customer, and the customer's token is specified in the [authorization](https://glossary.magento.com/authorization) header.
2020

2121
### Add a simple product to a cart {#add-simple}
2222

@@ -421,45 +421,20 @@ For this example, we'll configure the Sprite Yoga Companion Kit as follows:
421421

422422
{% endcollapsible %}
423423

424-
This calls are performed on behalf of a guest-customer, and there is no need of token.
425-
426-
### Add a simple product to a cart {#add-simple}
424+
These calls are performed on behalf of a guest-customer, and there is no need for a token.
427425

428426
**Endpoint:**
429427

430428
`POST <host>/rest/<store_code>/guest-carts/<cartId>/items`
431429

432-
Cart Id is the quoteId recieved on quote creation.
430+
Cart Id is the quoteId recieved on [quote creation](https://devdocs.magento.com/guides/v2.3/rest/tutorials/orders/order-create-quote.html#create-guest-cart).
431+
433432

434433
**Headers:**
435434

436435
`Content-Type` `application/json`
437436

438-
**Payload:**
439-
440-
```json
441-
{
442-
"cartItem": {
443-
"sku": "WS12-M-Orange",
444-
"qty": 1,
445-
"quote_id": "5JfSLCdQUP4gwmM4z8u74iuPa0kfkZ5l"
446-
}
447-
}
448-
```
449-
**Response:**
450-
451-
```json
452-
{
453-
"item_id": 7,
454-
"sku": "WS12-M-Orange",
455-
"qty": 1,
456-
"name": "Radiant Tee-M-Orange",
457-
"product_type": "simple",
458-
"quote_id": "27"
459-
}
460-
```
461-
462-
Note: The payload and response is same for all products apart from quote id in the payload (Need to give the masked ID)
437+
Note: The payload and response is same as the logged-in customer for all product types apart from quote id in the payload (Need to give the masked ID)
463438

464439

465440
### Verify this step {#verify-step}

src/guides/v2.2/rest/tutorials/orders/order-create-order.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,19 @@ When you submit payment information, Magento creates an order and sends an order
6464

6565
An `orderID`, such as `3`.
6666

67+
### Send payment information for guest customer{#send-guest-payment}
68+
69+
**Endpoint:**
70+
71+
`POST <host>/rest/<store_code>/V1/guest-carts/<cartId>/payment-information`
72+
73+
**Headers:**
74+
75+
`Content-Type` `application/json`
76+
77+
Note: The payload and response is same as the logged-in customer for sending payment information.
78+
79+
6780
### Review the order as an admin {#review-order}
6881

6982
When you request an order object, the response contains full details about the order, including customer information, payment details, as well as totals and subtotals for the order and each individual item.
@@ -1573,17 +1586,6 @@ Not applicable
15731586

15741587
{% endcollapsible %}
15751588

1576-
### Send payment information for guest customer{#send-payment}
1577-
1578-
**Endpoint:**
1579-
1580-
`POST <host>/rest/<store_code>/V1/guest-carts/<cartId>/payment-information`
1581-
1582-
**Headers:**
1583-
1584-
`Content-Type` `application/json`
1585-
1586-
`Authorization` `Bearer <customer token>`
15871589

15881590

15891591
### Verify this step {#verify-step}

src/guides/v2.2/rest/tutorials/orders/order-create-quote.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ The response is the `quoteId`: `4`
5959
{:.bs-callout .bs-callout-tip}
6060
Some calls refer to this parameter as the `cartId`.
6161

62-
### Create a cart for a guest customer {#create-cart}
62+
### Create a cart for a guest customer {#create-guest-cart}
63+
6364
To create guest cart there is no need to pass the token in the header.
6465

6566
**Endpoint:**

src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Note that the cost for the `flatrate` shipping method is $15. The Sprite Yoga Co
9898
```
9999
{% endcollapsible %}
100100

101-
### Estimate shipping costs for guest customer {#estimate-shipping}
101+
### Estimate shipping costs for guest customer {#estimate-guest-shipping}
102102

103103
**Endpoint:**
104104

@@ -350,7 +350,7 @@ The available payment methods are `banktransfer` and `checkmo`. The customer wil
350350

351351
{% endcollapsible %}
352352

353-
### Set shipping and billing information for guest customer{#set-addresses}
353+
### Set shipping and billing information for guest customer{#set-guest-addresses}
354354

355355
**Endpoint:**
356356

0 commit comments

Comments
 (0)