Return Reasons
Queries listed here are used to send requests to the Store Return Reason API Routes.
Return reasons are key-value pairs that are used to specify why an order return is being created.
Queries
useReturnReasons
This hook retrieves a list of Return Reasons. This is useful when implementing a Create Return flow in the storefront.
Example
import React from "react"
import { useReturnReasons } from "medusa-react"
const ReturnReasons = () => {
const {
return_reasons,
isLoading
} = useReturnReasons()
return (
<div>
{isLoading && <span>Loading...</span>}
{return_reasons?.length && (
<ul>
{return_reasons.map((returnReason) => (
<li key={returnReason.id}>
{returnReason.label}
</li>
))}
</ul>
)}
</div>
)
}
export default ReturnReasons