docs: added dividers + see also section (#2899)
This commit is contained in:
@@ -16,6 +16,8 @@ You can learn more about enabling it in the [feature flags](../backend/feature-f
|
||||
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
A merchant can request to edit an order to make changes to its items. The change can include removing an item, adding a new item, and changing the quantity of an item in the original order.
|
||||
@@ -44,6 +46,8 @@ You can perform other functionalities related to order editing. To learn more, c
|
||||
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### Medusa Components
|
||||
@@ -62,6 +66,8 @@ If you follow the JS Client code blocks, it’s assumed you already have [Medusa
|
||||
|
||||
You must have an existing order edit in the “request” state.
|
||||
|
||||
---
|
||||
|
||||
## Retrieve an Order Edit
|
||||
|
||||
You can retrieve a single order edit by its ID by sending a request to the [Get Order Edit](/api/store/#tag/OrderEdit/operation/GetOrderEditsOrderEdit) endpoint:
|
||||
@@ -142,6 +148,8 @@ Here’s an example of how you can use this data to show the customer the reques
|
||||
</ul>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Handle Payment
|
||||
|
||||
After viewing the changes in the order edit, the customer can choose to confirm or decline the order edit.
|
||||
@@ -232,6 +240,8 @@ fetch(`<SERVER_URL>/store/payment-collection/${paymentCollectionId}/sessions/${p
|
||||
|
||||
After performing the above steps, you can [complete the Order Edit](#complete-the-order-edit).
|
||||
|
||||
---
|
||||
|
||||
## Complete the Order Edit
|
||||
|
||||
To confirm and complete the order edit, send a request to the [Complete Order Edit](/api/store/#tag/OrderEdit/operation/PostOrderEditsOrderEditComplete) endpoint:
|
||||
@@ -275,6 +285,8 @@ If the payment isn’t authorized first, the order edit completion will fail.
|
||||
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
## Decline an Order Edit
|
||||
|
||||
If the customer wants to decline the Order Edit, you can do that by sending a request to the Decline Order Edit endpoint:
|
||||
@@ -320,7 +332,9 @@ In the request body parameters, you can optionally pass the `decline_reason` par
|
||||
|
||||
If the Order Edit is declined, the changes requested in the Order Edit aren't reflected on the original order and no refund or additional payments are required.
|
||||
|
||||
## What’s Next
|
||||
---
|
||||
|
||||
- Learn [how to edit an order using Admin APIs](../admin/order-edit.mdx)
|
||||
- Learn more about [order edit endpoints in the API reference](/api/store/#tag/OrderEdit)
|
||||
## See Also
|
||||
|
||||
- [Order Edit API reference](/api/store/#tag/OrderEdit)
|
||||
- [Edit an order using Admin APIs](../admin/order-edit.mdx)
|
||||
|
||||
@@ -17,6 +17,8 @@ It’s recommended to go through the [Shipping Architecture Overview](../backend
|
||||
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### Medusa Components
|
||||
@@ -37,6 +39,8 @@ This document assumes you’ve already taken care of the add-to-cart flow. So, y
|
||||
|
||||
You can learn how to implement the cart flow using [this documentation](../../guides/carts-in-medusa.mdx).
|
||||
|
||||
---
|
||||
|
||||
## Shipping Step
|
||||
|
||||
In this step, the customer generally enters their shipping info, then chooses the available shipping option based on the entered info.
|
||||
@@ -106,6 +110,8 @@ This request accepts the ID of the cart as a path parameter and the new shipping
|
||||
|
||||
The request returns the updated cart, with the new shipping address available in `cart.shipping_address`.
|
||||
|
||||
---
|
||||
|
||||
### List Shipping Options
|
||||
|
||||
After updating the cart with the customer’s address, the list of available [shipping options](../backend/shipping/overview.md#shipping-option) for that cart might change. So, you should retrieve the updated list of options.
|
||||
@@ -183,6 +189,8 @@ The request accepts the ID of the cart as a path parameter and its body the ID o
|
||||
|
||||
It returns the updated cart, with the created shipping method available in the array `cart.shipping_methods`.
|
||||
|
||||
---
|
||||
|
||||
## Payment Step
|
||||
|
||||
In this step, the customer generally chooses a payment method to complete their purchase. The implementation of payment providers is done differently for each provider, so this section will just show the general steps you should follow when implementing this step.
|
||||
@@ -366,8 +374,11 @@ The request returns two properties: `type` and `data`. If the order was placed s
|
||||
|
||||
If an error occurred while placing the order, `type` will be `cart` and `data` will be the cart's data.
|
||||
|
||||
## What’s Next
|
||||
---
|
||||
|
||||
- Learn more about the [JS Client and how to use it](../../js-client/overview.md).
|
||||
## See Also
|
||||
|
||||
- [Medusa JS Client Overview](../../js-client/overview.md).
|
||||
- Check out available plugins for popular payment providers such as [Stripe](../../add-plugins/stripe.md) and [PayPal](/add-plugins/paypal.md).
|
||||
- Learn more about the [Payment](../backend/payment/overview.md) and [Shipping](../backend/shipping/overview.md) Architectures.
|
||||
- [Payment Architecture](../backend/payment/overview.md)
|
||||
- [Shipping Architecture](../backend/shipping/overview.md)
|
||||
|
||||
@@ -32,6 +32,8 @@ In this document, you’ll learn how to implement two parts of this flow:
|
||||
1. Allow customers to claim their orders.
|
||||
2. Verify a claim to an order.
|
||||
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### Medusa Components
|
||||
@@ -58,6 +60,8 @@ It is assumed you already have an order placed by a guest customer. You can refe
|
||||
|
||||
In addition, it is assumed you already have a logged-in customer before performing the steps in this document. You can refer to the [API reference](/api/store/#tag/Auth/operation/PostAuth) for more details on that.
|
||||
|
||||
---
|
||||
|
||||
## Request to Claim an Order
|
||||
|
||||
When the customer wants to claim an order, they must supply its ID.
|
||||
@@ -114,6 +118,8 @@ If the customer’s request has been processed successfully, the request returns
|
||||
|
||||
The customer at this point will receive an email with a link to verify their claim on the order.
|
||||
|
||||
---
|
||||
|
||||
## Manually Verify a Claim to an Order
|
||||
|
||||
The link in the email that the customer receives should be a page in your storefront that accepts a `token` query parameter.
|
||||
@@ -164,6 +170,8 @@ This request accepts as a body parameter the string `token`. This would be the t
|
||||
|
||||
If the verification is successful, the order will now be associated with the customer and the customer will be able to see it among their orders.
|
||||
|
||||
---
|
||||
|
||||
## See Also
|
||||
|
||||
- Learn [how to send a confirmation email to claim an order](../ecommerce/handle-order-claim-event.md).
|
||||
- [Send a confirmation email to claim an order](../ecommerce/handle-order-claim-event.md)
|
||||
|
||||
@@ -17,10 +17,12 @@ Customers can use discounts during checkout to benefit from promotions that the
|
||||
|
||||
In this document, you’ll learn how to add a discount to a cart, how to display details related to the discount, and how to remove a discount from a cart.
|
||||
|
||||
## Scenario
|
||||
### Scenario
|
||||
|
||||
You want to implement discount functionality in your store to allow customers to apply discount codes to their cart and remove them from the cart. You also want to display the discount details for the customer.
|
||||
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### Medusa Components
|
||||
@@ -41,6 +43,8 @@ This document assumes you’ve already taken care of the add-to-cart flow. So, y
|
||||
|
||||
You can learn how to implement the cart flow using [this documentation](../../guides/carts-in-medusa.mdx).
|
||||
|
||||
---
|
||||
|
||||
## Add Discount to Cart
|
||||
|
||||
The customer can enter a discount code during the checkout flow to benefit from a promotion.
|
||||
@@ -110,6 +114,8 @@ If the discount is applied successfully, the entire cart object will be returned
|
||||
|
||||
In case the customer enters an invalid discount or the discount cannot be applied to the cart because it doesn’t meet its conditions, the request will return an error. You can handle the error in the `catch` method.
|
||||
|
||||
---
|
||||
|
||||
## Display Discount Details
|
||||
|
||||
After the customer enters a discount code and it is applied to the cart, you can display the discount details to the customer. This shows the customer how much they benefitted from the discount.
|
||||
@@ -201,6 +207,8 @@ The returned `cart` object has the following properties that can be used to disp
|
||||
- The `shipping_total` property is the total shipping amount. If a Free Shipping discount is applied to the cart, `shipping_total` and `discount_total` will be 0.
|
||||
- The `total` property is the total amount of the cart after applying the discount.
|
||||
|
||||
---
|
||||
|
||||
## Remove Discount from Cart
|
||||
|
||||
The customer can choose to remove a discount from their cart.
|
||||
@@ -238,7 +246,9 @@ This request accepts the cart ID and the code of the discount to remove. If the
|
||||
|
||||
The totals of the cart and its items will be updated as well.
|
||||
|
||||
## What’s Next
|
||||
---
|
||||
|
||||
- Learn [how to implement the checkout flow](./how-to-implement-checkout-flow.mdx).
|
||||
- Learn [how to create discounts using the admin APIs](/api/admin/#tag/Discount/operation/PostDiscounts).
|
||||
## See Also
|
||||
|
||||
- [Implement the checkout flow in a storefront](./how-to-implement-checkout-flow.mdx).
|
||||
- [Manage discounts using the admin APIs](../admin/manage-discounts.mdx).
|
||||
|
||||
@@ -169,7 +169,7 @@ This request returns the full object of the updated cart.
|
||||
|
||||
---
|
||||
|
||||
## What’s Next
|
||||
## See Also
|
||||
|
||||
- Learn [how to implement cart functionalities in your storefront](../../guides/carts-in-medusa.mdx)
|
||||
- Learn [how to implement checkout in your storefront](./how-to-implement-checkout-flow.mdx)
|
||||
- [Implement cart functionalities in your storefront](../../guides/carts-in-medusa.mdx)
|
||||
- [Implement checkout in your storefront](./how-to-implement-checkout-flow.mdx)
|
||||
|
||||
@@ -11,6 +11,8 @@ In your storefront, you can filter products by sales channels. You can also asso
|
||||
|
||||
This guide explains how to perform these operations using the Storefront APIs.
|
||||
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
### Medusa Components
|
||||
@@ -25,6 +27,8 @@ This guide includes code snippets to send requests to your Medusa server using M
|
||||
|
||||
If you follow the JS Client code blocks, it’s assumed you already have [Medusa’s JS Client installed](../../js-client/overview.md) and have [created an instance of the client](../../js-client/overview.md#configuration).
|
||||
|
||||
---
|
||||
|
||||
## Filter Products by Sales Channel
|
||||
|
||||
To filter products by a specific sales channel, pass the `sales_channel_id` query parameter to the List Products endpoint:
|
||||
@@ -61,6 +65,8 @@ The `sales_channel_id` query parameter is an array of sales channel IDs. You can
|
||||
|
||||
The request returns an array of products. These are the products that are available in the sales channel.
|
||||
|
||||
---
|
||||
|
||||
## Associate a Cart with a Sales Channel
|
||||
|
||||
### When Creating a Cart
|
||||
@@ -142,7 +148,9 @@ fetch(`<SERVER_URL>/store/carts/${cartId}`, {
|
||||
|
||||
The request returns the updated cart.
|
||||
|
||||
## What’s Next 🚀
|
||||
---
|
||||
|
||||
- Learn how to [Implement the Cart functionality in a storefront](../../guides/carts-in-medusa.mdx).
|
||||
- Learn how to [Implement the Checkout functionality in a storefront](./how-to-implement-checkout-flow.mdx).
|
||||
## See Also
|
||||
|
||||
- [Implement the Cart functionality in a storefront](../../guides/carts-in-medusa.mdx)
|
||||
- [Implement the Checkout functionality in a storefront](./how-to-implement-checkout-flow.mdx)
|
||||
|
||||
Reference in New Issue
Block a user