From 8091323c56756b20cf01081a97e22524e0ad0841 Mon Sep 17 00:00:00 2001 From: sairam Date: Fri, 29 Nov 2019 19:42:12 +0530 Subject: [PATCH 01/10] Order creation API endpoints updated for guest users --- .../rest/tutorials/orders/order-add-items.md | 43 ++++++++++++++++++- .../tutorials/orders/order-create-order.md | 13 ++++++ .../tutorials/orders/order-create-quote.md | 23 +++++++++- .../orders/order-prepare-checkout.md | 26 +++++++++++ 4 files changed, 103 insertions(+), 2 deletions(-) diff --git a/src/guides/v2.2/rest/tutorials/orders/order-add-items.md b/src/guides/v2.2/rest/tutorials/orders/order-add-items.md index 6aa7b0cdf44..d4bfbbedd71 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-add-items.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-add-items.md @@ -16,7 +16,7 @@ functional_areas: 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. -All calls are performed on behalf of a customer, and the customer's token is specified in the [authorization](https://glossary.magento.com/authorization) header. +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. ### Add a simple product to a cart {#add-simple} @@ -421,6 +421,47 @@ For this example, we'll configure the Sprite Yoga Companion Kit as follows: {% endcollapsible %} +This calls are performed on behalf of a guest-customer, and there is no need of token. + +### Add a simple product to a cart {#add-simple} + +**Endpoint:** + +`POST /rest//guest-carts//items` + +Cart Id is the quoteId recieved on quote creation. + +**Headers:** + +`Content-Type` `application/json` + +**Payload:** + +```json +{ + "cartItem": { + "sku": "WS12-M-Orange", + "qty": 1, + "quote_id": "5JfSLCdQUP4gwmM4z8u74iuPa0kfkZ5l" + } +} +``` +**Response:** + +```json +{ + "item_id": 7, + "sku": "WS12-M-Orange", + "qty": 1, + "name": "Radiant Tee-M-Orange", + "product_type": "simple", + "quote_id": "27" +} +``` + +Note: The payload and response is same for all products apart from quote id in the payload (Need to give the masked ID) + + ### Verify this step {#verify-step} [Sign in](https://glossary.magento.com/sign-in-sign-out) as the customer and click on the [shopping cart](https://glossary.magento.com/shopping-cart). All the items you added are displayed. diff --git a/src/guides/v2.2/rest/tutorials/orders/order-create-order.md b/src/guides/v2.2/rest/tutorials/orders/order-create-order.md index e573a194eeb..6ae39eea1f8 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-create-order.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-create-order.md @@ -1573,6 +1573,19 @@ Not applicable {% endcollapsible %} +### Send payment information for guest customer{#send-payment} + +**Endpoint:** + +`POST /rest//V1/guest-carts//payment-information` + +**Headers:** + +`Content-Type` `application/json` + +`Authorization` `Bearer ` + + ### Verify this step {#verify-step} 1. Log in to the Luma store as the customer. The dashboard shows the order. diff --git a/src/guides/v2.2/rest/tutorials/orders/order-create-quote.md b/src/guides/v2.2/rest/tutorials/orders/order-create-quote.md index 91258acb6d3..f1a5da81854 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-create-quote.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-create-quote.md @@ -36,7 +36,7 @@ Magento identifies three types of users that can create a shopping cart: ### Create a cart for a logged-in customer {#create-cart} -This tutorial manages the cart of a logged-in customer. Unless otherwise noted, all calls must specify customer's token `q0u66k8h42yaevtchv09uyy3y9gaj2ap` in the header. +All calls for logged in customer must specify customer's token `q0u66k8h42yaevtchv09uyy3y9gaj2ap` in the header. **Endpoint:** @@ -59,6 +59,27 @@ The response is the `quoteId`: `4` {:.bs-callout .bs-callout-tip} Some calls refer to this parameter as the `cartId`. +### Create a cart for a guest customer {#create-cart} +To create guest cart there is no need to pass the token in the header. + +**Endpoint:** + +`POST /rest//V1/guest-carts` + +**Headers:** + +`Content-Type` `application/json` + +**Payload:** + +None + +**Response:** + +The response is the `quoteId`: `5JfSLCdQUP4gwmM4z8u74iuPa0kfkZ5l` + +The quoteId for guest customer quote will be masked. + ### Verify this step {#verify-step} There are no additional verification steps.`quoteId` values are not displayed on the [website](https://glossary.magento.com/website) or in Admin. diff --git a/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md b/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md index 793d13bf855..f37f96c3517 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md @@ -98,6 +98,18 @@ Note that the cost for the `flatrate` shipping method is $15. The Sprite Yoga Co ``` {% endcollapsible %} +### Estimate shipping costs for guest customer {#estimate-shipping} + +**Endpoint:** + +`POST /rest//V1/guest-carts//estimate-shipping-methods` + +**Headers:** + +`Content-Type` `application/json` + +The payload and response is same as for logged in customer. + ### Set shipping and billing information {#set-addresses} In this call, you specify the shipping and billing addresses, as well as the selected `carrier_code` and `method_code`. Since the Table Rate shipping method costs only $5, the customer selected this option. @@ -338,6 +350,20 @@ The available payment methods are `banktransfer` and `checkmo`. The customer wil {% endcollapsible %} +### Set shipping and billing information for guest customer{#set-addresses} + +**Endpoint:** + +`POST /rest//V1/guest-carts//shipping-information` + +**Headers:** + +`Content-Type` `application/json` + +The payload and response is same as for logged in customer. + + + {:.bs-callout .bs-callout-info} 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. From 17b019b6795576779ac7622887df6cfb33547492 Mon Sep 17 00:00:00 2001 From: sairam Date: Sun, 1 Dec 2019 19:29:32 +0530 Subject: [PATCH 02/10] Refactored docs Order creation API endpoints updated for guest users #6086 --- .../rest/tutorials/orders/order-add-items.md | 35 +++---------------- .../tutorials/orders/order-create-order.md | 24 +++++++------ .../tutorials/orders/order-create-quote.md | 3 +- .../orders/order-prepare-checkout.md | 4 +-- 4 files changed, 22 insertions(+), 44 deletions(-) diff --git a/src/guides/v2.2/rest/tutorials/orders/order-add-items.md b/src/guides/v2.2/rest/tutorials/orders/order-add-items.md index d4bfbbedd71..cde218000a9 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-add-items.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-add-items.md @@ -16,7 +16,7 @@ functional_areas: 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. -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. +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. ### Add a simple product to a cart {#add-simple} @@ -421,45 +421,20 @@ For this example, we'll configure the Sprite Yoga Companion Kit as follows: {% endcollapsible %} -This calls are performed on behalf of a guest-customer, and there is no need of token. - -### Add a simple product to a cart {#add-simple} +These calls are performed on behalf of a guest-customer, and there is no need for a token. **Endpoint:** `POST /rest//guest-carts//items` -Cart Id is the quoteId recieved on quote creation. +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). + **Headers:** `Content-Type` `application/json` -**Payload:** - -```json -{ - "cartItem": { - "sku": "WS12-M-Orange", - "qty": 1, - "quote_id": "5JfSLCdQUP4gwmM4z8u74iuPa0kfkZ5l" - } -} -``` -**Response:** - -```json -{ - "item_id": 7, - "sku": "WS12-M-Orange", - "qty": 1, - "name": "Radiant Tee-M-Orange", - "product_type": "simple", - "quote_id": "27" -} -``` - -Note: The payload and response is same for all products apart from quote id in the payload (Need to give the masked ID) +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) ### Verify this step {#verify-step} diff --git a/src/guides/v2.2/rest/tutorials/orders/order-create-order.md b/src/guides/v2.2/rest/tutorials/orders/order-create-order.md index 6ae39eea1f8..6539d04fecd 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-create-order.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-create-order.md @@ -64,6 +64,19 @@ When you submit payment information, Magento creates an order and sends an order An `orderID`, such as `3`. +### Send payment information for guest customer{#send-guest-payment} + +**Endpoint:** + +`POST /rest//V1/guest-carts//payment-information` + +**Headers:** + +`Content-Type` `application/json` + +Note: The payload and response is same as the logged-in customer for sending payment information. + + ### Review the order as an admin {#review-order} 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 {% endcollapsible %} -### Send payment information for guest customer{#send-payment} - -**Endpoint:** - -`POST /rest//V1/guest-carts//payment-information` - -**Headers:** - -`Content-Type` `application/json` - -`Authorization` `Bearer ` ### Verify this step {#verify-step} diff --git a/src/guides/v2.2/rest/tutorials/orders/order-create-quote.md b/src/guides/v2.2/rest/tutorials/orders/order-create-quote.md index f1a5da81854..f155afb6703 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-create-quote.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-create-quote.md @@ -59,7 +59,8 @@ The response is the `quoteId`: `4` {:.bs-callout .bs-callout-tip} Some calls refer to this parameter as the `cartId`. -### Create a cart for a guest customer {#create-cart} +### Create a cart for a guest customer {#create-guest-cart} + To create guest cart there is no need to pass the token in the header. **Endpoint:** diff --git a/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md b/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md index f37f96c3517..dd52ffb27e3 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md @@ -98,7 +98,7 @@ Note that the cost for the `flatrate` shipping method is $15. The Sprite Yoga Co ``` {% endcollapsible %} -### Estimate shipping costs for guest customer {#estimate-shipping} +### Estimate shipping costs for guest customer {#estimate-guest-shipping} **Endpoint:** @@ -350,7 +350,7 @@ The available payment methods are `banktransfer` and `checkmo`. The customer wil {% endcollapsible %} -### Set shipping and billing information for guest customer{#set-addresses} +### Set shipping and billing information for guest customer{#set-guest-addresses} **Endpoint:** From 593c2b81e00584505a1b3c8b1ba6bdd4ad4453e8 Mon Sep 17 00:00:00 2001 From: sairam Date: Wed, 4 Dec 2019 19:47:01 +0530 Subject: [PATCH 03/10] Refactored order apis for guest-cart --- .../rest/tutorials/orders/order-add-items.md | 17 ++------------ .../tutorials/orders/order-create-order.md | 14 ++--------- .../tutorials/orders/order-create-quote.md | 23 ++----------------- .../orders/order-prepare-checkout.md | 18 ++++----------- 4 files changed, 11 insertions(+), 61 deletions(-) diff --git a/src/guides/v2.2/rest/tutorials/orders/order-add-items.md b/src/guides/v2.2/rest/tutorials/orders/order-add-items.md index cde218000a9..7f10d16435d 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-add-items.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-add-items.md @@ -421,21 +421,8 @@ For this example, we'll configure the Sprite Yoga Companion Kit as follows: {% endcollapsible %} -These calls are performed on behalf of a guest-customer, and there is no need for a token. - -**Endpoint:** - -`POST /rest//guest-carts//items` - -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). - - -**Headers:** - -`Content-Type` `application/json` - -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) - +{:.bs-callout-info} +Use the `V1/guest-carts//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) ### Verify this step {#verify-step} diff --git a/src/guides/v2.2/rest/tutorials/orders/order-create-order.md b/src/guides/v2.2/rest/tutorials/orders/order-create-order.md index 6539d04fecd..84f39106c10 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-create-order.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-create-order.md @@ -64,18 +64,8 @@ When you submit payment information, Magento creates an order and sends an order An `orderID`, such as `3`. -### Send payment information for guest customer{#send-guest-payment} - -**Endpoint:** - -`POST /rest//V1/guest-carts//payment-information` - -**Headers:** - -`Content-Type` `application/json` - -Note: The payload and response is same as the logged-in customer for sending payment information. - +{:.bs-callout-info} +Use the `V1/guest-carts//payment-information` endpoint to set the payment information on behalf of a guest. Do not include an authorization token. ### Review the order as an admin {#review-order} diff --git a/src/guides/v2.2/rest/tutorials/orders/order-create-quote.md b/src/guides/v2.2/rest/tutorials/orders/order-create-quote.md index f155afb6703..dfe346e17ea 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-create-quote.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-create-quote.md @@ -59,27 +59,8 @@ The response is the `quoteId`: `4` {:.bs-callout .bs-callout-tip} Some calls refer to this parameter as the `cartId`. -### Create a cart for a guest customer {#create-guest-cart} - -To create guest cart there is no need to pass the token in the header. - -**Endpoint:** - -`POST /rest//V1/guest-carts` - -**Headers:** - -`Content-Type` `application/json` - -**Payload:** - -None - -**Response:** - -The response is the `quoteId`: `5JfSLCdQUP4gwmM4z8u74iuPa0kfkZ5l` - -The quoteId for guest customer quote will be masked. +{:.bs-callout-info} +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. ### Verify this step {#verify-step} diff --git a/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md b/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md index dd52ffb27e3..22bc069bcea 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md @@ -98,6 +98,9 @@ Note that the cost for the `flatrate` shipping method is $15. The Sprite Yoga Co ``` {% endcollapsible %} +{:.bs-callout-info} +Use the `V1/guest-carts//estimate-shipping-methods` endpoint to estimate shipping costs on behalf of a guest. Do not include an authorization token. + ### Estimate shipping costs for guest customer {#estimate-guest-shipping} **Endpoint:** @@ -350,19 +353,8 @@ The available payment methods are `banktransfer` and `checkmo`. The customer wil {% endcollapsible %} -### Set shipping and billing information for guest customer{#set-guest-addresses} - -**Endpoint:** - -`POST /rest//V1/guest-carts//shipping-information` - -**Headers:** - -`Content-Type` `application/json` - -The payload and response is same as for logged in customer. - - +{:.bs-callout-info} +Use the `V1/guest-carts//shipping-information` endpoint to set the billing and shipping information on behalf of a guest. Do not include an authorization token. {:.bs-callout .bs-callout-info} 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. From 8ef3863a90b2774031abe64120ef352491689906 Mon Sep 17 00:00:00 2001 From: sairam Date: Wed, 4 Dec 2019 19:52:39 +0530 Subject: [PATCH 04/10] Refactored order apis for guest-cart --- .../rest/tutorials/orders/order-prepare-checkout.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md b/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md index 22bc069bcea..a4dd069a76a 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md @@ -101,17 +101,6 @@ Note that the cost for the `flatrate` shipping method is $15. The Sprite Yoga Co {:.bs-callout-info} Use the `V1/guest-carts//estimate-shipping-methods` endpoint to estimate shipping costs on behalf of a guest. Do not include an authorization token. -### Estimate shipping costs for guest customer {#estimate-guest-shipping} - -**Endpoint:** - -`POST /rest//V1/guest-carts//estimate-shipping-methods` - -**Headers:** - -`Content-Type` `application/json` - -The payload and response is same as for logged in customer. ### Set shipping and billing information {#set-addresses} From ce107aeeea29420defda890daebbb646d0a60317 Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Thu, 5 Dec 2019 12:52:25 -0600 Subject: [PATCH 05/10] Update order-add-items.md --- src/guides/v2.2/rest/tutorials/orders/order-add-items.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/guides/v2.2/rest/tutorials/orders/order-add-items.md b/src/guides/v2.2/rest/tutorials/orders/order-add-items.md index 7f10d16435d..02295626653 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-add-items.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-add-items.md @@ -14,10 +14,14 @@ functional_areas: - Catalog --- -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. +This step shows how to add a simple product, a downloadable product, and a [bundle product](https://glossary.magento.com/bundle-product) to the cart. 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. +{:.bs-callout-info} +Use the `V1/guest-carts//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, except for from quote ID in the payload. + + ### Add a simple product to a cart {#add-simple} To add a [simple product](https://glossary.magento.com/simple-product) to a cart, you must provide a `sku`, the quantity, and the [quote](https://glossary.magento.com/quote) ID, which was generated when the cart was created. @@ -421,9 +425,6 @@ For this example, we'll configure the Sprite Yoga Companion Kit as follows: {% endcollapsible %} -{:.bs-callout-info} -Use the `V1/guest-carts//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) - ### Verify this step {#verify-step} [Sign in](https://glossary.magento.com/sign-in-sign-out) as the customer and click on the [shopping cart](https://glossary.magento.com/shopping-cart). All the items you added are displayed. From d9a70f6f189bdb7d4cc663e7228de1ce3f03d143 Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Thu, 5 Dec 2019 12:53:55 -0600 Subject: [PATCH 06/10] Update order-create-order.md --- src/guides/v2.2/rest/tutorials/orders/order-create-order.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/guides/v2.2/rest/tutorials/orders/order-create-order.md b/src/guides/v2.2/rest/tutorials/orders/order-create-order.md index 84f39106c10..6e7b40b2962 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-create-order.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-create-order.md @@ -23,6 +23,9 @@ The [shopping cart](https://glossary.magento.com/shopping-cart) contains three i When you submit payment information, Magento creates an order and sends an order confirmation to the customer. Since we are using an offline [payment method](https://glossary.magento.com/payment-method) in this tutorial, we do not need to provide detailed payment information. The endpoint used in this example requires only the payment method and billing address information. +{:.bs-callout-info} +Use the `V1/guest-carts//payment-information` endpoint to set the payment information on behalf of a guest. Do not include an authorization token. + **Endpoint:** `POST /rest//V1/carts/mine/payment-information` @@ -64,9 +67,6 @@ When you submit payment information, Magento creates an order and sends an order An `orderID`, such as `3`. -{:.bs-callout-info} -Use the `V1/guest-carts//payment-information` endpoint to set the payment information on behalf of a guest. Do not include an authorization token. - ### Review the order as an admin {#review-order} 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. From 5a62aae09bb50aa6d25ef12ab3ee1a26fedb754a Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Thu, 5 Dec 2019 12:54:33 -0600 Subject: [PATCH 07/10] Update order-create-order.md --- src/guides/v2.2/rest/tutorials/orders/order-create-order.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/guides/v2.2/rest/tutorials/orders/order-create-order.md b/src/guides/v2.2/rest/tutorials/orders/order-create-order.md index 6e7b40b2962..f9d43dd2eaa 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-create-order.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-create-order.md @@ -1576,8 +1576,6 @@ Not applicable {% endcollapsible %} - - ### Verify this step {#verify-step} 1. Log in to the Luma store as the customer. The dashboard shows the order. From 3d62f4a89e52963f175d5cfb994975fb892782a4 Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Thu, 5 Dec 2019 12:56:56 -0600 Subject: [PATCH 08/10] Update order-create-quote.md --- .../v2.2/rest/tutorials/orders/order-create-quote.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/guides/v2.2/rest/tutorials/orders/order-create-quote.md b/src/guides/v2.2/rest/tutorials/orders/order-create-quote.md index dfe346e17ea..35255a225c4 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-create-quote.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-create-quote.md @@ -36,7 +36,10 @@ Magento identifies three types of users that can create a shopping cart: ### Create a cart for a logged-in customer {#create-cart} -All calls for logged in customer must specify customer's token `q0u66k8h42yaevtchv09uyy3y9gaj2ap` in the header. +All calls for a logged in customer must specify customer's token `q0u66k8h42yaevtchv09uyy3y9gaj2ap` in the header. + +{:.bs-callout-info} +Use the `V1/guest-carts` endpoint to create a cart on behalf of a guest. Do not include an authorization token. The `quoteId` for the guest customer quote will be masked. **Endpoint:** @@ -59,9 +62,6 @@ The response is the `quoteId`: `4` {:.bs-callout .bs-callout-tip} Some calls refer to this parameter as the `cartId`. -{:.bs-callout-info} -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. - ### Verify this step {#verify-step} There are no additional verification steps.`quoteId` values are not displayed on the [website](https://glossary.magento.com/website) or in Admin. From 35e27fbab334f3a8e68974250536aa0dfbd607a3 Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Thu, 5 Dec 2019 12:59:56 -0600 Subject: [PATCH 09/10] Update order-prepare-checkout.md --- .../rest/tutorials/orders/order-prepare-checkout.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md b/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md index a4dd069a76a..2fa71c13596 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-prepare-checkout.md @@ -25,6 +25,9 @@ Now that all the items have been added to the cart, we can prepare the order for Magento calculates shipping costs for each shipping method that can be applied to the order. In this tutorial, the `flatrate` ($5 per item) and `tablerate` shipping methods are active. +{:.bs-callout-info} +Use the `V1/guest-carts//estimate-shipping-methods` endpoint to estimate shipping costs on behalf of a guest. Do not include an authorization token. + **Endpoint:** `POST /rest//V1/carts/mine/estimate-shipping-methods` @@ -98,16 +101,15 @@ Note that the cost for the `flatrate` shipping method is $15. The Sprite Yoga Co ``` {% endcollapsible %} -{:.bs-callout-info} -Use the `V1/guest-carts//estimate-shipping-methods` endpoint to estimate shipping costs on behalf of a guest. Do not include an authorization token. - - ### Set shipping and billing information {#set-addresses} In this call, you specify the shipping and billing addresses, as well as the selected `carrier_code` and `method_code`. Since the Table Rate shipping method costs only $5, the customer selected this option. Magento returns a list of payment options and calculates the order totals. +{:.bs-callout-info} +Use the `V1/guest-carts//shipping-information` endpoint to set the billing and shipping information on behalf of a guest. Do not include an authorization token. + **Endpoint:** `POST /rest//V1/carts/mine/shipping-information` @@ -342,9 +344,6 @@ The available payment methods are `banktransfer` and `checkmo`. The customer wil {% endcollapsible %} -{:.bs-callout-info} -Use the `V1/guest-carts//shipping-information` endpoint to set the billing and shipping information on behalf of a guest. Do not include an authorization token. - {:.bs-callout .bs-callout-info} 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. From 212cd925c1e90a26a24000b2e0ac782c94a213c3 Mon Sep 17 00:00:00 2001 From: Kevin Harper Date: Thu, 5 Dec 2019 13:25:28 -0600 Subject: [PATCH 10/10] Update order-add-items.md --- src/guides/v2.2/rest/tutorials/orders/order-add-items.md | 1 - 1 file changed, 1 deletion(-) diff --git a/src/guides/v2.2/rest/tutorials/orders/order-add-items.md b/src/guides/v2.2/rest/tutorials/orders/order-add-items.md index 02295626653..c13529072d1 100644 --- a/src/guides/v2.2/rest/tutorials/orders/order-add-items.md +++ b/src/guides/v2.2/rest/tutorials/orders/order-add-items.md @@ -21,7 +21,6 @@ These calls are performed on behalf of a customer, and the customer's token is s {:.bs-callout-info} Use the `V1/guest-carts//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, except for from quote ID in the payload. - ### Add a simple product to a cart {#add-simple} To add a [simple product](https://glossary.magento.com/simple-product) to a cart, you must provide a `sku`, the quantity, and the [quote](https://glossary.magento.com/quote) ID, which was generated when the cart was created.