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

Commit 593c2b8

Browse files
committed
Refactored order apis for guest-cart
1 parent 17b019b commit 593c2b8

File tree

4 files changed

+11
-61
lines changed

4 files changed

+11
-61
lines changed

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

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -421,21 +421,8 @@ For this example, we'll configure the Sprite Yoga Companion Kit as follows:
421421

422422
{% endcollapsible %}
423423

424-
These calls are performed on behalf of a guest-customer, and there is no need for a token.
425-
426-
**Endpoint:**
427-
428-
`POST <host>/rest/<store_code>/guest-carts/<cartId>/items`
429-
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-
432-
433-
**Headers:**
434-
435-
`Content-Type` `application/json`
436-
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)
438-
424+
{:.bs-callout-info}
425+
Use the `V1/guest-carts/<cartId>/items` endpoint to add items to the cart on behalf of a guest. Do not include an authorization token. 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)
439426

440427
### Verify this step {#verify-step}
441428

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,8 @@ 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-
67+
{:.bs-callout-info}
68+
Use the `V1/guest-carts/<cartId>/payment-information` endpoint to set the payment information on behalf of a guest. Do not include an authorization token.
7969

8070
### Review the order as an admin {#review-order}
8171

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

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -59,27 +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-guest-cart}
63-
64-
To create guest cart there is no need to pass the token in the header.
65-
66-
**Endpoint:**
67-
68-
`POST <host>/rest/<store_code>/V1/guest-carts`
69-
70-
**Headers:**
71-
72-
`Content-Type` `application/json`
73-
74-
**Payload:**
75-
76-
None
77-
78-
**Response:**
79-
80-
The response is the `quoteId`: `5JfSLCdQUP4gwmM4z8u74iuPa0kfkZ5l`
81-
82-
The quoteId for guest customer quote will be masked.
62+
{:.bs-callout-info}
63+
Use the `V1/guest-carts` endpoint to create cart on behalf of a guest. Do not include an authorization token. The quoteId for guest customer quote will be masked.
8364

8465
### Verify this step {#verify-step}
8566

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

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

101+
{:.bs-callout-info}
102+
Use the `V1/guest-carts/<cartId>/estimate-shipping-methods` endpoint to estimate shipping costs on behalf of a guest. Do not include an authorization token.
103+
101104
### Estimate shipping costs for guest customer {#estimate-guest-shipping}
102105

103106
**Endpoint:**
@@ -350,19 +353,8 @@ The available payment methods are `banktransfer` and `checkmo`. The customer wil
350353

351354
{% endcollapsible %}
352355

353-
### Set shipping and billing information for guest customer{#set-guest-addresses}
354-
355-
**Endpoint:**
356-
357-
`POST <host>/rest/<store_code>/V1/guest-carts/<cartId>/shipping-information`
358-
359-
**Headers:**
360-
361-
`Content-Type` `application/json`
362-
363-
The payload and response is same as for logged in customer.
364-
365-
356+
{:.bs-callout-info}
357+
Use the `V1/guest-carts/<cartId>/shipping-information` endpoint to set the billing and shipping information on behalf of a guest. Do not include an authorization token.
366358

367359
{:.bs-callout .bs-callout-info}
368360
If you tried this call on your own, and the value of the `shipping_amount` parameter is `0`, then you did not deactivate the "Spend $50 or more - shipping is free!" cart price rule. See [Deactivate a cart price rule](order-config-store.html#price-rule) for details.

0 commit comments

Comments
 (0)