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

Conversation

Sairam9519
Copy link
Contributor

@Sairam9519 Sairam9519 commented Nov 29, 2019

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.

@magento-engcom-team
Copy link

@Sairam9519 thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

@devops-devdocs
Copy link
Collaborator

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, adjust

Suggested change
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.

Copy link
Contributor Author

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, adjust

Suggested change
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.

Copy link
Contributor Author

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.
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor Author

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adjust

Suggested change
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)

Copy link
Contributor Author

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}
Copy link
Contributor

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).

Copy link
Contributor Author

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>`
Copy link
Contributor

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.

Copy link
Contributor Author

@Sairam9519 Sairam9519 Dec 1, 2019

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@rogyar rogyar added 2.2.x 2.3.x Magento 2.3 related changes Technical Updates to the code or processes that alter the technical content of the doc Major Update Significant original updates to existing content Progress: changes requested and removed Progress: changes requested labels Nov 30, 2019
@keharper keharper assigned keharper and unassigned rogyar Nov 30, 2019
Copy link
Contributor Author

@Sairam9519 Sairam9519 left a 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.

@rogyar
Copy link
Contributor

rogyar commented Dec 1, 2019

From a technical perspective, this PR is correct.

@Sairam9519
Copy link
Contributor Author

Is there a way to add label Partner:ziffity to this pull request, please let me know.

@keharper
Copy link
Contributor

keharper commented Dec 3, 2019

@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:

{:.bs-callout-info}
Use the `V1/path/to/endpoint` endpoint to perform this task on behalf of a guest. Do not include an authorization token.

Depending on context, it might be better to state the task rather than say "perform this task".

@Sairam9519
Copy link
Contributor Author

@keharper refactored the docs as per your suggestion, please check.

@keharper
Copy link
Contributor

keharper commented Dec 5, 2019

running tests

@keharper
Copy link
Contributor

keharper commented Dec 5, 2019

running tests

@keharper
Copy link
Contributor

keharper commented Dec 5, 2019

Thanks @Sairam9519

@keharper keharper merged commit ec88d21 into magento:master Dec 5, 2019
@ghost
Copy link

ghost commented Dec 5, 2019

Hi @Sairam9519, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@keharper keharper removed the Technical Updates to the code or processes that alter the technical content of the doc label Dec 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
2.2.x 2.3.x Magento 2.3 related changes Major Update Significant original updates to existing content Partner: Ziffity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants