docs: generate medusa-react reference (#6004)

* add new plugin for better organization

* added handling in theme for mutations and query types

* added tsdoc to hooks

* added tsdocs to utility functions

* added tsdoc to providers

* generated reference

* general fixes for generated reference

* generated api reference specs + general fixes

* add missing import react

* split utilities into different directories

* added overview page

* added link to customer authentication section

* fix lint errors

* added changeset

* fix readme

* fixed build error

* added expand fields + other sections to overview

* updated what's new section

* general refactoring

* remove unnecessary query field

* fix links

* added ignoreApi option
This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-01-05 17:03:38 +02:00
1 parent 6fc6a9de6a
commit 7d650771d1
2811 files changed
+231856 -455063

No files matched your search

@@ -0,0 +1,25 @@
import React from "react"
import { useCreateCart } from "medusa-react"
type Props = {
regionId: string
}
const Cart = ({ regionId }: Props) => {
const createCart = useCreateCart()
const handleCreate = () => {
createCart.mutate({
region_id: regionId
// creates an empty cart
}, {
onSuccess: ({ cart }) => {
console.log(cart.items)
}
})
}
// ...
}
export default Cart
@@ -0,0 +1,28 @@
import React from "react"
import { useGetCart } from "medusa-react"
type Props = {
cartId: string
}
const Cart = ({ cartId }: Props) => {
const { cart, isLoading } = useGetCart(cartId)
return (
<div>
{isLoading && <span>Loading...</span>}
{cart && cart.items.length === 0 && (
<span>Cart is empty</span>
)}
{cart && cart.items.length > 0 && (
<ul>
{cart.items.map((item) => (
<li key={item.id}>{item.title}</li>
))}
</ul>
)}
</div>
)
}
export default Cart
@@ -0,0 +1,26 @@
import React from "react"
import { useUpdateCart } from "medusa-react"
type Props = {
cartId: string
}
const Cart = ({ cartId }: Props) => {
const updateCart = useUpdateCart(cartId)
const handleUpdate = (
email: string
) => {
updateCart.mutate({
email
}, {
onSuccess: ({ cart }) => {
console.log(cart.email)
}
})
}
// ...
}
export default Cart
@@ -0,0 +1,22 @@
import React from "react"
import { useCompleteCart } from "medusa-react"
type Props = {
cartId: string
}
const Cart = ({ cartId }: Props) => {
const completeCart = useCompleteCart(cartId)
const handleComplete = () => {
completeCart.mutate(void 0, {
onSuccess: ({ data, type }) => {
console.log(data.id, type)
}
})
}
// ...
}
export default Cart
@@ -0,0 +1,28 @@
import React from "react"
import { useCreateLineItem } from "medusa-react"
type Props = {
cartId: string
}
const Cart = ({ cartId }: Props) => {
const createLineItem = useCreateLineItem(cartId)
const handleAddItem = (
variantId: string,
quantity: number
) => {
createLineItem.mutate({
variant_id: variantId,
quantity,
}, {
onSuccess: ({ cart }) => {
console.log(cart.items)
}
})
}
// ...
}
export default Cart
@@ -0,0 +1,26 @@
import React from "react"
import { useDeleteLineItem } from "medusa-react"
type Props = {
cartId: string
}
const Cart = ({ cartId }: Props) => {
const deleteLineItem = useDeleteLineItem(cartId)
const handleDeleteItem = (
lineItemId: string
) => {
deleteLineItem.mutate({
lineId: lineItemId,
}, {
onSuccess: ({ cart }) => {
console.log(cart.items)
}
})
}
// ...
}
export default Cart
@@ -0,0 +1,28 @@
import React from "react"
import { useUpdateLineItem } from "medusa-react"
type Props = {
cartId: string
}
const Cart = ({ cartId }: Props) => {
const updateLineItem = useUpdateLineItem(cartId)
const handleUpdateItem = (
lineItemId: string,
quantity: number
) => {
updateLineItem.mutate({
lineId: lineItemId,
quantity,
}, {
onSuccess: ({ cart }) => {
console.log(cart.items)
}
})
}
// ...
}
export default Cart
@@ -0,0 +1,26 @@
import React from "react"
import { useSetPaymentSession } from "medusa-react"
type Props = {
cartId: string
}
const Cart = ({ cartId }: Props) => {
const setPaymentSession = useSetPaymentSession(cartId)
const handleSetPaymentSession = (
providerId: string
) => {
setPaymentSession.mutate({
provider_id: providerId,
}, {
onSuccess: ({ cart }) => {
console.log(cart.payment_session)
}
})
}
// ...
}
export default Cart
@@ -0,0 +1,22 @@
import React from "react"
import { useCreatePaymentSession } from "medusa-react"
type Props = {
cartId: string
}
const Cart = ({ cartId }: Props) => {
const createPaymentSession = useCreatePaymentSession(cartId)
const handleComplete = () => {
createPaymentSession.mutate(void 0, {
onSuccess: ({ cart }) => {
console.log(cart.payment_sessions)
}
})
}
// ...
}
export default Cart
@@ -0,0 +1,26 @@
import React from "react"
import { useDeletePaymentSession } from "medusa-react"
type Props = {
cartId: string
}
const Cart = ({ cartId }: Props) => {
const deletePaymentSession = useDeletePaymentSession(cartId)
const handleDeletePaymentSession = (
providerId: string
) => {
deletePaymentSession.mutate({
provider_id: providerId,
}, {
onSuccess: ({ cart }) => {
console.log(cart.payment_sessions)
}
})
}
// ...
}
export default Cart
@@ -0,0 +1,28 @@
import React from "react"
import { useUpdatePaymentSession } from "medusa-react"
type Props = {
cartId: string
}
const Cart = ({ cartId }: Props) => {
const updatePaymentSession = useUpdatePaymentSession(cartId)
const handleUpdate = (
providerId: string,
data: Record<string, unknown>
) => {
updatePaymentSession.mutate({
provider_id: providerId,
data
}, {
onSuccess: ({ cart }) => {
console.log(cart.payment_session)
}
})
}
// ...
}
export default Cart
@@ -0,0 +1,26 @@
import React from "react"
import { useRefreshPaymentSession } from "medusa-react"
type Props = {
cartId: string
}
const Cart = ({ cartId }: Props) => {
const refreshPaymentSession = useRefreshPaymentSession(cartId)
const handleRefresh = (
providerId: string
) => {
refreshPaymentSession.mutate({
provider_id: providerId,
}, {
onSuccess: ({ cart }) => {
console.log(cart.payment_sessions)
}
})
}
// ...
}
export default Cart
@@ -0,0 +1,26 @@
import React from "react"
import { useAddShippingMethodToCart } from "medusa-react"
type Props = {
cartId: string
}
const Cart = ({ cartId }: Props) => {
const addShippingMethod = useAddShippingMethodToCart(cartId)
const handleAddShippingMethod = (
optionId: string
) => {
addShippingMethod.mutate({
option_id: optionId,
}, {
onSuccess: ({ cart }) => {
console.log(cart.shipping_methods)
}
})
}
// ...
}
export default Cart
@@ -0,0 +1,24 @@
import React from "react"
import { useCollections } from "medusa-react"
const ProductCollections = () => {
const { collections, isLoading } = useCollections()
return (
<div>
{isLoading && <span>Loading...</span>}
{collections && collections.length === 0 && (
<span>No Product Collections</span>
)}
{collections && collections.length > 0 && (
<ul>
{collections.map((collection) => (
<li key={collection.id}>{collection.title}</li>
))}
</ul>
)}
</div>
)
}
export default ProductCollections
@@ -0,0 +1,19 @@
import React from "react"
import { useCollection } from "medusa-react"
type Props = {
collectionId: string
}
const ProductCollection = ({ collectionId }: Props) => {
const { collection, isLoading } = useCollection(collectionId)
return (
<div>
{isLoading && <span>Loading...</span>}
{collection && <span>{collection.title}</span>}
</div>
)
}
export default ProductCollection
@@ -0,0 +1,27 @@
import React from "react"
import { useCreateCustomer } from "medusa-react"
const RegisterCustomer = () => {
const createCustomer = useCreateCustomer()
// ...
const handleCreate = (
customerData: {
first_name: string
last_name: string
email: string
password: string
}
) => {
// ...
createCustomer.mutate(customerData, {
onSuccess: ({ customer }) => {
console.log(customer.id)
}
})
}
// ...
}
export default RegisterCustomer
@@ -0,0 +1,17 @@
import React from "react"
import { useMeCustomer } from "medusa-react"
const Customer = () => {
const { customer, isLoading } = useMeCustomer()
return (
<div>
{isLoading && <span>Loading...</span>}
{customer && (
<span>{customer.first_name} {customer.last_name}</span>
)}
</div>
)
}
export default Customer
@@ -0,0 +1,29 @@
import React from "react"
import { useUpdateMe } from "medusa-react"
type Props = {
customerId: string
}
const Customer = ({ customerId }: Props) => {
const updateCustomer = useUpdateMe()
// ...
const handleUpdate = (
firstName: string
) => {
// ...
updateCustomer.mutate({
id: customerId,
first_name: firstName,
}, {
onSuccess: ({ customer }) => {
console.log(customer.first_name)
}
})
}
// ...
}
export default Customer
@@ -0,0 +1,23 @@
import React from "react"
import { useCustomerOrders } from "medusa-react"
const Orders = () => {
// refetch a function that can be used to
// re-retrieve orders after the customer logs in
const { orders, isLoading } = useCustomerOrders()
return (
<div>
{isLoading && <span>Loading orders...</span>}
{orders?.length && (
<ul>
{orders.map((order) => (
<li key={order.id}>{order.display_id}</li>
))}
</ul>
)}
</div>
)
}
export default Orders
@@ -0,0 +1,22 @@
import React from "react"
import { useGiftCard } from "medusa-react"
type Props = {
giftCardCode: string
}
const GiftCard = ({ giftCardCode }: Props) => {
const { gift_card, isLoading, isError } = useGiftCard(
giftCardCode
)
return (
<div>
{isLoading && <span>Loading...</span>}
{gift_card && <span>{gift_card.value}</span>}
{isError && <span>Gift Card does not exist</span>}
</div>
)
}
export default GiftCard
@@ -0,0 +1,25 @@
import React from "react"
import { useOrderEdit } from "medusa-react"
type Props = {
orderEditId: string
}
const OrderEdit = ({ orderEditId }: Props) => {
const { order_edit, isLoading } = useOrderEdit(orderEditId)
return (
<div>
{isLoading && <span>Loading...</span>}
{order_edit && (
<ul>
{order_edit.changes.map((change) => (
<li key={change.id}>{change.type}</li>
))}
</ul>
)}
</div>
)
}
export default OrderEdit
@@ -0,0 +1,25 @@
import React from "react"
import { useCompleteOrderEdit } from "medusa-react"
type Props = {
orderEditId: string
}
const OrderEdit = ({ orderEditId }: Props) => {
const completeOrderEdit = useCompleteOrderEdit(
orderEditId
)
// ...
const handleCompleteOrderEdit = () => {
completeOrderEdit.mutate(void 0, {
onSuccess: ({ order_edit }) => {
console.log(order_edit.confirmed_at)
}
})
}
// ...
}
export default OrderEdit
@@ -0,0 +1,27 @@
import React from "react"
import { useDeclineOrderEdit } from "medusa-react"
type Props = {
orderEditId: string
}
const OrderEdit = ({ orderEditId }: Props) => {
const declineOrderEdit = useDeclineOrderEdit(orderEditId)
// ...
const handleDeclineOrderEdit = (
declinedReason: string
) => {
declineOrderEdit.mutate({
declined_reason: declinedReason,
}, {
onSuccess: ({ order_edit }) => {
console.log(order_edit.declined_at)
}
})
}
// ...
}
export default OrderEdit
@@ -0,0 +1,30 @@
import React from "react"
import { useOrders } from "medusa-react"
type Props = {
displayId: number
email: string
}
const Order = ({
displayId,
email
}: Props) => {
const {
order,
isLoading,
} = useOrders({
display_id: displayId,
email,
})
return (
<div>
{isLoading && <span>Loading...</span>}
{order && <span>{order.display_id}</span>}
</div>
)
}
export default Order
@@ -0,0 +1,25 @@
import React from "react"
import { useRequestOrderAccess } from "medusa-react"
const ClaimOrder = () => {
const claimOrder = useRequestOrderAccess()
const handleClaimOrder = (
orderIds: string[]
) => {
claimOrder.mutate({
order_ids: orderIds
}, {
onSuccess: () => {
// successful
},
onError: () => {
// an error occurred.
}
})
}
// ...
}
export default ClaimOrder
@@ -0,0 +1,23 @@
import React from "react"
import { useCartOrder } from "medusa-react"
type Props = {
cartId: string
}
const Order = ({ cartId }: Props) => {
const {
order,
isLoading,
} = useCartOrder(cartId)
return (
<div>
{isLoading && <span>Loading...</span>}
{order && <span>{order.display_id}</span>}
</div>
)
}
export default Order
@@ -0,0 +1,25 @@
import React from "react"
import { useGrantOrderAccess } from "medusa-react"
const ClaimOrder = () => {
const confirmOrderRequest = useGrantOrderAccess()
const handleOrderRequestConfirmation = (
token: string
) => {
confirmOrderRequest.mutate({
token
}, {
onSuccess: () => {
// successful
},
onError: () => {
// an error occurred.
}
})
}
// ...
}
export default ClaimOrder
@@ -0,0 +1,23 @@
import React from "react"
import { useOrder } from "medusa-react"
type Props = {
orderId: string
}
const Order = ({ orderId }: Props) => {
const {
order,
isLoading,
} = useOrder(orderId)
return (
<div>
{isLoading && <span>Loading...</span>}
{order && <span>{order.display_id}</span>}
</div>
)
}
export default Order
@@ -0,0 +1,28 @@
import React from "react"
import { usePaymentCollection } from "medusa-react"
type Props = {
paymentCollectionId: string
}
const PaymentCollection = ({
paymentCollectionId
}: Props) => {
const {
payment_collection,
isLoading
} = usePaymentCollection(
paymentCollectionId
)
return (
<div>
{isLoading && <span>Loading...</span>}
{payment_collection && (
<span>{payment_collection.status}</span>
)}
</div>
)
}
export default PaymentCollection
@@ -0,0 +1,30 @@
import React from "react"
import { useManagePaymentSession } from "medusa-react"
type Props = {
paymentCollectionId: string
}
const PaymentCollection = ({
paymentCollectionId
}: Props) => {
const managePaymentSession = useManagePaymentSession(
paymentCollectionId
)
const handleManagePaymentSession = (
providerId: string
) => {
managePaymentSession.mutate({
provider_id: providerId
}, {
onSuccess: ({ payment_collection }) => {
console.log(payment_collection.payment_sessions)
}
})
}
// ...
}
export default PaymentCollection
@@ -0,0 +1,55 @@
import React from "react"
import { useManageMultiplePaymentSessions } from "medusa-react"
type Props = {
paymentCollectionId: string
}
const PaymentCollection = ({
paymentCollectionId
}: Props) => {
const managePaymentSessions = useManageMultiplePaymentSessions(
paymentCollectionId
)
const handleManagePaymentSessions = () => {
// Total amount = 10000
// Example 1: Adding two new sessions
managePaymentSessions.mutate({
sessions: [
{
provider_id: "stripe",
amount: 5000,
},
{
provider_id: "manual",
amount: 5000,
},
]
}, {
onSuccess: ({ payment_collection }) => {
console.log(payment_collection.payment_sessions)
}
})
// Example 2: Updating one session and removing the other
managePaymentSessions.mutate({
sessions: [
{
provider_id: "stripe",
amount: 10000,
session_id: "ps_123456"
},
]
}, {
onSuccess: ({ payment_collection }) => {
console.log(payment_collection.payment_sessions)
}
})
}
// ...
}
export default PaymentCollection
@@ -0,0 +1,29 @@
import React from "react"
import { useAuthorizePaymentSessionsBatch } from "medusa-react"
type Props = {
paymentCollectionId: string
}
const PaymentCollection = ({
paymentCollectionId
}: Props) => {
const authorizePaymentSessions = useAuthorizePaymentSessionsBatch(
paymentCollectionId
)
// ...
const handleAuthorizePayments = (paymentSessionIds: string[]) => {
authorizePaymentSessions.mutate({
session_ids: paymentSessionIds
}, {
onSuccess: ({ payment_collection }) => {
console.log(payment_collection.payment_sessions)
}
})
}
// ...
}
export default PaymentCollection
@@ -0,0 +1,27 @@
import React from "react"
import { usePaymentCollectionRefreshPaymentSession } from "medusa-react"
type Props = {
paymentCollectionId: string
}
const PaymentCollection = ({
paymentCollectionId
}: Props) => {
const refreshPaymentSession = usePaymentCollectionRefreshPaymentSession(
paymentCollectionId
)
// ...
const handleRefreshPaymentSession = (paymentSessionId: string) => {
refreshPaymentSession.mutate(paymentSessionId, {
onSuccess: ({ payment_session }) => {
console.log(payment_session.status)
}
})
}
// ...
}
export default PaymentCollection
@@ -0,0 +1,27 @@
import React from "react"
import { useAuthorizePaymentSession } from "medusa-react"
type Props = {
paymentCollectionId: string
}
const PaymentCollection = ({
paymentCollectionId
}: Props) => {
const authorizePaymentSession = useAuthorizePaymentSession(
paymentCollectionId
)
// ...
const handleAuthorizePayment = (paymentSessionId: string) => {
authorizePaymentSession.mutate(paymentSessionId, {
onSuccess: ({ payment_collection }) => {
console.log(payment_collection.payment_sessions)
}
})
}
// ...
}
export default PaymentCollection
@@ -0,0 +1,29 @@
import React from "react"
import { useProductCategories } from "medusa-react"
function Categories() {
const {
product_categories,
isLoading,
} = useProductCategories()
return (
<div>
{isLoading && <span>Loading...</span>}
{product_categories && !product_categories.length && (
<span>No Categories</span>
)}
{product_categories && product_categories.length > 0 && (
<ul>
{product_categories.map(
(category) => (
<li key={category.id}>{category.name}</li>
)
)}
</ul>
)}
</div>
)
}
export default Categories
@@ -0,0 +1,21 @@
import React from "react"
import { useProductCategory } from "medusa-react"
type Props = {
categoryId: string
}
const Category = ({ categoryId }: Props) => {
const { product_category, isLoading } = useProductCategory(
categoryId
)
return (
<div>
{isLoading && <span>Loading...</span>}
{product_category && <span>{product_category.name}</span>}
</div>
)
}
export default Category
@@ -0,0 +1,29 @@
import React from "react"
import { useProductTags } from "medusa-react"
function Tags() {
const {
product_tags,
isLoading,
} = useProductTags()
return (
<div>
{isLoading && <span>Loading...</span>}
{product_tags && !product_tags.length && (
<span>No Product Tags</span>
)}
{product_tags && product_tags.length > 0 && (
<ul>
{product_tags.map(
(tag) => (
<li key={tag.id}>{tag.value}</li>
)
)}
</ul>
)}
</div>
)
}
export default Tags
@@ -0,0 +1,29 @@
import React from "react"
import { useProductTypes } from "medusa-react"
function Types() {
const {
product_types,
isLoading,
} = useProductTypes()
return (
<div>
{isLoading && <span>Loading...</span>}
{product_types && !product_types.length && (
<span>No Product Types</span>
)}
{product_types && product_types.length > 0 && (
<ul>
{product_types.map(
(type) => (
<li key={type.id}>{type.value}</li>
)
)}
</ul>
)}
</div>
)
}
export default Types
@@ -0,0 +1,22 @@
import React from "react"
import { useProducts } from "medusa-react"
function Product () {
const { products, isLoading } = useProducts()
return (
<div>
{isLoading && <span>Loading...</span>}
{products && !products.length && <span>No Products</span>}
{products && products.length > 0 && (
<ul>
{products.map((product) => (
<li key={product.id}>{product.title}</li>
))}
</ul>
)}
</div>
)
}
export default Products
@@ -0,0 +1,19 @@
import React from "react"
import { useProduct } from "medusa-react"
type Props = {
productId: string
}
const Product = ({ productId }: Props) => {
const { product, isLoading } = useProduct(productId)
return (
<div>
{isLoading && <span>Loading...</span>}
{product && <span>{product.title}</span>}
</div>
)
}
export default Product
@@ -0,0 +1,23 @@
import React from "react"
import { useRegions } from "medusa-react"
const Regions = () => {
const { regions, isLoading } = useRegions()
return (
<div>
{isLoading && <span>Loading...</span>}
{regions?.length && (
<ul>
{regions.map((region) => (
<li key={region.id}>
{region.name}
</li>
))}
</ul>
)}
</div>
)
}
export default Regions
@@ -0,0 +1,21 @@
import React from "react"
import { useRegion } from "medusa-react"
type Props = {
regionId: string
}
const Region = ({ regionId }: Props) => {
const { region, isLoading } = useRegion(
regionId
)
return (
<div>
{isLoading && <span>Loading...</span>}
{region && <span>{region.name}</span>}
</div>
)
}
export default Region
@@ -0,0 +1,26 @@
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
@@ -0,0 +1,24 @@
import React from "react"
import { useReturnReason } from "medusa-react"
type Props = {
returnReasonId: string
}
const ReturnReason = ({ returnReasonId }: Props) => {
const {
return_reason,
isLoading
} = useReturnReason(
returnReasonId
)
return (
<div>
{isLoading && <span>Loading...</span>}
{return_reason && <span>{return_reason.label}</span>}
</div>
)
}
export default ReturnReason
@@ -0,0 +1,36 @@
import React from "react"
import { useCreateReturn } from "medusa-react"
type CreateReturnData = {
items: {
item_id: string,
quantity: number
}[]
return_shipping: {
option_id: string
}
}
type Props = {
orderId: string
}
const CreateReturn = ({ orderId }: Props) => {
const createReturn = useCreateReturn()
// ...
const handleCreate = (data: CreateReturnData) => {
createReturn.mutate({
...data,
order_id: orderId
}, {
onSuccess: ({ return: returnData }) => {
console.log(returnData.id)
}
})
}
// ...
}
export default CreateReturn
@@ -0,0 +1,27 @@
import React from "react"
import { useShippingOptions } from "medusa-react"
const ShippingOptions = () => {
const {
shipping_options,
isLoading,
} = useShippingOptions()
return (
<div>
{isLoading && <span>Loading...</span>}
{shipping_options?.length &&
shipping_options?.length > 0 && (
<ul>
{shipping_options?.map((shipping_option) => (
<li key={shipping_option.id}>
{shipping_option.id}
</li>
))}
</ul>
)}
</div>
)
}
export default ShippingOptions
@@ -0,0 +1,33 @@
import React from "react"
import { useCartShippingOptions } from "medusa-react"
type Props = {
cartId: string
}
const ShippingOptions = ({ cartId }: Props) => {
const { shipping_options, isLoading } =
useCartShippingOptions(cartId)
return (
<div>
{isLoading && <span>Loading...</span>}
{shipping_options && !shipping_options.length && (
<span>No shipping options</span>
)}
{shipping_options && (
<ul>
{shipping_options.map(
(shipping_option) => (
<li key={shipping_option.id}>
{shipping_option.name}
</li>
)
)}
</ul>
)}
</div>
)
}
export default ShippingOptions
@@ -0,0 +1,42 @@
import React from "react"
import { useCreateSwap } from "medusa-react"
type Props = {
orderId: string
}
type CreateData = {
return_items: {
item_id: string
quantity: number
}[]
additional_items: {
variant_id: string
quantity: number
}[]
return_shipping_option: string
}
const CreateSwap = ({
orderId
}: Props) => {
const createSwap = useCreateSwap()
// ...
const handleCreate = (
data: CreateData
) => {
createSwap.mutate({
...data,
order_id: orderId
}, {
onSuccess: ({ swap }) => {
console.log(swap.id)
}
})
}
// ...
}
export default CreateSwap
@@ -0,0 +1,22 @@
import React from "react"
import { useCartSwap } from "medusa-react"
type Props = {
cartId: string
}
const Swap = ({ cartId }: Props) => {
const {
swap,
isLoading,
} = useCartSwap(cartId)
return (
<div>
{isLoading && <span>Loading...</span>}
{swap && <span>{swap.id}</span>}
</div>
)
}
export default Swap
@@ -1,4 +1,5 @@
type: object
description: The details of the payment session to manage.
required:
- provider_id
properties:
@@ -1,4 +1,5 @@
type: object
description: The details of the payment session.
required:
- payment_session
properties:
@@ -1,4 +1,5 @@
type: object
description: The details to update of the line item.
required:
- quantity
properties:
@@ -1,4 +1,5 @@
type: object
description: The details of the line item to create.
required:
- variant_id
- quantity
@@ -1,4 +1,5 @@
type: object
description: The details of the payment session to set.
required:
- provider_id
properties:
@@ -1,4 +1,5 @@
type: object
description: The details to update of the cart.
properties:
region_id:
type: string
@@ -1,4 +1,5 @@
type: object
description: The details of the shipping method to add to the cart.
required:
- option_id
properties:
@@ -1,4 +1,5 @@
type: object
description: The details necessary to grant order access.
required:
- token
properties:
@@ -1,4 +1,5 @@
type: object
description: The details of the orders to claim.
required:
- order_ids
properties:
@@ -1,4 +1,5 @@
type: object
description: The details to update of the customer.
properties:
first_name:
description: The customer's first name.
@@ -1,4 +1,5 @@
type: object
description: The details of the customer to create.
required:
- first_name
- last_name
@@ -1,4 +1,5 @@
type: object
description: The details of the order edit's decline.
properties:
declined_reason:
type: string
@@ -1,4 +1,5 @@
type: object
description: The details of the payment sessions to authorize.
required:
- session_ids
properties:
@@ -1,4 +1,5 @@
type: object
description: The details of the payment sessions to manage.
required:
- sessions
properties:
@@ -1,4 +1,5 @@
type: object
description: The details of the return to create.
required:
- order_id
- items
@@ -1,4 +1,5 @@
type: object
description: The details of the swap to create.
required:
- order_id
- return_items
File diff suppressed because it is too large. Load diff
@@ -24,6 +24,10 @@ post:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts/postundefined
- lang: Shell
label: cURL
source:
@@ -16,6 +16,10 @@ get:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts_{id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts_{id}/getundefined
- lang: Shell
label: cURL
source:
@@ -65,6 +69,10 @@ post:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts_{id}/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts_{id}/postundefined
- lang: Shell
label: cURL
source:
@@ -34,6 +34,10 @@ post:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts_{id}_complete/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts_{id}_complete/postundefined
- lang: Shell
label: cURL
source:
@@ -21,6 +21,10 @@ post:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts_{id}_line-items/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts_{id}_line-items/postundefined
- lang: Shell
label: cURL
source:
@@ -28,6 +28,11 @@ post:
source:
$ref: >-
../code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/post.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_carts_{id}_line-items_{line_id}/postundefined
- lang: Shell
label: cURL
source:
@@ -78,6 +83,11 @@ delete:
source:
$ref: >-
../code_samples/JavaScript/store_carts_{id}_line-items_{line_id}/delete.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_carts_{id}_line-items_{line_id}/deleteundefined
- lang: Shell
label: cURL
source:
@@ -24,6 +24,10 @@ post:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts_{id}_payment-session/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts_{id}_payment-session/postundefined
- lang: Shell
label: cURL
source:
@@ -20,6 +20,10 @@ post:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts_{id}_payment-sessions/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts_{id}_payment-sessions/postundefined
- lang: Shell
label: cURL
source:
@@ -31,6 +31,11 @@ post:
source:
$ref: >-
../code_samples/JavaScript/store_carts_{id}_payment-sessions_{provider_id}/post.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_carts_{id}_payment-sessions_{provider_id}/postundefined
- lang: Shell
label: cURL
source:
@@ -84,6 +89,11 @@ delete:
source:
$ref: >-
../code_samples/JavaScript/store_carts_{id}_payment-sessions_{provider_id}/delete.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_carts_{id}_payment-sessions_{provider_id}/deleteundefined
- lang: Shell
label: cURL
source:
@@ -27,6 +27,11 @@ post:
source:
$ref: >-
../code_samples/JavaScript/store_carts_{id}_payment-sessions_{provider_id}_refresh/post.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_carts_{id}_payment-sessions_{provider_id}_refresh/postundefined
- lang: Shell
label: cURL
source:
@@ -23,6 +23,10 @@ post:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_carts_{id}_shipping-methods/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_carts_{id}_shipping-methods/postundefined
- lang: Shell
label: cURL
source:
@@ -81,6 +81,10 @@ get:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_collections/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_collections/getundefined
- lang: Shell
label: cURL
source:
@@ -16,6 +16,10 @@ get:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_collections_{id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_collections_{id}/getundefined
- lang: Shell
label: cURL
source:
@@ -19,6 +19,10 @@ post:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_customers/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_customers/postundefined
- lang: Shell
label: cURL
source:
@@ -10,6 +10,10 @@ get:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_customers_me/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_customers_me/getundefined
- lang: Shell
label: cURL
source:
@@ -55,6 +59,10 @@ post:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_customers_me/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_customers_me/postundefined
- lang: Shell
label: cURL
source:
@@ -204,6 +204,10 @@ get:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_customers_me_orders/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_customers_me_orders/getundefined
- lang: Shell
label: cURL
source:
@@ -16,6 +16,10 @@ get:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_gift-cards_{code}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_gift-cards_{code}/getundefined
- lang: Shell
label: cURL
source:
@@ -16,6 +16,10 @@ get:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_order-edits_{id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_order-edits_{id}/getundefined
- lang: Shell
label: cURL
source:
@@ -22,6 +22,10 @@ post:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_order-edits_{id}_complete/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_order-edits_{id}_complete/postundefined
- lang: Shell
label: cURL
source:
@@ -21,6 +21,10 @@ post:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_order-edits_{id}_decline/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_order-edits_{id}_decline/postundefined
- lang: Shell
label: cURL
source:
@@ -49,6 +49,10 @@ get:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_orders/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_orders/getundefined
- lang: Shell
label: cURL
source:
@@ -25,6 +25,10 @@ post:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_orders_batch_customer_token/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_orders_batch_customer_token/postundefined
- lang: Shell
label: cURL
source:
@@ -18,6 +18,10 @@ get:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_orders_cart_{cart_id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_orders_cart_{cart_id}/getundefined
- lang: Shell
label: cURL
source:
@@ -19,6 +19,10 @@ post:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_orders_customer_confirm/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_orders_customer_confirm/postundefined
- lang: Shell
label: cURL
source:
@@ -26,6 +26,10 @@ get:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_orders_{id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_orders_{id}/getundefined
- lang: Shell
label: cURL
source:
@@ -32,6 +32,10 @@ get:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_payment-collections_{id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_payment-collections_{id}/getundefined
- lang: Shell
label: cURL
source:
@@ -23,6 +23,11 @@ post:
source:
$ref: >-
../code_samples/JavaScript/store_payment-collections_{id}_sessions/post.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_payment-collections_{id}_sessions/postundefined
- lang: Shell
label: cURL
source:
@@ -27,6 +27,11 @@ post:
source:
$ref: >-
../code_samples/JavaScript/store_payment-collections_{id}_sessions_batch/post.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_payment-collections_{id}_sessions_batch/postundefined
- lang: Shell
label: cURL
source:
@@ -24,6 +24,11 @@ post:
source:
$ref: >-
../code_samples/JavaScript/store_payment-collections_{id}_sessions_batch_authorize/post.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_payment-collections_{id}_sessions_batch_authorize/postundefined
- lang: Shell
label: cURL
source:
@@ -26,6 +26,11 @@ post:
source:
$ref: >-
../code_samples/JavaScript/store_payment-collections_{id}_sessions_{session_id}/post.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_payment-collections_{id}_sessions_{session_id}/postundefined
- lang: Shell
label: cURL
source:
@@ -24,6 +24,11 @@ post:
source:
$ref: >-
../code_samples/JavaScript/store_payment-collections_{id}_sessions_{session_id}_authorize/post.js
- lang: tsx
label: Medusa React
source:
$ref: >-
../code_samples/tsx/store_payment-collections_{id}_sessions_{session_id}_authorize/postundefined
- lang: Shell
label: cURL
source:
@@ -70,6 +70,10 @@ get:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_product-categories/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_product-categories/getundefined
- lang: Shell
label: cURL
source:
@@ -32,6 +32,10 @@ get:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_product-categories_{id}/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_product-categories_{id}/getundefined
- lang: Shell
label: cURL
source:
@@ -105,6 +105,10 @@ get:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_product-tags/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_product-tags/getundefined
- lang: Shell
label: cURL
source:
@@ -106,6 +106,10 @@ get:
label: JS Client
source:
$ref: ../code_samples/JavaScript/store_product-types/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/store_product-types/getundefined
- lang: Shell
label: cURL
source:
Loaded 100 of 2811 files, more files were not shown because too many files have changed in this diff. Show more