-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Order creation API endpoints updated for guest users #6086
Conversation
@Sairam9519 thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository. |
An admin must run tests on this PR before it can be merged. |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, adjust
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as per your suggestion
|
||
{% endcollapsible %} | ||
|
||
This calls are performed on behalf of a guest-customer, and there is no need of token. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, adjust
This calls are performed on behalf of a guest-customer, and there is no need of token. | |
These calls are performed on behalf of a guest-customer, and there is no need for a token. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as per your comments
|
||
`POST <host>/rest/<store_code>/guest-carts/<cartId>/items` | ||
|
||
Cart Id is the quoteId recieved on quote creation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could I kindly ask you to make the [quote creation] as a link to the corresponding topic? Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as per your comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as per your comments
} | ||
``` | ||
|
||
Note: The payload and response is same for all products apart from quote id in the payload (Need to give the masked ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please adjust
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 are the same for all products apart from quote id in the payload (Need to give the masked ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as per your comments
|
||
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} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe we need to clarify here that we are talking about a guest user. Otherwise, we have two identical topics (and identical anchors, this point needs to be adjusted as well).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as per your comments
|
||
`Content-Type` `application/json` | ||
|
||
`Authorization` `Bearer <customer token>` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need token for a guest user? I believe the masked quote ID should do the trick, but I might be wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes no need of token I'll update the changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been updated the docs as per your suggestion, please check.
From a technical perspective, this PR is correct. |
Is there a way to add label Partner:ziffity to this pull request, please let me know. |
@Sairam9519 When I wrote that tutorial, I didn't mean for it to be all things for all people. It was meant to show the use case of a logged-in customer adding several items to their cart and completing the purchase. The tutorial then shows the backend processes needed to fulfill the order. I chose to show the sequence of a customer because it's more complex than a guest user. I don't want to add the complexity of two different workflows in the same tutorial, so I'm going to ask you to scale back your changes. I recognize that it's helpful to provide the endpoint to perform a task on behalf of a guest, so instead of creating parallel sections, add a note similar to the following for each task:
Depending on context, it might be better to state the task rather than say "perform this task". |
177d33e
to
593c2b8
Compare
@keharper refactored the docs as per your suggestion, please check. |
running tests |
running tests |
Thanks @Sairam9519 |
Hi @Sairam9519, thank you for your contribution! |
Purpose of this pull request
Order creation endpoints are only provided for the logged in customer and there is no endpoints specified for the guest customer. I have added the endpoints for guest customer.
Affected DevDocs pages
https://devdocs.magento.com/guides/v2.3/rest/tutorials/orders/order-create-quote.html
https://devdocs.magento.com/guides/v2.3/rest/tutorials/orders/order-add-items.html
https://devdocs.magento.com/guides/v2.3/rest/tutorials/orders/order-prepare-checkout.html
https://devdocs.magento.com/guides/v2.3/rest/tutorials/orders/order-create-order.html
whatsnew
Updated information about guest REST endpoints in several steps in the Order Processing Tutorial.