- )
-}
-
-export default Card
-```
-
-
-
----
-
-## Step 1: Customize Medusa Backend
-
-:::note
-
-If you’re not interested in learning about backend customizations, you can skip to [step 2](#step-2-create-onboarding-widget).
-
-:::
-
-In this step, you’ll customize the Medusa backend to:
-
-1. Add a new table in the database that stores the current onboarding step. This requires creating a new entity, repository, and migration.
-2. Add new API Routes that allow retrieving and updating the current onboarding step. This also requires creating a new service.
-
-### Create Entity
-
-An [entity](../development/entities/overview.mdx) represents a table in the database. It’s based on Typeorm, so it requires creating a repository and a migration to be used in the backend.
-
-To create the entity, create the file `src/models/onboarding.ts` with the following content:
-
-```ts title=src/models/onboarding.ts
-import { BaseEntity } from "@medusajs/medusa"
-import { Column, Entity } from "typeorm"
-
-@Entity()
-export class OnboardingState extends BaseEntity {
- @Column()
- current_step: string
-
- @Column()
- is_complete: boolean
-
- @Column()
- product_id: string
-}
-```
-
-Then, create the file `src/repositories/onboarding.ts` that holds the repository of the entity with the following content:
-
-```ts title=src/repositories/onboarding.ts
-import {
- dataSource,
-} from "@medusajs/medusa/dist/loaders/database"
-import { OnboardingState } from "../models/onboarding"
-
-const OnboardingRepository = dataSource.getRepository(
- OnboardingState
-)
-
-export default OnboardingRepository
-```
-
-You can learn more about entities and repositories in [this documentation](../development/entities/overview.mdx).
-
-### Create Migration
-
-A [migration](../development/entities/migrations/overview.mdx) is used to reflect database changes in your database schema.
-
-To create a migration, run the following command in the root of your Medusa backend:
-
-```bash
-npx typeorm migration:create src/migrations/CreateOnboarding
-```
-
-This will create a file in the `src/migrations` directory with the name formatted as `-CreateOnboarding.ts`.
-
-In that file, import the `generateEntityId` utility method at the top of the file:
-
-```ts
-import { generateEntityId } from "@medusajs/utils"
-```
-
-Then, replace the `up` and `down` methods in the migration class with the following content:
-
-
-
-```ts
-export class CreateOnboarding1685715079776 implements MigrationInterface {
- public async up(queryRunner: QueryRunner): Promise {
- await queryRunner.query(
- `CREATE TABLE "onboarding_state" ("id" character varying NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "current_step" character varying NULL, "is_complete" boolean, "product_id" character varying NULL)`
- )
-
- await queryRunner.query(
- `INSERT INTO "onboarding_state" ("id", "current_step", "is_complete") VALUES ('${generateEntityId(
- "",
- "onboarding"
- )}' , NULL, false)`
- )
- }
-
- public async down(queryRunner: QueryRunner): Promise {
- await queryRunner.query(`DROP TABLE "onboarding_state"`)
- }
-}
-```
-
-:::warning
-
-Don’t copy the name of the class in the code snippet above. Keep the name you have in the file.
-
-:::
-
-Finally, to reflect the migration in the database, run the `build` and `migration` commands:
-
-```bash npm2yarn
-npm run build
-npx medusa migrations run
-```
-
-You can learn more about migrations in [this guide](../development/entities/migrations/overview.mdx).
-
-### Create Service
-
-A [service](../development/services/overview.mdx) is a class that holds helper methods related to an entity. For example, methods to create or retrieve a record of that entity. Services are used by other resources, such as API Routes, to perform functionalities related to an entity.
-
-So, before you add the API Routes that allow retrieving and updating the onboarding state, you need to add the service that implements these helper functionalities.
-
-Start by creating the file `src/types/onboarding.ts` with the following content:
-
-
-
-```ts title=src/types/onboarding.ts
-import { OnboardingState } from "../models/onboarding"
-
-export type UpdateOnboardingStateInput = {
- current_step?: string;
- is_complete?: boolean;
- product_id?: string;
-};
-
-export interface AdminOnboardingUpdateStateReq {}
-
-export type OnboardingStateRes = {
- status: OnboardingState;
-};
-```
-
-This file holds the necessary types that will be used within the service you’ll create, and later in your onboarding flow widget.
-
-Then, create the file `src/services/onboarding.ts` with the following content:
-
-
-
-```ts title=src/services/onboarding.ts
-import { TransactionBaseService } from "@medusajs/medusa"
-import OnboardingRepository from "../repositories/onboarding"
-import { OnboardingState } from "../models/onboarding"
-import { EntityManager, IsNull, Not } from "typeorm"
-import { UpdateOnboardingStateInput } from "../types/onboarding"
-
-type InjectedDependencies = {
- manager: EntityManager;
- onboardingRepository: typeof OnboardingRepository;
-};
-
-class OnboardingService extends TransactionBaseService {
- protected onboardingRepository_: typeof OnboardingRepository
-
- constructor({ onboardingRepository }: InjectedDependencies) {
- super(arguments[0])
-
- this.onboardingRepository_ = onboardingRepository
- }
-
- async retrieve(): Promise {
- const onboardingRepo = this.activeManager_.withRepository(
- this.onboardingRepository_
- )
-
- const status = await onboardingRepo.findOne({
- where: { id: Not(IsNull()) },
- })
-
- return status
- }
-
- async update(
- data: UpdateOnboardingStateInput
- ): Promise {
- return await this.atomicPhase_(
- async (transactionManager: EntityManager) => {
- const onboardingRepository =
- transactionManager.withRepository(
- this.onboardingRepository_
- )
-
- const status = await this.retrieve()
-
- for (const [key, value] of Object.entries(data)) {
- status[key] = value
- }
-
- return await onboardingRepository.save(status)
- }
- )
- }
-}
-
-export default OnboardingService
-```
-
-This service class implements two methods `retrieve` to retrieve the current onboarding state, and `update` to update the current onboarding state.
-
-You can learn more about services in [this documentation](../development/services/overview.mdx).
-
-### Create API Routes
-
-The last part of this step is to create the [API Routes](../development/api-routes/overview) that you’ll consume in the admin widget. There will be two API Routes: Get Onboarding State and Update Onboarding State.
-
-To add these API Routes, create the file `src/api/admin/onboarding/route.ts` with the following content:
-
-```ts title=src/api/admin/onboarding/route.ts
-import type {
- MedusaRequest,
- MedusaResponse,
-} from "@medusajs/medusa"
-import { EntityManager } from "typeorm"
-
-import OnboardingService from "../../../services/onboarding"
-
-export async function GET(
- req: MedusaRequest,
- res: MedusaResponse
-) {
- const onboardingService: OnboardingService =
- req.scope.resolve("onboardingService")
-
- const status = await onboardingService.retrieve()
-
- res.status(200).json({ status })
-}
-
-export async function POST(
- req: MedusaRequest,
- res: MedusaResponse
-) {
- const onboardingService: OnboardingService =
- req.scope.resolve("onboardingService")
- const manager: EntityManager = req.scope.resolve("manager")
-
- const status = await manager.transaction(
- async (transactionManager) => {
- return await onboardingService
- .withTransaction(transactionManager)
- .update(req.body)
- }
- )
-
- res.status(200).json({ status })
-}
-```
-
-Notice how these API Routes use the `OnboardingService`'s `retrieve` and `update` methods to retrieve and update the current onboarding state. They resolve the `OnboardingService` using the [Dependency Container](../development/fundamentals/dependency-injection.md).
-
-You can learn more about API Routes in [this documentation](../development/api-routes/overview.mdx).
-
----
-
-## Step 2: Create Onboarding Widget
-
-In this step, you’ll create the onboarding widget with a general implementation. Some implementation details will be added later in the tutorial.
-
-Create the file `src/admin/widgets/onboarding-flow/onboarding-flow.tsx` with the following content:
-
-
-
-
-```tsx title=src/admin/widgets/onboarding-flow/onboarding-flow.tsx
-import { OrderDetailsWidgetProps, ProductDetailsWidgetProps, WidgetConfig, WidgetProps } from "@medusajs/admin"
-import { useAdminCustomPost, useAdminCustomQuery, useMedusa } from "medusa-react"
-import React, { useEffect, useState, useMemo, useCallback } from "react"
-import { useNavigate, useSearchParams, useLocation } from "react-router-dom"
-import { OnboardingState } from "../../../models/onboarding"
-import {
- AdminOnboardingUpdateStateReq,
- OnboardingStateRes,
- UpdateOnboardingStateInput,
-} from "../../../types/onboarding"
-import OrderDetailDefault from "../../components/onboarding-flow/default/orders/order-detail"
-import OrdersListDefault from "../../components/onboarding-flow/default/orders/orders-list"
-import ProductDetailDefault from "../../components/onboarding-flow/default/products/product-detail"
-import ProductsListDefault from "../../components/onboarding-flow/default/products/products-list"
-import { Button, Container, Heading, Text, clx } from "@medusajs/ui"
-import Accordion from "../../components/shared/accordion"
-import GetStarted from "../../components/shared/icons/get-started"
-import { Order, Product } from "@medusajs/medusa"
-import ProductsListNextjs from "../../components/onboarding-flow/nextjs/products/products-list"
-import ProductDetailNextjs from "../../components/onboarding-flow/nextjs/products/product-detail"
-import OrdersListNextjs from "../../components/onboarding-flow/nextjs/orders/orders-list"
-import OrderDetailNextjs from "../../components/onboarding-flow/nextjs/orders/order-detail"
-
-type STEP_ID =
- | "create_product"
- | "preview_product"
- | "create_order"
- | "setup_finished"
- | "create_product_nextjs"
- | "preview_product_nextjs"
- | "create_order_nextjs"
- | "setup_finished_nextjs"
-
-type OnboardingWidgetProps = WidgetProps | ProductDetailsWidgetProps | OrderDetailsWidgetProps
-
-export type StepContentProps = OnboardingWidgetProps & {
- onNext?: Function;
- isComplete?: boolean;
- data?: OnboardingState;
-};
-
-type Step = {
- id: STEP_ID;
- title: string;
- component: React.FC;
- onNext?: Function;
-};
-
-const QUERY_KEY = ["onboarding_state"]
-
-const OnboardingFlow = (props: OnboardingWidgetProps) => {
- // create custom hooks for custom API Routes
- const { data, isLoading } = useAdminCustomQuery<
- undefined,
- OnboardingStateRes
- >("/onboarding", QUERY_KEY)
- const { mutate } = useAdminCustomPost<
- AdminOnboardingUpdateStateReq,
- OnboardingStateRes
- >("/onboarding", QUERY_KEY)
-
- const navigate = useNavigate()
- const location = useLocation()
- // will be used if onboarding step
- // is passed as a path parameter
- const { client } = useMedusa()
-
- // get current step from custom API Route
- const currentStep: STEP_ID | undefined = useMemo(() => {
- return data?.status
- ?.current_step as STEP_ID
- }, [data])
-
- // initialize some state
- const [openStep, setOpenStep] = useState(currentStep)
- const [completed, setCompleted] = useState(false)
-
- // this method is used to move from one step to the next
- const setStepComplete = ({
- step_id,
- extraData,
- onComplete,
- }: {
- step_id: STEP_ID;
- extraData?: UpdateOnboardingStateInput;
- onComplete?: () => void;
- }) => {
- const next = steps[findStepIndex(step_id) + 1]
- mutate({ current_step: next.id, ...extraData }, {
- onSuccess: onComplete,
- })
- }
-
- // this is useful if you want to change the current step
- // using a path parameter. It can only be changed if the passed
- // step in the path parameter is the next step.
- const [ searchParams ] = useSearchParams()
-
- // the steps are set based on the
- // onboarding type
- const steps: Step[] = useMemo(() => {
- {
- switch(process.env.MEDUSA_ADMIN_ONBOARDING_TYPE) {
- case "nextjs":
- return [
- {
- id: "create_product_nextjs",
- title: "Create Products",
- component: ProductsListNextjs,
- onNext: (product: Product) => {
- setStepComplete({
- step_id: "create_product_nextjs",
- extraData: { product_id: product.id },
- onComplete: () => {
- if (!location.pathname.startsWith(`/a/products/${product.id}`)) {
- navigate(`/a/products/${product.id}`)
- }
- },
- })
- },
- },
- {
- id: "preview_product_nextjs",
- title: "Preview Product in your Next.js Storefront",
- component: ProductDetailNextjs,
- onNext: () => {
- setStepComplete({
- step_id: "preview_product_nextjs",
- onComplete: () => navigate(`/a/orders`),
- })
- },
- },
- {
- id: "create_order_nextjs",
- title: "Create an Order using your Next.js Storefront",
- component: OrdersListNextjs,
- onNext: (order: Order) => {
- setStepComplete({
- step_id: "create_order_nextjs",
- onComplete: () => {
- if (!location.pathname.startsWith(`/a/orders/${order.id}`)) {
- navigate(`/a/orders/${order.id}`)
- }
- },
- })
- },
- },
- {
- id: "setup_finished_nextjs",
- title: "Setup Finished: Continue Building your Ecommerce Store",
- component: OrderDetailNextjs,
- },
- ]
- default:
- return [
- {
- id: "create_product",
- title: "Create Product",
- component: ProductsListDefault,
- onNext: (product: Product) => {
- setStepComplete({
- step_id: "create_product",
- extraData: { product_id: product.id },
- onComplete: () => {
- if (!location.pathname.startsWith(`/a/products/${product.id}`)) {
- navigate(`/a/products/${product.id}`)
- }
- },
- })
- },
- },
- {
- id: "preview_product",
- title: "Preview Product",
- component: ProductDetailDefault,
- onNext: () => {
- setStepComplete({
- step_id: "preview_product",
- onComplete: () => navigate(`/a/orders`),
- })
- },
- },
- {
- id: "create_order",
- title: "Create an Order",
- component: OrdersListDefault,
- onNext: (order: Order) => {
- setStepComplete({
- step_id: "create_order",
- onComplete: () => {
- if (!location.pathname.startsWith(`/a/orders/${order.id}`)) {
- navigate(`/a/orders/${order.id}`)
- }
- },
- })
- },
- },
- {
- id: "setup_finished",
- title: "Setup Finished: Start developing with Medusa",
- component: OrderDetailDefault,
- },
- ]
- }
- }
- }, [location.pathname])
-
- // used to retrieve the index of a step by its ID
- const findStepIndex = useCallback((step_id: STEP_ID) => {
- return steps.findIndex((step) => step.id === step_id)
- }, [steps])
-
- // used to check if a step is completed
- const isStepComplete = useCallback((step_id: STEP_ID) => {
- return findStepIndex(currentStep) > findStepIndex(step_id)
- }, [findStepIndex, currentStep])
-
- // this is used to retrieve the data necessary
- // to move to the next onboarding step
- const getOnboardingParamStepData = useCallback(async (onboardingStep: string, data?: {
- orderId?: string,
- productId?: string,
- }) => {
- switch (onboardingStep) {
- case "setup_finished_nextjs":
- case "setup_finished":
- if (!data?.orderId && "order" in props) {
- return props.order
- }
- const orderId = data?.orderId || searchParams.get("order_id")
- if (orderId) {
- return (await client.admin.orders.retrieve(orderId)).order
- }
-
- throw new Error ("Required `order_id` parameter was not passed as a parameter")
- case "preview_product_nextjs":
- case "preview_product":
- if (!data?.productId && "product" in props) {
- return props.product
- }
- const productId = data?.productId || searchParams.get("product_id")
- if (productId) {
- return (await client.admin.products.retrieve(productId)).product
- }
-
- throw new Error ("Required `product_id` parameter was not passed as a parameter")
- default:
- return undefined
- }
- }, [searchParams, props])
-
- const isProductCreateStep = useMemo(() => {
- return currentStep === "create_product" ||
- currentStep === "create_product_nextjs"
- }, [currentStep])
-
- const isOrderCreateStep = useMemo(() => {
- return currentStep === "create_order" ||
- currentStep === "create_order_nextjs"
- }, [currentStep])
-
- // used to change the open step when the current
- // step is retrieved from custom API Routes
- useEffect(() => {
- setOpenStep(currentStep)
-
- if (findStepIndex(currentStep) === steps.length - 1) {setCompleted(true)}
- }, [currentStep, findStepIndex])
-
- // used to check if the user created a product and has entered its details page
- // the step is changed to the next one
- useEffect(() => {
- if (location.pathname.startsWith("/a/products/prod_") && isProductCreateStep && "product" in props) {
- // change to the preview product step
- const currentStepIndex = findStepIndex(currentStep)
- steps[currentStepIndex].onNext?.(props.product)
- }
- }, [location.pathname, isProductCreateStep])
-
- // used to check if the user created an order and has entered its details page
- // the step is changed to the next one.
- useEffect(() => {
- if (location.pathname.startsWith("/a/orders/order_") && isOrderCreateStep && "order" in props) {
- // change to the preview product step
- const currentStepIndex = findStepIndex(currentStep)
- steps[currentStepIndex].onNext?.(props.order)
- }
- }, [location.pathname, isOrderCreateStep])
-
- // used to check if the `onboarding_step` path
- // parameter is passed and, if so, moves to that step
- // only if it's the next step and its necessary data is passed
- useEffect(() => {
- const onboardingStep = searchParams.get("onboarding_step") as STEP_ID
- const onboardingStepIndex = findStepIndex(onboardingStep)
- if (onboardingStep && onboardingStepIndex !== -1 && onboardingStep !== openStep) {
- // change current step to the onboarding step
- const openStepIndex = findStepIndex(openStep)
-
- if (onboardingStepIndex !== openStepIndex + 1) {
- // can only go forward one step
- return
- }
-
- // retrieve necessary data and trigger the next function
- getOnboardingParamStepData(onboardingStep)
- .then((data) => {
- steps[openStepIndex].onNext?.(data)
- })
- .catch((e) => console.error(e))
- }
- }, [searchParams, openStep, getOnboardingParamStepData])
-
- if (
- !isLoading &&
- data?.status?.is_complete &&
- !localStorage.getItem("override_onboarding_finish")
- )
- {return null}
-
- // a method that will be triggered when
- // the setup is started
- const onStart = () => {
- mutate({ current_step: steps[0].id })
- navigate(`/a/products`)
- }
-
- // a method that will be triggered when
- // the setup is completed
- const onComplete = () => {
- setCompleted(true)
- }
-
- // a method that will be triggered when
- // the setup is closed
- const onHide = () => {
- mutate({ is_complete: true })
- }
-
- // used to get text for get started header
- const getStartedText = () => {
- switch(process.env.MEDUSA_ADMIN_ONBOARDING_TYPE) {
- case "nextjs":
- return "Learn the basics of Medusa by creating your first order using the Next.js storefront."
- default:
- return "Learn the basics of Medusa by creating your first order."
- }
- }
-
- return (
- <>
-
- setOpenStep(value as STEP_ID)}
- >
-
-
- Thank you for completing the setup guide!
-
-
- This whole experience was built using our new{" "}
- widgets feature.
- You can find out more details and build your own by
- following{" "}
-
- our guide
-
- .
-
-
- }
-
-
- >
- )
-}
-
-export const config: WidgetConfig = {
- zone: [
- "product.list.before",
- "product.details.before",
- "order.list.before",
- "order.details.before",
- ],
-}
-
-export default OnboardingFlow
-```
-
-Notice that you'll see errors related to components not being defined. You'll create these components in upcoming sections.
-
-There are three important details to ensure that Medusa reads this file as a widget:
-
-1. The file is placed under the `src/admin/widget` directory.
-2. The file exports a `config` object of type `WidgetConfig`, which is imported from `@medusajs/admin`.
-3. The file default exports a React component, which in this case is `OnboardingFlow`
-
-The extension uses `react-router-dom`, which is available as a dependency of the `@medusajs/admin` package, to navigate to other pages in the dashboard.
-
-The `OnboardingFlow` widget also implements functionalities related to handling the steps of the onboarding flow, including navigating between them and updating the current step in the backend.
-
-To use the custom API Routes created in a previous step, you use the `useAdminCustomQuery` and `useAdminCustomPost` hooks from the `medusa-react` package. You can learn more about these hooks in the [Medusa React](../medusa-react/overview.mdx#custom-hooks) documentation.
-
-You can learn more about Admin Widgets in [this documentation](./widgets.md).
-
----
-
-## Step 3: Create Step Components
-
-In this section, you’ll create the components for each step in the onboarding flow. You’ll then update the `OnboardingFlow` widget to use these components.
-
-Notice that as there are two types of flows, you'll be creating the components for the default flow and for the Next.js flow.
-
-
-
-ProductsListDefault component
-
-
-
-The `ProductsListDefault` component is used in the first step of the onboarding widget's default flow. It allows the user to create a sample product.
-
-Create the file `src/admin/components/onboarding-flow/default/products/products-list.tsx` with the following content:
-
-
-
-```tsx title=src/admin/components/onboarding-flow/default/products/products-list.tsx
-import React, { useMemo } from "react"
-import {
- useAdminCreateProduct,
- useAdminCreateCollection,
- useMedusa,
-} from "medusa-react"
-import { StepContentProps } from "../../../../widgets/onboarding-flow/onboarding-flow"
-import { Button, Text } from "@medusajs/ui"
-import getSampleProducts from "../../../../utils/sample-products"
-import prepareRegions from "../../../../utils/prepare-region"
-
-const ProductsListDefault = ({ onNext, isComplete }: StepContentProps) => {
- const { mutateAsync: createCollection, isLoading: collectionLoading } =
- useAdminCreateCollection()
- const { mutateAsync: createProduct, isLoading: productLoading } =
- useAdminCreateProduct()
- const { client } = useMedusa()
-
- const isLoading = useMemo(() =>
- collectionLoading || productLoading,
- [collectionLoading, productLoading]
- )
-
- const createSample = async () => {
- try {
- const { collection } = await createCollection({
- title: "Merch",
- handle: "merch",
- })
-
- const regions = await prepareRegions(client)
-
- const sampleProducts = getSampleProducts({
- regions,
- collection_id: collection.id,
- })
- const { product } = await createProduct(sampleProducts[0])
- onNext(product)
- } catch (e) {
- console.error(e)
- }
- }
-
- return (
-
-
- Create a product and set its general details such as title and
- description, its price, options, variants, images, and more. You'll then
- use the product to create a sample order.
-
-
- You can create a product by clicking the "New Product" button below.
- Alternatively, if you're not ready to create your own product, we can
- create a sample one for you.
-
- {!isComplete && (
-
-
-
- )}
-
- )
-}
-
-export default ProductsListDefault
-```
-
-
-
-
-
-ProductDetailDefault component
-
-
-
-The `ProductDetailDefault` component is used in the second step of the onboarding's default flow. It shows the user a code snippet to preview the product created in the first step.
-
-Create the file `src/admin/components/onboarding-flow/default/products/product-detail.tsx` with the following content:
-
-
-
-```tsx title=src/admin/components/onboarding-flow/default/products/product-detail.tsx
-import React, { useEffect, useMemo } from "react"
-import {
- useAdminPublishableApiKeys,
- useAdminCreatePublishableApiKey,
-} from "medusa-react"
-import { StepContentProps } from "../../../../widgets/onboarding-flow/onboarding-flow"
-import { Button, CodeBlock, Text } from "@medusajs/ui"
-
-const ProductDetailDefault = ({ onNext, isComplete, data }: StepContentProps) => {
- const { publishable_api_keys: keys, isLoading, refetch } = useAdminPublishableApiKeys({
- offset: 0,
- limit: 1,
- })
- const createPublishableApiKey = useAdminCreatePublishableApiKey()
-
- const api_key = useMemo(() => keys?.[0]?.id || "", [keys])
- const backendUrl = process.env.MEDUSA_BACKEND_URL === "/" || process.env.MEDUSA_ADMIN_BACKEND_URL === "/" ?
- location.origin :
- process.env.MEDUSA_BACKEND_URL || process.env.MEDUSA_ADMIN_BACKEND_URL || "http://location:9000"
-
- useEffect(() => {
- if (!isLoading && !keys?.length) {
- createPublishableApiKey.mutate({
- "title": "Development",
- }, {
- onSuccess: () => {
- refetch()
- },
- })
- }
- }, [isLoading, keys])
-
- return (
-
-
- On this page, you can view your product's details and edit them.
-
- You can preview your product using Medusa's Store APIs. You can copy any
- of the following code snippets to try it out.
-
-
- )
-}
-
-export default ProductDetailDefault
-```
-
-
-
-
-
-OrdersListDefault component
-
-
-
-The `OrdersListDefault` component is used in the third step of the onboarding's default flow. It allows the user to create a sample order.
-
-Create the file `src/admin/components/onboarding-flow/default/orders/orders-list.tsx` with the following content:
-
-
-
-```tsx title=src/admin/components/onboarding-flow/default/orders/orders-list.tsx
-import React from "react"
-import {
- useAdminProduct,
- useAdminCreateDraftOrder,
- useMedusa,
-} from "medusa-react"
-import { StepContentProps } from "../../../../widgets/onboarding-flow/onboarding-flow"
-import { Button, Text } from "@medusajs/ui"
-import prepareRegions from "../../../../utils/prepare-region"
-import prepareShippingOptions from "../../../../utils/prepare-shipping-options"
-
-const OrdersListDefault = ({ onNext, isComplete, data }: StepContentProps) => {
- const { product } = useAdminProduct(data.product_id)
- const { mutateAsync: createDraftOrder, isLoading } =
- useAdminCreateDraftOrder()
- const { client } = useMedusa()
-
- const createOrder = async () => {
- const variant = product.variants[0] ?? null
- try {
- // check if there is a shipping option and a region
- // and if not, create demo ones
- const regions = await prepareRegions(client)
- const shipping_options = await prepareShippingOptions(client, regions[0])
-
- const { draft_order } = await createDraftOrder({
- email: "customer@medusajs.com",
- items: [
- variant
- ? {
- quantity: 1,
- variant_id: variant?.id,
- }
- : {
- quantity: 1,
- title: product.title,
- unit_price: 50,
- },
- ],
- shipping_methods: [
- {
- option_id: shipping_options[0].id,
- },
- ],
- region_id: regions[0].id,
- })
-
- const { order } = await client.admin.draftOrders.markPaid(draft_order.id)
-
- onNext(order)
- } catch (e) {
- console.error(e)
- }
- }
- return (
- <>
-
-
- The last step is to create a sample order using the product you just created. You can then view your order’s details, process its payment, fulfillment, inventory, and more.
-
-
- By clicking the “Create a Sample Order” button, we’ll generate an order using the product you created and default configurations.
-
-
-
- {!isComplete && (
-
- )}
-
- >
- )
-}
-
-export default OrdersListDefault
-```
-
-
-
-
-
-OrderDetailDefault component
-
-
-
-The `OrderDetailDefault` component is used in the fourth and final step of the onboarding's default flow. It educates the user on the next steps when developing with Medusa.
-
-Create the file `src/admin/components/onboarding-flow/default/orders/order-detail.tsx` with the following content:
-
-
-
-```tsx title=src/admin/components/onboarding-flow/default/orders/order-detail.tsx
-import React from "react"
-import {
- ComputerDesktopSolid,
- CurrencyDollarSolid,
- ToolsSolid,
-} from "@medusajs/icons"
-import { IconBadge, Heading, Text } from "@medusajs/ui"
-
-const OrderDetailDefault = () => {
- return (
- <>
-
- You finished the setup guide 🎉 You now have your first order. Feel free
- to play around with the order management functionalities, such as
- capturing payment, creating fulfillments, and more.
-
-
- Start developing with Medusa
-
-
- Medusa is a completely customizable commerce solution. We've curated
- some essential guides to kickstart your development with Medusa.
-
-
-
- Products is Medusa represent the products you sell. You can set their general details including a
- title and description. Each product has options and variants, and you can set a price for each variant.
-
-
- Click the button below to create sample products.
-
- {!isComplete && (
-
-
-
- )}
-
- )
-}
-
-export default ProductsListNextjs
-```
-
-
-
-
-
-ProductDetailNextjs component
-
-
-
-The `ProductDetailNextjs` component is used in the second step of the onboarding's Next.js flow. It shows the user a button to preview the product created in the first step using the Next.js starter.
-
-Create the file `src/admin/components/onboarding-flow/nextjs/products/product-detail.tsx` with the following content:
-
-
-
-```tsx title=src/admin/components/onboarding-flow/nextjs/products/product-detail.tsx
-import { useAdminProduct } from "medusa-react"
-import { StepContentProps } from "../../../../widgets/onboarding-flow/onboarding-flow"
-import { Button, Text } from "@medusajs/ui"
-
-const ProductDetailNextjs = ({ onNext, isComplete, data }: StepContentProps) => {
- const { product, isLoading: productIsLoading } = useAdminProduct(data?.product_id)
- return (
-
-
-
- We have now created a few sample products in your Medusa store. You can scroll down to see what the Product Detail view looks like in the Admin dashboard.
- This is also the view you use to edit existing products.
-
-
- To view the products in your store, you can visit the Next.js Storefront that was installed with create-medusa-app.
-
-
- The Next.js Storefront Starter is a template that helps you start building an ecommerce store with Medusa.
- You control the code for the storefront and you can customize it further to fit your specific needs.
-
-
- Click the button below to view the products in your Next.js Storefront.
-
-
- Having trouble? Click{" "}
-
- here
- .
-
-
- )
-}
-
-export default ProductDetailNextjs
-```
-
-
-
-
-
-OrdersListNextjs component
-
-
-
-The `OrdersListNextjs` component is used in the third step of the onboarding's Next.js flow. It links the user to the checkout flow in the Next.js storefront so that they can create an order.
-
-Create the file `src/admin/components/onboarding-flow/nextjs/orders/orders-list.tsx` with the following content:
-
-
-
-```tsx title=src/admin/components/onboarding-flow/nextjs/orders/orders-list.tsx
-import React from "react"
-import {
- useAdminProduct,
- useCreateCart,
- useMedusa,
-} from "medusa-react"
-import { StepContentProps } from "../../../../widgets/onboarding-flow/onboarding-flow"
-import { Button, Text } from "@medusajs/ui"
-import prepareRegions from "../../../../utils/prepare-region"
-import prepareShippingOptions from "../../../../utils/prepare-shipping-options"
-
-const OrdersListNextjs = ({ isComplete, data }: StepContentProps) => {
- const { product } = useAdminProduct(data.product_id)
- const { mutateAsync: createCart, isLoading: cartIsLoading } = useCreateCart()
- const { client } = useMedusa()
-
- const prepareNextjsCheckout = async () => {
- const variant = product.variants[0] ?? null
- try {
- const regions = await prepareRegions(client)
- await prepareShippingOptions(client, regions[0])
- const { cart } = await createCart({
- region_id: regions[0]?.id,
- items: [
- {
- variant_id: variant?.id,
- quantity: 1,
- },
- ],
- })
-
- window.open(`http://localhost:8000/checkout?cart_id=${cart?.id}&onboarding=true`, "_blank")
- } catch (e) {
- console.error(e)
- }
- }
-
- return (
- <>
-
-
- The last step is to create a sample order using one of your products. You can then view your order’s details, process its payment, fulfillment, inventory, and more.
-
-
- You can use the button below to experience hand-first the checkout flow in the Next.js storefront. After placing the order in the storefront, you’ll be directed back here to view the order’s details.
-
-
-
- {!isComplete && (
- <>
-
- >
- )}
-
- >
- )
-}
-
-export default OrdersListNextjs
-```
-
-
-
-
-
-OrderDetailNextjs component
-
-
-
-The `OrderDetailNextjs` component is used in the fourth and final step of the onboarding's default flow. It educates the user on the next steps when developing with Medusa.
-
-Create the file `src/admin/components/onboarding-flow/nextjs/orders/order-detail.tsx` with the following content:
-
-
-
-```tsx title=src/admin/components/onboarding-flow/nextjs/orders/order-detail.tsx
-import React from "react"
-import { CurrencyDollarSolid, NextJs, SquaresPlusSolid } from "@medusajs/icons"
-import { IconBadge, Heading, Text } from "@medusajs/ui"
-
-const OrderDetailNextjs = () => {
- const queryParams = `?ref=onboarding&type=${
- process.env.MEDUSA_ADMIN_ONBOARDING_TYPE || "nextjs"
- }`
- return (
- <>
-
- You finished the setup guide 🎉. You have now a complete ecommerce store
- with a backend, admin, and a Next.js storefront. Feel free to play
- around with each of these components to experience all commerce features
- that Medusa provides.
-
-
- Continue Building your Ecommerce Store
-
-
- Your ecommerce store provides all basic ecommerce features you need to
- start selling. You can add more functionalities, add plugins for
- third-party integrations, and customize the storefront’s look and feel
- to support your use case.
-
-
- >
- )
-}
-
-export default OrderDetailNextjs
-```
-
-
----
-
-## Step 4: Test it Out
-
-You’ve now implemented everything necessary for the onboarding flow! You can test it out by building the changes and running the `develop` command:
-
-```bash npm2yarn
-npm run build
-npx medusa develop
-```
-
-If you open the admin at `localhost:7001` and log in, you’ll see the onboarding widget in the Products listing page. You can try using it and see your implementation in action!
-
----
-
-## Next Steps: Continue Development
-
-- [Learn more about Admin Widgets](./widgets.md)
-- [Learn how you can start custom development in your backend](../recipes/index.mdx)
diff --git a/www/apps/docs/content/admin/onboarding.mdx b/www/apps/docs/content/admin/onboarding.mdx
new file mode 100644
index 0000000000..c2b361c0a3
--- /dev/null
+++ b/www/apps/docs/content/admin/onboarding.mdx
@@ -0,0 +1,1981 @@
+---
+title: 'Example: How to Create Onboarding Widget'
+description: 'Learn how to build the onboarding widget available in the admin dashboard the first time you install a Medusa project.'
+addHowToData: true
+---
+
+In this guide, you’ll learn how to build the onboarding widget available in the admin dashboard the first time you install a Medusa project.
+
+:::note
+
+The onboarding widget is already implemented within the codebase of your Medusa backend. This guide is helpful if you want to understand how it was implemented or you want an example of customizing the Medusa admin and backend.
+
+:::
+
+## What you’ll be Building
+
+By following this tutorial, you’ll:
+
+- Build an onboarding flow in the admin that takes the user through creating a sample product and order. This flow has four steps and navigates the user between four pages in the admin before completing the guide. This will be implemented using [Admin Widgets](./widgets.md).
+- Keep track of the current step the user has reached by creating a table in the database and an API Route that the admin widget uses to retrieve and update the current step. These customizations will be applied to the backend.
+
+
+
+---
+
+## Prerequisites
+
+Before you follow along this tutorial, you must have a Medusa backend installed. If not, you can use the following command to get started:
+
+```bash
+npx create-medusa-app@latest
+```
+
+Please refer to the [create-medusa-app documentation](../create-medusa-app) for more details on this command, including prerequisites and troubleshooting.
+
+---
+
+## Preparation Steps
+
+The steps in this section are used to prepare for the custom functionalities you’ll be creating in this tutorial.
+
+### (Optional) TypeScript Configurations and package.json
+
+If you're using TypeScript in your project, it's highly recommended to setup your TypeScript configurations and package.json as mentioned in [this guide](./widgets.md#optional-typescript-preparations).
+
+### Install Medusa React
+
+[Medusa React](../medusa-react/overview) is a React library that facilitates using Medusa’s API Routes within your React application. It also provides the utility to register and use custom API Routes.
+
+To install Medusa React and its required dependencies, run the following command in the root directory of the Medusa backend:
+
+```bash npm2yarn
+npm install medusa-react @tanstack/react-query
+```
+
+### Implement Helper Resources
+
+The resources in this section are used for typing, layout, and design purposes, and they’re used in other essential components in this tutorial.
+
+Each of the collapsible elements below hold the path to the file that you should create, and the content of that file.
+
+
+ src/admin/types/icon-type.ts
+
+ ```tsx title=src/admin/types/icon-type.ts
+ import React from "react"
+
+ type IconProps = {
+ color?: string
+ size?: string | number
+ } & React.SVGAttributes
+
+ export default IconProps
+ ```
+
+
+
+
+ src/admin/components/shared/icons/get-started.tsx
+
+
+
+ ```tsx title=src/admin/components/shared/icons/get-started.tsx
+ import React from "react"
+ import IconProps from "../../../types/icon-type"
+
+ const GetStarted: React.FC = ({
+ size = "40",
+ color = "currentColor",
+ ...attributes
+ }) => {
+ return (
+
+
+
+ )
+ }
+
+ export default GetStarted
+
+ ```
+
+
+
+
+ src/admin/components/shared/icons/active-circle-dotted-line.tsx
+
+
+
+ ```tsx title=src/admin/components/shared/icons/dollar-sign-icon.tsx
+ import React from "react"
+ import IconProps from "../../../types/icon-type"
+
+ const ActiveCircleDottedLine: React.FC = ({
+ size = "24",
+ color = "currentColor",
+ ...attributes
+ }) => {
+ return (
+
+
+ )
+ }
+
+ export default ActiveCircleDottedLine
+ ```
+
+
+
+
+ src/admin/components/shared/accordion.tsx
+
+
+
+ ```tsx title=src/admin/components/shared/accordion.tsx
+ import * as AccordionPrimitive from "@radix-ui/react-accordion"
+ import React from "react"
+ import { CheckCircleSolid, CircleMiniSolid } from "@medusajs/icons"
+ import { Heading, Text, clx } from "@medusajs/ui"
+ import ActiveCircleDottedLine from "./icons/active-circle-dotted-line"
+
+ type AccordionItemProps = AccordionPrimitive.AccordionItemProps & {
+ title: string;
+ subtitle?: string;
+ description?: string;
+ required?: boolean;
+ tooltip?: string;
+ forceMountContent?: true;
+ headingSize?: "small" | "medium" | "large";
+ customTrigger?: React.ReactNode;
+ complete?: boolean;
+ active?: boolean;
+ triggerable?: boolean;
+ };
+
+ const Accordion: React.FC<
+ | (AccordionPrimitive.AccordionSingleProps &
+ React.RefAttributes)
+ | (AccordionPrimitive.AccordionMultipleProps &
+ React.RefAttributes)
+ > & {
+ Item: React.FC;
+ } = ({ children, ...props }) => {
+ return (
+ {children}
+ )
+ }
+
+ const Item: React.FC = ({
+ title,
+ subtitle,
+ description,
+ required,
+ tooltip,
+ children,
+ className,
+ complete,
+ headingSize = "large",
+ customTrigger = undefined,
+ forceMountContent = undefined,
+ active,
+ triggerable,
+ ...props
+ }) => {
+ return (
+
+
+
+ )
+ }
+
+ export default Card
+ ```
+
+
+
+---
+
+## Step 1: Customize Medusa Backend
+
+:::note
+
+If you’re not interested in learning about backend customizations, you can skip to [step 2](#step-2-create-onboarding-widget).
+
+:::
+
+In this step, you’ll customize the Medusa backend to:
+
+1. Add a new table in the database that stores the current onboarding step. This requires creating a new entity, repository, and migration.
+2. Add new API Routes that allow retrieving and updating the current onboarding step. This also requires creating a new service.
+
+### Create Entity
+
+An [entity](../development/entities/overview.mdx) represents a table in the database. It’s based on Typeorm, so it requires creating a repository and a migration to be used in the backend.
+
+To create the entity, create the file `src/models/onboarding.ts` with the following content:
+
+```ts title=src/models/onboarding.ts
+import { BaseEntity } from "@medusajs/medusa"
+import { Column, Entity } from "typeorm"
+
+@Entity()
+export class OnboardingState extends BaseEntity {
+ @Column()
+ current_step: string
+
+ @Column()
+ is_complete: boolean
+
+ @Column()
+ product_id: string
+}
+```
+
+Then, create the file `src/repositories/onboarding.ts` that holds the repository of the entity with the following content:
+
+```ts title=src/repositories/onboarding.ts
+import {
+ dataSource,
+} from "@medusajs/medusa/dist/loaders/database"
+import { OnboardingState } from "../models/onboarding"
+
+const OnboardingRepository = dataSource.getRepository(
+ OnboardingState
+)
+
+export default OnboardingRepository
+```
+
+You can learn more about entities and repositories in [this documentation](../development/entities/overview.mdx).
+
+### Create Migration
+
+A [migration](../development/entities/migrations/overview.mdx) is used to reflect database changes in your database schema.
+
+To create a migration, run the following command in the root of your Medusa backend:
+
+```bash
+npx typeorm migration:create src/migrations/CreateOnboarding
+```
+
+This will create a file in the `src/migrations` directory with the name formatted as `-CreateOnboarding.ts`.
+
+In that file, import the `generateEntityId` utility method at the top of the file:
+
+```ts
+import { generateEntityId } from "@medusajs/utils"
+```
+
+Then, replace the `up` and `down` methods in the migration class with the following content:
+
+
+
+```ts
+export class CreateOnboarding1685715079776 implements MigrationInterface {
+ public async up(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(
+ `CREATE TABLE "onboarding_state" ("id" character varying NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "current_step" character varying NULL, "is_complete" boolean, "product_id" character varying NULL)`
+ )
+
+ await queryRunner.query(
+ `INSERT INTO "onboarding_state" ("id", "current_step", "is_complete") VALUES ('${generateEntityId(
+ "",
+ "onboarding"
+ )}' , NULL, false)`
+ )
+ }
+
+ public async down(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(`DROP TABLE "onboarding_state"`)
+ }
+}
+```
+
+:::warning
+
+Don’t copy the name of the class in the code snippet above. Keep the name you have in the file.
+
+:::
+
+Finally, to reflect the migration in the database, run the `build` and `migration` commands:
+
+```bash npm2yarn
+npm run build
+npx medusa migrations run
+```
+
+You can learn more about migrations in [this guide](../development/entities/migrations/overview.mdx).
+
+### Create Service
+
+A [service](../development/services/overview.mdx) is a class that holds helper methods related to an entity. For example, methods to create or retrieve a record of that entity. Services are used by other resources, such as API Routes, to perform functionalities related to an entity.
+
+So, before you add the API Routes that allow retrieving and updating the onboarding state, you need to add the service that implements these helper functionalities.
+
+Start by creating the file `src/types/onboarding.ts` with the following content:
+
+
+
+```ts title=src/types/onboarding.ts
+import { OnboardingState } from "../models/onboarding"
+
+export type UpdateOnboardingStateInput = {
+ current_step?: string;
+ is_complete?: boolean;
+ product_id?: string;
+};
+
+export interface AdminOnboardingUpdateStateReq {}
+
+export type OnboardingStateRes = {
+ status: OnboardingState;
+};
+```
+
+This file holds the necessary types that will be used within the service you’ll create, and later in your onboarding flow widget.
+
+Then, create the file `src/services/onboarding.ts` with the following content:
+
+
+
+```ts title=src/services/onboarding.ts
+import { TransactionBaseService } from "@medusajs/medusa"
+import OnboardingRepository from "../repositories/onboarding"
+import { OnboardingState } from "../models/onboarding"
+import { EntityManager, IsNull, Not } from "typeorm"
+import { UpdateOnboardingStateInput } from "../types/onboarding"
+
+type InjectedDependencies = {
+ manager: EntityManager;
+ onboardingRepository: typeof OnboardingRepository;
+};
+
+class OnboardingService extends TransactionBaseService {
+ protected onboardingRepository_: typeof OnboardingRepository
+
+ constructor({ onboardingRepository }: InjectedDependencies) {
+ super(arguments[0])
+
+ this.onboardingRepository_ = onboardingRepository
+ }
+
+ async retrieve(): Promise {
+ const onboardingRepo = this.activeManager_.withRepository(
+ this.onboardingRepository_
+ )
+
+ const status = await onboardingRepo.findOne({
+ where: { id: Not(IsNull()) },
+ })
+
+ return status
+ }
+
+ async update(
+ data: UpdateOnboardingStateInput
+ ): Promise {
+ return await this.atomicPhase_(
+ async (transactionManager: EntityManager) => {
+ const onboardingRepository =
+ transactionManager.withRepository(
+ this.onboardingRepository_
+ )
+
+ const status = await this.retrieve()
+
+ for (const [key, value] of Object.entries(data)) {
+ status[key] = value
+ }
+
+ return await onboardingRepository.save(status)
+ }
+ )
+ }
+}
+
+export default OnboardingService
+```
+
+This service class implements two methods `retrieve` to retrieve the current onboarding state, and `update` to update the current onboarding state.
+
+You can learn more about services in [this documentation](../development/services/overview.mdx).
+
+### Create API Routes
+
+The last part of this step is to create the [API Routes](../development/api-routes/overview) that you’ll consume in the admin widget. There will be two API Routes: Get Onboarding State and Update Onboarding State.
+
+To add these API Routes, create the file `src/api/admin/onboarding/route.ts` with the following content:
+
+```ts title=src/api/admin/onboarding/route.ts
+import type {
+ MedusaRequest,
+ MedusaResponse,
+} from "@medusajs/medusa"
+import { EntityManager } from "typeorm"
+
+import OnboardingService from "../../../services/onboarding"
+
+export async function GET(
+ req: MedusaRequest,
+ res: MedusaResponse
+) {
+ const onboardingService: OnboardingService =
+ req.scope.resolve("onboardingService")
+
+ const status = await onboardingService.retrieve()
+
+ res.status(200).json({ status })
+}
+
+export async function POST(
+ req: MedusaRequest,
+ res: MedusaResponse
+) {
+ const onboardingService: OnboardingService =
+ req.scope.resolve("onboardingService")
+ const manager: EntityManager = req.scope.resolve("manager")
+
+ const status = await manager.transaction(
+ async (transactionManager) => {
+ return await onboardingService
+ .withTransaction(transactionManager)
+ .update(req.body)
+ }
+ )
+
+ res.status(200).json({ status })
+}
+```
+
+Notice how these API Routes use the `OnboardingService`'s `retrieve` and `update` methods to retrieve and update the current onboarding state. They resolve the `OnboardingService` using the [Dependency Container](../development/fundamentals/dependency-injection.md).
+
+You can learn more about API Routes in [this documentation](../development/api-routes/overview.mdx).
+
+---
+
+## Step 2: Create Onboarding Widget
+
+In this step, you’ll create the onboarding widget with a general implementation. Some implementation details will be added later in the tutorial.
+
+Create the file `src/admin/widgets/onboarding-flow/onboarding-flow.tsx` with the following content:
+
+
+
+
+
+```tsx title=src/admin/widgets/onboarding-flow/onboarding-flow.tsx
+import { OrderDetailsWidgetProps, ProductDetailsWidgetProps, WidgetConfig, WidgetProps } from "@medusajs/admin"
+import { useAdminCustomPost, useAdminCustomQuery, useMedusa } from "medusa-react"
+import React, { useEffect, useState, useMemo, useCallback } from "react"
+import { useNavigate, useSearchParams, useLocation } from "react-router-dom"
+import { OnboardingState } from "../../../models/onboarding"
+import {
+ AdminOnboardingUpdateStateReq,
+ OnboardingStateRes,
+ UpdateOnboardingStateInput,
+} from "../../../types/onboarding"
+import OrderDetailDefault from "../../components/onboarding-flow/default/orders/order-detail"
+import OrdersListDefault from "../../components/onboarding-flow/default/orders/orders-list"
+import ProductDetailDefault from "../../components/onboarding-flow/default/products/product-detail"
+import ProductsListDefault from "../../components/onboarding-flow/default/products/products-list"
+import { Button, Container, Heading, Text, clx } from "@medusajs/ui"
+import Accordion from "../../components/shared/accordion"
+import GetStarted from "../../components/shared/icons/get-started"
+import { Order, Product } from "@medusajs/medusa"
+import ProductsListNextjs from "../../components/onboarding-flow/nextjs/products/products-list"
+import ProductDetailNextjs from "../../components/onboarding-flow/nextjs/products/product-detail"
+import OrdersListNextjs from "../../components/onboarding-flow/nextjs/orders/orders-list"
+import OrderDetailNextjs from "../../components/onboarding-flow/nextjs/orders/order-detail"
+
+type STEP_ID =
+ | "create_product"
+ | "preview_product"
+ | "create_order"
+ | "setup_finished"
+ | "create_product_nextjs"
+ | "preview_product_nextjs"
+ | "create_order_nextjs"
+ | "setup_finished_nextjs"
+
+type OnboardingWidgetProps = WidgetProps | ProductDetailsWidgetProps | OrderDetailsWidgetProps
+
+export type StepContentProps = OnboardingWidgetProps & {
+ onNext?: Function;
+ isComplete?: boolean;
+ data?: OnboardingState;
+};
+
+type Step = {
+ id: STEP_ID;
+ title: string;
+ component: React.FC;
+ onNext?: Function;
+};
+
+const QUERY_KEY = ["onboarding_state"]
+
+const OnboardingFlow = (props: OnboardingWidgetProps) => {
+ // create custom hooks for custom API Routes
+ const { data, isLoading } = useAdminCustomQuery<
+ undefined,
+ OnboardingStateRes
+ >("/onboarding", QUERY_KEY)
+ const { mutate } = useAdminCustomPost<
+ AdminOnboardingUpdateStateReq,
+ OnboardingStateRes
+ >("/onboarding", QUERY_KEY)
+
+ const navigate = useNavigate()
+ const location = useLocation()
+ // will be used if onboarding step
+ // is passed as a path parameter
+ const { client } = useMedusa()
+
+ // get current step from custom API Route
+ const currentStep: STEP_ID | undefined = useMemo(() => {
+ return data?.status
+ ?.current_step as STEP_ID
+ }, [data])
+
+ // initialize some state
+ const [openStep, setOpenStep] = useState(currentStep)
+ const [completed, setCompleted] = useState(false)
+
+ // this method is used to move from one step to the next
+ const setStepComplete = ({
+ step_id,
+ extraData,
+ onComplete,
+ }: {
+ step_id: STEP_ID;
+ extraData?: UpdateOnboardingStateInput;
+ onComplete?: () => void;
+ }) => {
+ const next = steps[findStepIndex(step_id) + 1]
+ mutate({ current_step: next.id, ...extraData }, {
+ onSuccess: onComplete,
+ })
+ }
+
+ // this is useful if you want to change the current step
+ // using a path parameter. It can only be changed if the passed
+ // step in the path parameter is the next step.
+ const [ searchParams ] = useSearchParams()
+
+ // the steps are set based on the
+ // onboarding type
+ const steps: Step[] = useMemo(() => {
+ {
+ switch(process.env.MEDUSA_ADMIN_ONBOARDING_TYPE) {
+ case "nextjs":
+ return [
+ {
+ id: "create_product_nextjs",
+ title: "Create Products",
+ component: ProductsListNextjs,
+ onNext: (product: Product) => {
+ setStepComplete({
+ step_id: "create_product_nextjs",
+ extraData: { product_id: product.id },
+ onComplete: () => {
+ if (!location.pathname.startsWith(`/a/products/${product.id}`)) {
+ navigate(`/a/products/${product.id}`)
+ }
+ },
+ })
+ },
+ },
+ {
+ id: "preview_product_nextjs",
+ title: "Preview Product in your Next.js Storefront",
+ component: ProductDetailNextjs,
+ onNext: () => {
+ setStepComplete({
+ step_id: "preview_product_nextjs",
+ onComplete: () => navigate(`/a/orders`),
+ })
+ },
+ },
+ {
+ id: "create_order_nextjs",
+ title: "Create an Order using your Next.js Storefront",
+ component: OrdersListNextjs,
+ onNext: (order: Order) => {
+ setStepComplete({
+ step_id: "create_order_nextjs",
+ onComplete: () => {
+ if (!location.pathname.startsWith(`/a/orders/${order.id}`)) {
+ navigate(`/a/orders/${order.id}`)
+ }
+ },
+ })
+ },
+ },
+ {
+ id: "setup_finished_nextjs",
+ title: "Setup Finished: Continue Building your Ecommerce Store",
+ component: OrderDetailNextjs,
+ },
+ ]
+ default:
+ return [
+ {
+ id: "create_product",
+ title: "Create Product",
+ component: ProductsListDefault,
+ onNext: (product: Product) => {
+ setStepComplete({
+ step_id: "create_product",
+ extraData: { product_id: product.id },
+ onComplete: () => {
+ if (!location.pathname.startsWith(`/a/products/${product.id}`)) {
+ navigate(`/a/products/${product.id}`)
+ }
+ },
+ })
+ },
+ },
+ {
+ id: "preview_product",
+ title: "Preview Product",
+ component: ProductDetailDefault,
+ onNext: () => {
+ setStepComplete({
+ step_id: "preview_product",
+ onComplete: () => navigate(`/a/orders`),
+ })
+ },
+ },
+ {
+ id: "create_order",
+ title: "Create an Order",
+ component: OrdersListDefault,
+ onNext: (order: Order) => {
+ setStepComplete({
+ step_id: "create_order",
+ onComplete: () => {
+ if (!location.pathname.startsWith(`/a/orders/${order.id}`)) {
+ navigate(`/a/orders/${order.id}`)
+ }
+ },
+ })
+ },
+ },
+ {
+ id: "setup_finished",
+ title: "Setup Finished: Start developing with Medusa",
+ component: OrderDetailDefault,
+ },
+ ]
+ }
+ }
+ }, [location.pathname])
+
+ // used to retrieve the index of a step by its ID
+ const findStepIndex = useCallback((step_id: STEP_ID) => {
+ return steps.findIndex((step) => step.id === step_id)
+ }, [steps])
+
+ // used to check if a step is completed
+ const isStepComplete = useCallback((step_id: STEP_ID) => {
+ return findStepIndex(currentStep) > findStepIndex(step_id)
+ }, [findStepIndex, currentStep])
+
+ // this is used to retrieve the data necessary
+ // to move to the next onboarding step
+ const getOnboardingParamStepData = useCallback(async (onboardingStep: string, data?: {
+ orderId?: string,
+ productId?: string,
+ }) => {
+ switch (onboardingStep) {
+ case "setup_finished_nextjs":
+ case "setup_finished":
+ if (!data?.orderId && "order" in props) {
+ return props.order
+ }
+ const orderId = data?.orderId || searchParams.get("order_id")
+ if (orderId) {
+ return (await client.admin.orders.retrieve(orderId)).order
+ }
+
+ throw new Error ("Required `order_id` parameter was not passed as a parameter")
+ case "preview_product_nextjs":
+ case "preview_product":
+ if (!data?.productId && "product" in props) {
+ return props.product
+ }
+ const productId = data?.productId || searchParams.get("product_id")
+ if (productId) {
+ return (await client.admin.products.retrieve(productId)).product
+ }
+
+ throw new Error ("Required `product_id` parameter was not passed as a parameter")
+ default:
+ return undefined
+ }
+ }, [searchParams, props])
+
+ const isProductCreateStep = useMemo(() => {
+ return currentStep === "create_product" ||
+ currentStep === "create_product_nextjs"
+ }, [currentStep])
+
+ const isOrderCreateStep = useMemo(() => {
+ return currentStep === "create_order" ||
+ currentStep === "create_order_nextjs"
+ }, [currentStep])
+
+ // used to change the open step when the current
+ // step is retrieved from custom API Routes
+ useEffect(() => {
+ setOpenStep(currentStep)
+
+ if (findStepIndex(currentStep) === steps.length - 1) {setCompleted(true)}
+ }, [currentStep, findStepIndex])
+
+ // used to check if the user created a product and has entered its details page
+ // the step is changed to the next one
+ useEffect(() => {
+ if (location.pathname.startsWith("/a/products/prod_") && isProductCreateStep && "product" in props) {
+ // change to the preview product step
+ const currentStepIndex = findStepIndex(currentStep)
+ steps[currentStepIndex].onNext?.(props.product)
+ }
+ }, [location.pathname, isProductCreateStep])
+
+ // used to check if the user created an order and has entered its details page
+ // the step is changed to the next one.
+ useEffect(() => {
+ if (location.pathname.startsWith("/a/orders/order_") && isOrderCreateStep && "order" in props) {
+ // change to the preview product step
+ const currentStepIndex = findStepIndex(currentStep)
+ steps[currentStepIndex].onNext?.(props.order)
+ }
+ }, [location.pathname, isOrderCreateStep])
+
+ // used to check if the `onboarding_step` path
+ // parameter is passed and, if so, moves to that step
+ // only if it's the next step and its necessary data is passed
+ useEffect(() => {
+ const onboardingStep = searchParams.get("onboarding_step") as STEP_ID
+ const onboardingStepIndex = findStepIndex(onboardingStep)
+ if (onboardingStep && onboardingStepIndex !== -1 && onboardingStep !== openStep) {
+ // change current step to the onboarding step
+ const openStepIndex = findStepIndex(openStep)
+
+ if (onboardingStepIndex !== openStepIndex + 1) {
+ // can only go forward one step
+ return
+ }
+
+ // retrieve necessary data and trigger the next function
+ getOnboardingParamStepData(onboardingStep)
+ .then((data) => {
+ steps[openStepIndex].onNext?.(data)
+ })
+ .catch((e) => console.error(e))
+ }
+ }, [searchParams, openStep, getOnboardingParamStepData])
+
+ if (
+ !isLoading &&
+ data?.status?.is_complete &&
+ !localStorage.getItem("override_onboarding_finish")
+ )
+ {return null}
+
+ // a method that will be triggered when
+ // the setup is started
+ const onStart = () => {
+ mutate({ current_step: steps[0].id })
+ navigate(`/a/products`)
+ }
+
+ // a method that will be triggered when
+ // the setup is completed
+ const onComplete = () => {
+ setCompleted(true)
+ }
+
+ // a method that will be triggered when
+ // the setup is closed
+ const onHide = () => {
+ mutate({ is_complete: true })
+ }
+
+ // used to get text for get started header
+ const getStartedText = () => {
+ switch(process.env.MEDUSA_ADMIN_ONBOARDING_TYPE) {
+ case "nextjs":
+ return "Learn the basics of Medusa by creating your first order using the Next.js storefront."
+ default:
+ return "Learn the basics of Medusa by creating your first order."
+ }
+ }
+
+ return (
+ <>
+
+ setOpenStep(value as STEP_ID)}
+ >
+
+
+ Thank you for completing the setup guide!
+
+
+ This whole experience was built using our new{" "}
+ widgets feature.
+ You can find out more details and build your own by
+ following{" "}
+
+ our guide
+
+ .
+
+
+ }
+
+
+ >
+ )
+}
+
+export const config: WidgetConfig = {
+ zone: [
+ "product.list.before",
+ "product.details.before",
+ "order.list.before",
+ "order.details.before",
+ ],
+}
+
+export default OnboardingFlow
+```
+
+Notice that you'll see errors related to components not being defined. You'll create these components in upcoming sections.
+
+There are three important details to ensure that Medusa reads this file as a widget:
+
+1. The file is placed under the `src/admin/widget` directory.
+2. The file exports a `config` object of type `WidgetConfig`, which is imported from `@medusajs/admin`.
+3. The file default exports a React component, which in this case is `OnboardingFlow`
+
+The extension uses `react-router-dom`, which is available as a dependency of the `@medusajs/admin` package, to navigate to other pages in the dashboard.
+
+The `OnboardingFlow` widget also implements functionalities related to handling the steps of the onboarding flow, including navigating between them and updating the current step in the backend.
+
+To use the custom API Routes created in a previous step, you use the `useAdminCustomQuery` and `useAdminCustomPost` hooks from the `medusa-react` package. You can learn more about these hooks in the [Medusa React](../medusa-react/overview.mdx#custom-hooks) documentation.
+
+You can learn more about Admin Widgets in [this documentation](./widgets.md).
+
+---
+
+## Step 3: Create Step Components
+
+In this section, you’ll create the components for each step in the onboarding flow. You’ll then update the `OnboardingFlow` widget to use these components.
+
+Notice that as there are two types of flows, you'll be creating the components for the default flow and for the Next.js flow.
+
+
+ ProductsListDefault component
+
+ The `ProductsListDefault` component is used in the first step of the onboarding widget's default flow. It allows the user to create a sample product.
+
+ Create the file `src/admin/components/onboarding-flow/default/products/products-list.tsx` with the following content:
+
+
+
+ ```tsx title=src/admin/components/onboarding-flow/default/products/products-list.tsx
+ import React, { useMemo } from "react"
+ import {
+ useAdminCreateProduct,
+ useAdminCreateCollection,
+ useMedusa,
+ } from "medusa-react"
+ import { StepContentProps } from "../../../../widgets/onboarding-flow/onboarding-flow"
+ import { Button, Text } from "@medusajs/ui"
+ import getSampleProducts from "../../../../utils/sample-products"
+ import prepareRegions from "../../../../utils/prepare-region"
+
+ const ProductsListDefault = ({ onNext, isComplete }: StepContentProps) => {
+ const { mutateAsync: createCollection, isLoading: collectionLoading } =
+ useAdminCreateCollection()
+ const { mutateAsync: createProduct, isLoading: productLoading } =
+ useAdminCreateProduct()
+ const { client } = useMedusa()
+
+ const isLoading = useMemo(() =>
+ collectionLoading || productLoading,
+ [collectionLoading, productLoading]
+ )
+
+ const createSample = async () => {
+ try {
+ const { collection } = await createCollection({
+ title: "Merch",
+ handle: "merch",
+ })
+
+ const regions = await prepareRegions(client)
+
+ const sampleProducts = getSampleProducts({
+ regions,
+ collection_id: collection.id,
+ })
+ const { product } = await createProduct(sampleProducts[0])
+ onNext(product)
+ } catch (e) {
+ console.error(e)
+ }
+ }
+
+ return (
+
+
+ Create a product and set its general details such as title and
+ description, its price, options, variants, images, and more. You'll then
+ use the product to create a sample order.
+
+
+ You can create a product by clicking the "New Product" button below.
+ Alternatively, if you're not ready to create your own product, we can
+ create a sample one for you.
+
+ {!isComplete && (
+
+
+
+ )}
+
+ )
+ }
+
+ export default ProductsListDefault
+ ```
+
+
+
+
+ ProductDetailDefault component
+
+ The `ProductDetailDefault` component is used in the second step of the onboarding's default flow. It shows the user a code snippet to preview the product created in the first step.
+
+ Create the file `src/admin/components/onboarding-flow/default/products/product-detail.tsx` with the following content:
+
+
+
+ ```tsx title=src/admin/components/onboarding-flow/default/products/product-detail.tsx
+ import React, { useEffect, useMemo } from "react"
+ import {
+ useAdminPublishableApiKeys,
+ useAdminCreatePublishableApiKey,
+ } from "medusa-react"
+ import { StepContentProps } from "../../../../widgets/onboarding-flow/onboarding-flow"
+ import { Button, CodeBlock, Text } from "@medusajs/ui"
+
+ const ProductDetailDefault = ({ onNext, isComplete, data }: StepContentProps) => {
+ const { publishable_api_keys: keys, isLoading, refetch } = useAdminPublishableApiKeys({
+ offset: 0,
+ limit: 1,
+ })
+ const createPublishableApiKey = useAdminCreatePublishableApiKey()
+
+ const api_key = useMemo(() => keys?.[0]?.id || "", [keys])
+ const backendUrl = process.env.MEDUSA_BACKEND_URL === "/" || process.env.MEDUSA_ADMIN_BACKEND_URL === "/" ?
+ location.origin :
+ process.env.MEDUSA_BACKEND_URL || process.env.MEDUSA_ADMIN_BACKEND_URL || "http://location:9000"
+
+ useEffect(() => {
+ if (!isLoading && !keys?.length) {
+ createPublishableApiKey.mutate({
+ "title": "Development",
+ }, {
+ onSuccess: () => {
+ refetch()
+ },
+ })
+ }
+ }, [isLoading, keys])
+
+ return (
+
+
+ On this page, you can view your product's details and edit them.
+
+ You can preview your product using Medusa's Store APIs. You can copy any
+ of the following code snippets to try it out.
+
+
+ )
+ }
+
+ export default ProductDetailDefault
+ ```
+
+
+
+
+ OrdersListDefault component
+
+ The `OrdersListDefault` component is used in the third step of the onboarding's default flow. It allows the user to create a sample order.
+
+ Create the file `src/admin/components/onboarding-flow/default/orders/orders-list.tsx` with the following content:
+
+
+
+ ```tsx title=src/admin/components/onboarding-flow/default/orders/orders-list.tsx
+ import React from "react"
+ import {
+ useAdminProduct,
+ useAdminCreateDraftOrder,
+ useMedusa,
+ } from "medusa-react"
+ import { StepContentProps } from "../../../../widgets/onboarding-flow/onboarding-flow"
+ import { Button, Text } from "@medusajs/ui"
+ import prepareRegions from "../../../../utils/prepare-region"
+ import prepareShippingOptions from "../../../../utils/prepare-shipping-options"
+
+ const OrdersListDefault = ({ onNext, isComplete, data }: StepContentProps) => {
+ const { product } = useAdminProduct(data.product_id)
+ const { mutateAsync: createDraftOrder, isLoading } =
+ useAdminCreateDraftOrder()
+ const { client } = useMedusa()
+
+ const createOrder = async () => {
+ const variant = product.variants[0] ?? null
+ try {
+ // check if there is a shipping option and a region
+ // and if not, create demo ones
+ const regions = await prepareRegions(client)
+ const shipping_options = await prepareShippingOptions(client, regions[0])
+
+ const { draft_order } = await createDraftOrder({
+ email: "customer@medusajs.com",
+ items: [
+ variant
+ ? {
+ quantity: 1,
+ variant_id: variant?.id,
+ }
+ : {
+ quantity: 1,
+ title: product.title,
+ unit_price: 50,
+ },
+ ],
+ shipping_methods: [
+ {
+ option_id: shipping_options[0].id,
+ },
+ ],
+ region_id: regions[0].id,
+ })
+
+ const { order } = await client.admin.draftOrders.markPaid(draft_order.id)
+
+ onNext(order)
+ } catch (e) {
+ console.error(e)
+ }
+ }
+ return (
+ <>
+
+
+ The last step is to create a sample order using the product you just created. You can then view your order’s details, process its payment, fulfillment, inventory, and more.
+
+
+ By clicking the “Create a Sample Order” button, we’ll generate an order using the product you created and default configurations.
+
+
+
+ {!isComplete && (
+
+ )}
+
+ >
+ )
+ }
+
+ export default OrdersListDefault
+ ```
+
+
+
+
+ OrderDetailDefault component
+
+ The `OrderDetailDefault` component is used in the fourth and final step of the onboarding's default flow. It educates the user on the next steps when developing with Medusa.
+
+ Create the file `src/admin/components/onboarding-flow/default/orders/order-detail.tsx` with the following content:
+
+
+
+ ```tsx title=src/admin/components/onboarding-flow/default/orders/order-detail.tsx
+ import React from "react"
+ import {
+ ComputerDesktopSolid,
+ CurrencyDollarSolid,
+ ToolsSolid,
+ } from "@medusajs/icons"
+ import { IconBadge, Heading, Text } from "@medusajs/ui"
+
+ const OrderDetailDefault = () => {
+ return (
+ <>
+
+ You finished the setup guide 🎉 You now have your first order. Feel free
+ to play around with the order management functionalities, such as
+ capturing payment, creating fulfillments, and more.
+
+
+ Start developing with Medusa
+
+
+ Medusa is a completely customizable commerce solution. We've curated
+ some essential guides to kickstart your development with Medusa.
+
+
+
+ Products is Medusa represent the products you sell. You can set their general details including a
+ title and description. Each product has options and variants, and you can set a price for each variant.
+
+
+ Click the button below to create sample products.
+
+ {!isComplete && (
+
+
+
+ )}
+
+ )
+ }
+
+ export default ProductsListNextjs
+ ```
+
+
+
+
+ ProductDetailNextjs component
+
+ The `ProductDetailNextjs` component is used in the second step of the onboarding's Next.js flow. It shows the user a button to preview the product created in the first step using the Next.js starter.
+
+ Create the file `src/admin/components/onboarding-flow/nextjs/products/product-detail.tsx` with the following content:
+
+
+
+ ```tsx title=src/admin/components/onboarding-flow/nextjs/products/product-detail.tsx
+ import { useAdminProduct } from "medusa-react"
+ import { StepContentProps } from "../../../../widgets/onboarding-flow/onboarding-flow"
+ import { Button, Text } from "@medusajs/ui"
+
+ const ProductDetailNextjs = ({ onNext, isComplete, data }: StepContentProps) => {
+ const { product, isLoading: productIsLoading } = useAdminProduct(data?.product_id)
+ return (
+
+
+
+ We have now created a few sample products in your Medusa store. You can scroll down to see what the Product Detail view looks like in the Admin dashboard.
+ This is also the view you use to edit existing products.
+
+
+ To view the products in your store, you can visit the Next.js Storefront that was installed with create-medusa-app.
+
+
+ The Next.js Storefront Starter is a template that helps you start building an ecommerce store with Medusa.
+ You control the code for the storefront and you can customize it further to fit your specific needs.
+
+
+ Click the button below to view the products in your Next.js Storefront.
+
+
+ Having trouble? Click{" "}
+
+ here
+ .
+
+
+ )
+ }
+
+ export default ProductDetailNextjs
+ ```
+
+
+
+
+ OrdersListNextjs component
+
+ The `OrdersListNextjs` component is used in the third step of the onboarding's Next.js flow. It links the user to the checkout flow in the Next.js storefront so that they can create an order.
+
+ Create the file `src/admin/components/onboarding-flow/nextjs/orders/orders-list.tsx` with the following content:
+
+
+
+ ```tsx title=src/admin/components/onboarding-flow/nextjs/orders/orders-list.tsx
+ import React from "react"
+ import {
+ useAdminProduct,
+ useCreateCart,
+ useMedusa,
+ } from "medusa-react"
+ import { StepContentProps } from "../../../../widgets/onboarding-flow/onboarding-flow"
+ import { Button, Text } from "@medusajs/ui"
+ import prepareRegions from "../../../../utils/prepare-region"
+ import prepareShippingOptions from "../../../../utils/prepare-shipping-options"
+
+ const OrdersListNextjs = ({ isComplete, data }: StepContentProps) => {
+ const { product } = useAdminProduct(data.product_id)
+ const { mutateAsync: createCart, isLoading: cartIsLoading } = useCreateCart()
+ const { client } = useMedusa()
+
+ const prepareNextjsCheckout = async () => {
+ const variant = product.variants[0] ?? null
+ try {
+ const regions = await prepareRegions(client)
+ await prepareShippingOptions(client, regions[0])
+ const { cart } = await createCart({
+ region_id: regions[0]?.id,
+ items: [
+ {
+ variant_id: variant?.id,
+ quantity: 1,
+ },
+ ],
+ })
+
+ window.open(`http://localhost:8000/checkout?cart_id=${cart?.id}&onboarding=true`, "_blank")
+ } catch (e) {
+ console.error(e)
+ }
+ }
+
+ return (
+ <>
+
+
+ The last step is to create a sample order using one of your products. You can then view your order’s details, process its payment, fulfillment, inventory, and more.
+
+
+ You can use the button below to experience hand-first the checkout flow in the Next.js storefront. After placing the order in the storefront, you’ll be directed back here to view the order’s details.
+
+
+
+ {!isComplete && (
+ <>
+
+ >
+ )}
+
+ >
+ )
+ }
+
+ export default OrdersListNextjs
+ ```
+
+
+
+
+ OrderDetailNextjs component
+
+ The `OrderDetailNextjs` component is used in the fourth and final step of the onboarding's default flow. It educates the user on the next steps when developing with Medusa.
+
+ Create the file `src/admin/components/onboarding-flow/nextjs/orders/order-detail.tsx` with the following content:
+
+
+
+ ```tsx title=src/admin/components/onboarding-flow/nextjs/orders/order-detail.tsx
+ import React from "react"
+ import { CurrencyDollarSolid, NextJs, SquaresPlusSolid } from "@medusajs/icons"
+ import { IconBadge, Heading, Text } from "@medusajs/ui"
+
+ const OrderDetailNextjs = () => {
+ const queryParams = `?ref=onboarding&type=${
+ process.env.MEDUSA_ADMIN_ONBOARDING_TYPE || "nextjs"
+ }`
+ return (
+ <>
+
+ You finished the setup guide 🎉. You have now a complete ecommerce store
+ with a backend, admin, and a Next.js storefront. Feel free to play
+ around with each of these components to experience all commerce features
+ that Medusa provides.
+
+
+ Continue Building your Ecommerce Store
+
+
+ Your ecommerce store provides all basic ecommerce features you need to
+ start selling. You can add more functionalities, add plugins for
+ third-party integrations, and customize the storefront’s look and feel
+ to support your use case.
+
+
+ >
+ )
+ }
+
+ export default OrderDetailNextjs
+ ```
+
+
+
+---
+
+## Step 4: Test it Out
+
+You’ve now implemented everything necessary for the onboarding flow! You can test it out by building the changes and running the `develop` command:
+
+```bash npm2yarn
+npm run build
+npx medusa develop
+```
+
+If you open the admin at `localhost:7001` and log in, you’ll see the onboarding widget in the Products listing page. You can try using it and see your implementation in action!
+
+---
+
+## Next Steps: Continue Development
+
+- [Learn more about Admin Widgets](./widgets.md)
+- [Learn how you can start custom development in your backend](../recipes/index.mdx)
diff --git a/www/apps/docs/content/contribution/docs.md b/www/apps/docs/content/contribution/docs.md
index 6235bdedfd..d56186f98a 100644
--- a/www/apps/docs/content/contribution/docs.md
+++ b/www/apps/docs/content/contribution/docs.md
@@ -351,26 +351,26 @@ import TabItem from '@theme/TabItem';
-
+
-```ts
-medusa.admin.uploads.create(file) // file is an instance of File
-.then(({ uploads }) => {
- const key = uploads[0].key
-})
-```
+ ```ts
+ medusa.admin.uploads.create(file) // file is an instance of File
+ .then(({ uploads }) => {
+ const key = uploads[0].key
+ })
+ ```
-
-
+
+
-```bash
-curl -L -X POST '/admin/uploads' \
- -H 'Authorization: Bearer ' \
- -H 'Content-Type: text/csv' \
- -F 'files=@""'
-```
+ ```bash
+ curl -L -X POST '/admin/uploads' \
+ -H 'Authorization: Bearer ' \
+ -H 'Content-Type: text/csv' \
+ -F 'files=@""'
+ ```
-
+
~~~
diff --git a/www/apps/docs/content/create-medusa-app.mdx b/www/apps/docs/content/create-medusa-app.mdx
index da1b6144f2..1de434facc 100644
--- a/www/apps/docs/content/create-medusa-app.mdx
+++ b/www/apps/docs/content/create-medusa-app.mdx
@@ -42,9 +42,9 @@ In your terminal, run the following command:
- ```bash
- npx create-medusa-app@latest
- ```
+ ```bash
+ npx create-medusa-app@latest
+ ```
{/*
@@ -56,69 +56,60 @@ In your terminal, run the following command:
*/}
- ```bash
- pnpm dlx create-medusa-app@latest
- ```
+ ```bash
+ pnpm dlx create-medusa-app@latest
+ ```
-
-
-Command Options
-
+
+ Command Options
+
+ The `create-medusa-app` command can accept the following options:
-The `create-medusa-app` command can accept the following options:
+ - `--repo-url `: The repository URL to create the project from. By default it will be `https://github.com/medusajs/medusa-starter-default`.
+ - `--seed`: A flag indicating whether the database should be seeded with demo data. By default, seeding is disabled.
+ - `--no-boilerplate`: A flag that removes all files added for an enhanced onboarding experience (files under `src/admin`, `src/api`, etc...). This is helpful if you want to create a clean project, and is only recommended if you're familiar with Medusa.
+ - `--no-browser`: Disables opening the browser at the end of the project creation and only shows success message.
+ - `--skip-db`: Skips creating the database, running migrations, and seeding, and subsequently skips opening the browser. Useful if you want to set the database URL at a later point in the configurations.
+ - `--db-url `: Skips database creation and sets the database URL to the provided URL. Throws an error if connection to the database fails. Will still run migrations and open the admin after project creation. Useful if you already have a database created, locally or remotely.
+ - `--no-migrations`: Skips running migrations, creating admin user, and seeding. If used, it's expected that you pass the `--db-url` option with a URL of a database that has all necessary migrations. Otherwise, unexpected errors will occur. Helpful only if combined with `--db-url`.
+ - `--directory-path `: Allows specifying the parent directory path to create the directory of the new project in.
+ - `--with-nextjs-starter`: Installs the Next.js starter storefront under the `-storefront` directory, where `` is the name of the project you enter in the first question. If the `-storefront` directory already exists, random characters are added at the end of `-storefront`.
+
-- `--repo-url `: The repository URL to create the project from. By default it will be `https://github.com/medusajs/medusa-starter-default`.
-- `--seed`: A flag indicating whether the database should be seeded with demo data. By default, seeding is disabled.
-- `--no-boilerplate`: A flag that removes all files added for an enhanced onboarding experience (files under `src/admin`, `src/api`, etc...). This is helpful if you want to create a clean project, and is only recommended if you're familiar with Medusa.
-- `--no-browser`: Disables opening the browser at the end of the project creation and only shows success message.
-- `--skip-db`: Skips creating the database, running migrations, and seeding, and subsequently skips opening the browser. Useful if you want to set the database URL at a later point in the configurations.
-- `--db-url `: Skips database creation and sets the database URL to the provided URL. Throws an error if connection to the database fails. Will still run migrations and open the admin after project creation. Useful if you already have a database created, locally or remotely.
-- `--no-migrations`: Skips running migrations, creating admin user, and seeding. If used, it's expected that you pass the `--db-url` option with a URL of a database that has all necessary migrations. Otherwise, unexpected errors will occur. Helpful only if combined with `--db-url`.
-- `--directory-path `: Allows specifying the parent directory path to create the directory of the new project in.
-- `--with-nextjs-starter`: Installs the Next.js starter storefront under the `-storefront` directory, where `` is the name of the project you enter in the first question. If the `-storefront` directory already exists, random characters are added at the end of `-storefront`.
+
+ Example: Connect to a Vercel PostgreSQL Database
-
+ If you want to use a PostgreSQL database hosted on Vercel, you must use the `--db-url` option and add to the end of your connection URL `?sslmode=require`. For example:
-
-
-Example: Connect to a Vercel PostgreSQL Database
-
+ ```bash
+ npx create-medusa-app@latest --db-url "postgres://default:.postgres.vercel-storage.com:5432/verceldb?sslmode=require"
+ ```
-If you want to use a PostgreSQL database hosted on Vercel, you must use the `--db-url` option and add to the end of your connection URL `?sslmode=require`. For example:
+ :::note
-```bash
-npx create-medusa-app@latest --db-url "postgres://default:.postgres.vercel-storage.com:5432/verceldb?sslmode=require"
-```
+ If the database already has the necessary migrations and you don't need the command to run migrations, you can pass the `--no-migrations` option.
-:::note
+ :::
+
-If the database already has the necessary migrations and you don't need the command to run migrations, you can pass the `--no-migrations` option.
+
+ Example: Connect to a Supabase Database
-:::
+ If you want to connect to a Supabase database, you must use the `--db-url` option with its value beign the connection URL to your Supabase database. For example:
-
+ ```bash
+ npx create-medusa-app@latest --db-url postgresql://postgres:@.supabase.co:5432/postgres
+ ```
-
-
-Example: Connect to a Supabase Database
-
+ :::note
-If you want to connect to a Supabase database, you must use the `--db-url` option with its value beign the connection URL to your Supabase database. For example:
+ If the database already has the necessary migrations and you don't need the command to run migrations, you can pass the `--no-migrations` option.
-```bash
-npx create-medusa-app@latest --db-url postgresql://postgres:@.supabase.co:5432/postgres
-```
-
-:::note
-
-If the database already has the necessary migrations and you don't need the command to run migrations, you can pass the `--no-migrations` option.
-
-:::
-
-
+ :::
+
## Step 2: Specify Project Name
diff --git a/www/apps/docs/content/deployments/server/deploying-on-railway.md b/www/apps/docs/content/deployments/server/deploying-on-railway.md
index 494d5ac9ef..6d8601103c 100644
--- a/www/apps/docs/content/deployments/server/deploying-on-railway.md
+++ b/www/apps/docs/content/deployments/server/deploying-on-railway.md
@@ -22,8 +22,8 @@ If you're deploying the admin plugin along with the backend, you'll need at leas
If you also don't have a Medusa project, you can deploy to Railway instantly with this button:
-
+ href="https://railway.app/template/zC7eOq?referralCode=TW4Qi0" className="img-url no-zoom-img">
+
---
diff --git a/www/apps/docs/content/deployments/storefront/deploying-next-on-vercel.mdx b/www/apps/docs/content/deployments/storefront/deploying-next-on-vercel.mdx
index 2ff1871f9d..7d39d12750 100644
--- a/www/apps/docs/content/deployments/storefront/deploying-next-on-vercel.mdx
+++ b/www/apps/docs/content/deployments/storefront/deploying-next-on-vercel.mdx
@@ -13,8 +13,8 @@ In this document, you’ll learn how to deploy the Next.js Starter Template on V
Alternatively, you can directly deploy the Next.js Starter Template to Vercel with this button.
-
+ href="https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fmedusajs%2Fnextjs-starter-medusa.git&env=NEXT_PUBLIC_MEDUSA_BACKEND_URL&envDescription=URL%20of%20your%20Medusa%20Backend" className="img-url no-zoom-img">
+
:::note
diff --git a/www/apps/docs/content/development/api-routes/create-express-route.mdx b/www/apps/docs/content/development/api-routes/create-express-route.mdx
index 3fb5dc49a4..77930f5ae8 100644
--- a/www/apps/docs/content/development/api-routes/create-express-route.mdx
+++ b/www/apps/docs/content/development/api-routes/create-express-route.mdx
@@ -143,52 +143,52 @@ export default (rootDirectory) => {
Then, create an object that will hold the CORS configurations. Based on whether it's storefront or admin CORS options, you pass it the respective configuration from `projectConfig`:
-
+
-```ts
-const storeCorsOptions = {
- origin: projectConfig.store_cors.split(","),
- credentials: true,
-}
-```
+ ```ts
+ const storeCorsOptions = {
+ origin: projectConfig.store_cors.split(","),
+ credentials: true,
+ }
+ ```
-
-
+
+
-```ts
-const adminCorsOptions = {
- origin: projectConfig.admin_cors.split(","),
- credentials: true,
-}
-```
+ ```ts
+ const adminCorsOptions = {
+ origin: projectConfig.admin_cors.split(","),
+ credentials: true,
+ }
+ ```
-
+
Finally, you can either pass the `cors` middleware for a specific route, or pass it to the entire router:
-
+
-```ts
-adminRouter.options("/admin/hello", cors(adminCorsOptions))
-adminRouter.get(
- "/admin/hello",
- cors(adminCorsOptions),
- (req, res) => {
- // ...
- }
-)
-```
+ ```ts
+ adminRouter.options("/admin/hello", cors(adminCorsOptions))
+ adminRouter.get(
+ "/admin/hello",
+ cors(adminCorsOptions),
+ (req, res) => {
+ // ...
+ }
+ )
+ ```
-
-
+
+
-```ts
-adminRouter.use(cors(adminCorsOptions))
-```
+ ```ts
+ adminRouter.use(cors(adminCorsOptions))
+ ```
-
+
---
@@ -252,43 +252,43 @@ import { requireCustomerAuthentication } from "@medusajs/medusa"
Then, pass the middleware to either a single route or an entire router:
-
+
-```ts
-// only necessary if you're passing cors options per route
-router.options("/store/hello", cors(storeCorsOptions))
-router.get(
- "/store/hello",
- cors(storeCorsOptions),
- requireCustomerAuthentication(),
- // authenticateCustomer()
- async (req, res) => {
- // access current customer
- const id = req.user.customer_id
- // if you're using authenticateCustomer middleware
- // check if id is set first
+ ```ts
+ // only necessary if you're passing cors options per route
+ router.options("/store/hello", cors(storeCorsOptions))
+ router.get(
+ "/store/hello",
+ cors(storeCorsOptions),
+ requireCustomerAuthentication(),
+ // authenticateCustomer()
+ async (req, res) => {
+ // access current customer
+ const id = req.user.customer_id
+ // if you're using authenticateCustomer middleware
+ // check if id is set first
- const customerService = req.scope.resolve("customerService")
-
- const customer = await customerService.retrieve(id)
- // ...
- }
-)
-```
+ const customerService = req.scope.resolve("customerService")
+
+ const customer = await customerService.retrieve(id)
+ // ...
+ }
+ )
+ ```
-
-
+
+
-```ts
-storeRouter.use(requireCustomerAuthentication())
-// all routes added to storeRouter are now protected
-// the logged in customer can be accessed using:
-// req.user.customer_id
+ ```ts
+ storeRouter.use(requireCustomerAuthentication())
+ // all routes added to storeRouter are now protected
+ // the logged in customer can be accessed using:
+ // req.user.customer_id
-// storeRouter.use(authenticateCustomer())
-```
+ // storeRouter.use(authenticateCustomer())
+ ```
-
+
### Protect Admin Routes
@@ -304,37 +304,37 @@ import { authenticate } from "@medusajs/medusa"
Then, pass the middleware to either a single route or an entire router:
-
+
-```ts
-// only necessary if you're passing cors options per route
-adminRouter.options("/admin/hello", cors(adminCorsOptions))
-adminRouter.get(
- "/admin/hello",
- cors(adminCorsOptions),
- authenticate(),
- async (req, res) => {
- // access current user
- const id = req.user.userId
- const userService = req.scope.resolve("userService")
-
- const user = await userService.retrieve(id)
- // ...
- }
-)
-```
+ ```ts
+ // only necessary if you're passing cors options per route
+ adminRouter.options("/admin/hello", cors(adminCorsOptions))
+ adminRouter.get(
+ "/admin/hello",
+ cors(adminCorsOptions),
+ authenticate(),
+ async (req, res) => {
+ // access current user
+ const id = req.user.userId
+ const userService = req.scope.resolve("userService")
+
+ const user = await userService.retrieve(id)
+ // ...
+ }
+ )
+ ```
-
-
+
+
-```ts
-adminRouter.use(authenticate())
-// all routes added to adminRouter are now protected
-// the logged in user can be accessed using:
-// req.user.userId
-```
+ ```ts
+ adminRouter.use(authenticate())
+ // all routes added to adminRouter are now protected
+ // the logged in user can be accessed using:
+ // req.user.userId
+ ```
-
+
---
@@ -628,318 +628,318 @@ This section services as an example of creating endpoints that perform Create, R
You can refer to the [Entities](../entities/create.mdx#adding-relations) and [Services](../services/create-service.mdx#example-services-with-crud-operations) documentation to learn how to create the custom entities and services used in this example.
-
+
-```ts
-import express, { Router } from "express"
-import adminRoutes from "./admin"
-import storeRoutes from "./store"
-import { errorHandler } from "@medusajs/medusa"
+ ```ts
+ import express, { Router } from "express"
+ import adminRoutes from "./admin"
+ import storeRoutes from "./store"
+ import { errorHandler } from "@medusajs/medusa"
-export default (rootDirectory, options) => {
- const router = Router()
+ export default (rootDirectory, options) => {
+ const router = Router()
- router.use(express.json())
- router.use(express.urlencoded({ extended: true }))
+ router.use(express.json())
+ router.use(express.urlencoded({ extended: true }))
- adminRoutes(router, options)
- storeRoutes(router, options)
+ adminRoutes(router, options)
+ storeRoutes(router, options)
- router.use(errorHandler())
+ router.use(errorHandler())
- return router
-}
-```
+ return router
+ }
+ ```
-
-
+
+
-```ts
-import { Router } from "express"
-import PostService from "../services/post"
-import {
- ConfigModule,
-} from "@medusajs/medusa/dist/types/global"
-import cors from "cors"
-import { authenticate, wrapHandler } from "@medusajs/medusa"
-import AuthorService from "../services/author"
+ ```ts
+ import { Router } from "express"
+ import PostService from "../services/post"
+ import {
+ ConfigModule,
+ } from "@medusajs/medusa/dist/types/global"
+ import cors from "cors"
+ import { authenticate, wrapHandler } from "@medusajs/medusa"
+ import AuthorService from "../services/author"
-export default function adminRoutes(
- router: Router,
- options: ConfigModule
-) {
- const { projectConfig } = options
+ export default function adminRoutes(
+ router: Router,
+ options: ConfigModule
+ ) {
+ const { projectConfig } = options
- const corsOptions = {
- origin: projectConfig.admin_cors.split(","),
- credentials: true,
- }
-
- const adminRouter = Router()
-
- router.use("/admin/blog", adminRouter)
-
- adminRouter.use(cors(corsOptions))
- adminRouter.use(authenticate())
-
- // it's recommended to define the routes
- // in separate files. They're done in
- // the same file here for simplicity
-
-
- // list all blog posts
- adminRouter.get(
- "/posts",
- wrapHandler(async (req, res) => {
- const postService: PostService = req.scope.resolve(
- "postService"
- )
-
- res.json({
- posts: await postService.list(),
- })
- }))
-
-
- // retrieve a single blog post
- adminRouter.get(
- "/posts/:id",
- wrapHandler(async (req, res) => {
- const postService: PostService = req.scope.resolve(
- "postService"
- )
-
- const post = await postService.retrieve(req.params.id)
-
- res.json({
- post,
- })
- }))
-
- // create a blog post
- adminRouter.post(
- "/posts",
- wrapHandler(async (req, res) => {
- const postService: PostService = req.scope.resolve(
- "postService"
- )
-
- // basic validation of request body
- if (!req.body.title || !req.body.author_id) {
- throw new Error("`title` and `author_id` are required.")
+ const corsOptions = {
+ origin: projectConfig.admin_cors.split(","),
+ credentials: true,
}
- const post = await postService.create(req.body)
+ const adminRouter = Router()
- res.json({
- post,
- })
- }))
+ router.use("/admin/blog", adminRouter)
- // update a blog post
- adminRouter.post(
- "/posts/:id",
- wrapHandler(async (req, res) => {
- const postService: PostService = req.scope.resolve(
- "postService"
- )
+ adminRouter.use(cors(corsOptions))
+ adminRouter.use(authenticate())
- // basic validation of request body
- if (req.body.id) {
- throw new Error("Can't update post ID")
+ // it's recommended to define the routes
+ // in separate files. They're done in
+ // the same file here for simplicity
+
+
+ // list all blog posts
+ adminRouter.get(
+ "/posts",
+ wrapHandler(async (req, res) => {
+ const postService: PostService = req.scope.resolve(
+ "postService"
+ )
+
+ res.json({
+ posts: await postService.list(),
+ })
+ }))
+
+
+ // retrieve a single blog post
+ adminRouter.get(
+ "/posts/:id",
+ wrapHandler(async (req, res) => {
+ const postService: PostService = req.scope.resolve(
+ "postService"
+ )
+
+ const post = await postService.retrieve(req.params.id)
+
+ res.json({
+ post,
+ })
+ }))
+
+ // create a blog post
+ adminRouter.post(
+ "/posts",
+ wrapHandler(async (req, res) => {
+ const postService: PostService = req.scope.resolve(
+ "postService"
+ )
+
+ // basic validation of request body
+ if (!req.body.title || !req.body.author_id) {
+ throw new Error("`title` and `author_id` are required.")
+ }
+
+ const post = await postService.create(req.body)
+
+ res.json({
+ post,
+ })
+ }))
+
+ // update a blog post
+ adminRouter.post(
+ "/posts/:id",
+ wrapHandler(async (req, res) => {
+ const postService: PostService = req.scope.resolve(
+ "postService"
+ )
+
+ // basic validation of request body
+ if (req.body.id) {
+ throw new Error("Can't update post ID")
+ }
+
+ const post = await postService.update(
+ req.params.id,
+ req.body
+ )
+
+ res.json({
+ post,
+ })
+ }))
+
+ // delete a blog post
+ adminRouter.delete(
+ "/posts/:id",
+ wrapHandler(async (req, res) => {
+ const postService: PostService = req.scope.resolve(
+ "postService"
+ )
+
+ await postService.delete(req.params.id)
+
+ res.status(200).end()
+ }))
+
+ // list all blog authors
+ adminRouter.get(
+ "/authors",
+ wrapHandler(async (req, res) => {
+ const authorService: AuthorService = req.scope.resolve(
+ "authorService"
+ )
+
+ res.json({
+ authors: await authorService.list(),
+ })
+ }))
+
+ // retrieve a single blog author
+ adminRouter.get(
+ "/authors/:id",
+ wrapHandler(async (req, res) => {
+ const authorService: AuthorService = req.scope.resolve(
+ "authorService"
+ )
+
+ res.json({
+ post: await authorService.retrieve(req.params.id),
+ })
+ }))
+
+ // create a blog author
+ adminRouter.post(
+ "/authors",
+ wrapHandler(async (req, res) => {
+ const authorService: AuthorService = req.scope.resolve(
+ "authorService"
+ )
+
+ // basic validation of request body
+ if (!req.body.name) {
+ throw new Error("`name` is required.")
+ }
+
+ const author = await authorService.create(req.body)
+
+ res.json({
+ author,
+ })
+ }))
+
+ // update a blog author
+ adminRouter.post(
+ "/authors/:id",
+ wrapHandler(async (req, res) => {
+ const authorService: AuthorService = req.scope.resolve(
+ "authorService"
+ )
+
+ // basic validation of request body
+ if (req.body.id) {
+ throw new Error("Can't update author ID")
+ }
+
+ const author = await authorService.update(
+ req.params.id,
+ req.body
+ )
+
+ res.json({
+ author,
+ })
+ }))
+
+ // delete a blog author
+ adminRouter.delete(
+ "/authors/:id",
+ wrapHandler(async (req, res) => {
+ const authorService: AuthorService = req.scope.resolve(
+ "authorService"
+ )
+
+ await authorService.delete(req.params.id)
+
+ res.status(200).end()
+ }))
+ }
+ ```
+
+
+
+
+ ```ts
+ import { Router } from "express"
+ import {
+ ConfigModule,
+ } from "@medusajs/medusa/dist/types/global"
+ import PostService from "../services/post"
+ import cors from "cors"
+ import AuthorService from "../services/author"
+ import { wrapHandler } from "@medusajs/medusa"
+
+ export default function storeRoutes(
+ router: Router,
+ options: ConfigModule
+ ) {
+ const { projectConfig } = options
+
+ const storeCorsOptions = {
+ origin: projectConfig.store_cors.split(","),
+ credentials: true,
}
- const post = await postService.update(
- req.params.id,
- req.body
- )
+ const storeRouter = Router()
+ router.use("/store/blog", storeRouter)
- res.json({
- post,
- })
- }))
+ storeRouter.use(cors(storeCorsOptions))
+
+ // list all blog posts
+ storeRouter.get(
+ "/posts",
+ wrapHandler(async (req, res) => {
+ const postService: PostService = req.scope.resolve(
+ "postService"
+ )
- // delete a blog post
- adminRouter.delete(
- "/posts/:id",
- wrapHandler(async (req, res) => {
- const postService: PostService = req.scope.resolve(
- "postService"
- )
+ res.json({
+ posts: await postService.list(),
+ })
+ }))
- await postService.delete(req.params.id)
+ // retrieve a single blog post
+ storeRouter.get(
+ "/posts/:id",
+ wrapHandler(async (req, res) => {
+ const postService: PostService = req.scope.resolve(
+ "postService"
+ )
- res.status(200).end()
- }))
+ res.json({
+ post: await postService.retrieve(req.params.id),
+ })
+ }))
- // list all blog authors
- adminRouter.get(
- "/authors",
- wrapHandler(async (req, res) => {
- const authorService: AuthorService = req.scope.resolve(
- "authorService"
- )
+ // list all blog authors
+ storeRouter.get(
+ "/authors",
+ wrapHandler(async (req, res) => {
+ const authorService: AuthorService = req.scope.resolve(
+ "authorService"
+ )
- res.json({
- authors: await authorService.list(),
- })
- }))
+ res.json({
+ authors: await authorService.list(),
+ })
+ }))
- // retrieve a single blog author
- adminRouter.get(
- "/authors/:id",
- wrapHandler(async (req, res) => {
- const authorService: AuthorService = req.scope.resolve(
- "authorService"
- )
+ // retrieve a single blog author
+ storeRouter.get(
+ "/authors/:id",
+ wrapHandler(async (req, res) => {
+ const authorService: AuthorService = req.scope.resolve(
+ "authorService"
+ )
- res.json({
- post: await authorService.retrieve(req.params.id),
- })
- }))
+ res.json({
+ post: await authorService.retrieve(req.params.id),
+ })
+ }))
+ }
+ ```
- // create a blog author
- adminRouter.post(
- "/authors",
- wrapHandler(async (req, res) => {
- const authorService: AuthorService = req.scope.resolve(
- "authorService"
- )
-
- // basic validation of request body
- if (!req.body.name) {
- throw new Error("`name` is required.")
- }
-
- const author = await authorService.create(req.body)
-
- res.json({
- author,
- })
- }))
-
- // update a blog author
- adminRouter.post(
- "/authors/:id",
- wrapHandler(async (req, res) => {
- const authorService: AuthorService = req.scope.resolve(
- "authorService"
- )
-
- // basic validation of request body
- if (req.body.id) {
- throw new Error("Can't update author ID")
- }
-
- const author = await authorService.update(
- req.params.id,
- req.body
- )
-
- res.json({
- author,
- })
- }))
-
- // delete a blog author
- adminRouter.delete(
- "/authors/:id",
- wrapHandler(async (req, res) => {
- const authorService: AuthorService = req.scope.resolve(
- "authorService"
- )
-
- await authorService.delete(req.params.id)
-
- res.status(200).end()
- }))
-}
-```
-
-
-
-
-```ts
-import { Router } from "express"
-import {
- ConfigModule,
-} from "@medusajs/medusa/dist/types/global"
-import PostService from "../services/post"
-import cors from "cors"
-import AuthorService from "../services/author"
-import { wrapHandler } from "@medusajs/medusa"
-
-export default function storeRoutes(
- router: Router,
- options: ConfigModule
-) {
- const { projectConfig } = options
-
- const storeCorsOptions = {
- origin: projectConfig.store_cors.split(","),
- credentials: true,
- }
-
- const storeRouter = Router()
- router.use("/store/blog", storeRouter)
-
- storeRouter.use(cors(storeCorsOptions))
-
- // list all blog posts
- storeRouter.get(
- "/posts",
- wrapHandler(async (req, res) => {
- const postService: PostService = req.scope.resolve(
- "postService"
- )
-
- res.json({
- posts: await postService.list(),
- })
- }))
-
- // retrieve a single blog post
- storeRouter.get(
- "/posts/:id",
- wrapHandler(async (req, res) => {
- const postService: PostService = req.scope.resolve(
- "postService"
- )
-
- res.json({
- post: await postService.retrieve(req.params.id),
- })
- }))
-
- // list all blog authors
- storeRouter.get(
- "/authors",
- wrapHandler(async (req, res) => {
- const authorService: AuthorService = req.scope.resolve(
- "authorService"
- )
-
- res.json({
- authors: await authorService.list(),
- })
- }))
-
- // retrieve a single blog author
- storeRouter.get(
- "/authors/:id",
- wrapHandler(async (req, res) => {
- const authorService: AuthorService = req.scope.resolve(
- "authorService"
- )
-
- res.json({
- post: await authorService.retrieve(req.params.id),
- })
- }))
-}
-```
-
-
+
---
diff --git a/www/apps/docs/content/development/api-routes/create.mdx b/www/apps/docs/content/development/api-routes/create.mdx
index 9ce960b627..ebcbe5d0a4 100644
--- a/www/apps/docs/content/development/api-routes/create.mdx
+++ b/www/apps/docs/content/development/api-routes/create.mdx
@@ -538,25 +538,23 @@ After using `MedusaError`, the returned error in the response provides a clearer
}
```
-
-
-Available MedusaError Types and their respective status codes
-
+
+ Available MedusaError Types and their respective status codes
-The default response code is `500` unless mentioned otherwise.
+ The default response code is `500` unless mentioned otherwise.
-- `MedusaError.Types.DB_ERROR`: Sets the response code to `500`.
-- `MedusaError.Types.DUPLICATE_ERROR`: Sets the response code to `422`.
-- `MedusaError.Types.INVALID_ARGUMENT`
-- `MedusaError.Types.INVALID_DATA`: Sets the resposne code to `400`.
-- `MedusaError.Types.UNAUTHORIZED`: Sets the resposne code to `401`.
-- `MedusaError.Types.NOT_FOUND`: Sets the response code to `404`.
-- `MedusaError.Types.NOT_ALLOWED`: Sets the resposne code to `400`.
-- `MedusaError.Types.UNEXPECTED_STATE`
-- `MedusaError.Types.CONFLICT`: Sets the resposne code to `409`.
-- `MedusaError.Types.PAYMENT_AUTHORIZATION_ERROR`: Sets the resposne code to `422`.
+ - `MedusaError.Types.DB_ERROR`: Sets the response code to `500`.
+ - `MedusaError.Types.DUPLICATE_ERROR`: Sets the response code to `422`.
+ - `MedusaError.Types.INVALID_ARGUMENT`
+ - `MedusaError.Types.INVALID_DATA`: Sets the resposne code to `400`.
+ - `MedusaError.Types.UNAUTHORIZED`: Sets the resposne code to `401`.
+ - `MedusaError.Types.NOT_FOUND`: Sets the response code to `404`.
+ - `MedusaError.Types.NOT_ALLOWED`: Sets the resposne code to `400`.
+ - `MedusaError.Types.UNEXPECTED_STATE`
+ - `MedusaError.Types.CONFLICT`: Sets the resposne code to `409`.
+ - `MedusaError.Types.PAYMENT_AUTHORIZATION_ERROR`: Sets the resposne code to `422`.
-
+
### Override Error Handler
@@ -691,41 +689,41 @@ Files and directories prefixed with `_` are ignored. This can be helpful if you
For example:
-
+
-```ts
-import getProducts from "../_methods/get-products"
+ ```ts
+ import getProducts from "../_methods/get-products"
-export const GET = getProducts
-```
+ export const GET = getProducts
+ ```
-
-
+
+
-```ts
-import {
- MedusaRequest,
- MedusaResponse,
- ProductService,
-} from "@medusajs/medusa"
+ ```ts
+ import {
+ MedusaRequest,
+ MedusaResponse,
+ ProductService,
+ } from "@medusajs/medusa"
-export default async function (
- req: MedusaRequest,
- res: MedusaResponse
-) {
- const productService = req.scope.resolve(
- "productService"
- )
+ export default async function (
+ req: MedusaRequest,
+ res: MedusaResponse
+ ) {
+ const productService = req.scope.resolve(
+ "productService"
+ )
- const products = await productService.list({})
+ const products = await productService.list({})
- res.json({
- products,
- })
-}
-```
+ res.json({
+ products,
+ })
+ }
+ ```
-
+
---
@@ -741,117 +739,117 @@ You can refer to the [Entities](../entities/create.mdx#adding-relations) and [Se
:::
-
+
-```ts
-import type {
- MedusaRequest,
- MedusaResponse,
-} from "@medusajs/medusa"
-import { PostService } from "../../../services/post"
+ ```ts
+ import type {
+ MedusaRequest,
+ MedusaResponse,
+ } from "@medusajs/medusa"
+ import { PostService } from "../../../services/post"
-// list posts
-export const GET = async (
- req: MedusaRequest,
- res: MedusaResponse
-) => {
- const postService: PostService = req.scope.resolve(
- "postService"
- )
+ // list posts
+ export const GET = async (
+ req: MedusaRequest,
+ res: MedusaResponse
+ ) => {
+ const postService: PostService = req.scope.resolve(
+ "postService"
+ )
- res.json({
- posts: await postService.list(),
- })
-}
+ res.json({
+ posts: await postService.list(),
+ })
+ }
-// create a post
-export const POST = async (
- req: MedusaRequest,
- res: MedusaResponse
-) => {
- const postService: PostService = req.scope.resolve(
- "postService"
- )
+ // create a post
+ export const POST = async (
+ req: MedusaRequest,
+ res: MedusaResponse
+ ) => {
+ const postService: PostService = req.scope.resolve(
+ "postService"
+ )
- // basic validation of request body
- if (!req.body.title || !req.body.author_id) {
- throw new Error("`title` and `author_id` are required.")
- }
+ // basic validation of request body
+ if (!req.body.title || !req.body.author_id) {
+ throw new Error("`title` and `author_id` are required.")
+ }
- const post = await postService.create(req.body)
+ const post = await postService.create(req.body)
- res.json({
- post,
- })
-}
-```
+ res.json({
+ post,
+ })
+ }
+ ```
-
-
+
+
-```ts
-import type {
- MedusaRequest,
- MedusaResponse,
-} from "@medusajs/medusa"
-import { PostService } from "../../../services/post"
+ ```ts
+ import type {
+ MedusaRequest,
+ MedusaResponse,
+ } from "@medusajs/medusa"
+ import { PostService } from "../../../services/post"
-// retrieve a post by its ID
-export const GET = async (
- req: MedusaRequest,
- res: MedusaResponse
-) => {
- const postService: PostService = req.scope.resolve(
- "postService"
- )
+ // retrieve a post by its ID
+ export const GET = async (
+ req: MedusaRequest,
+ res: MedusaResponse
+ ) => {
+ const postService: PostService = req.scope.resolve(
+ "postService"
+ )
- const post = await postService.retrieve(req.params.id)
+ const post = await postService.retrieve(req.params.id)
- res.json({
- post,
- })
-}
+ res.json({
+ post,
+ })
+ }
-// update a post by its ID
-export const POST = async (
- req: MedusaRequest,
- res: MedusaResponse
-) => {
- const postService: PostService = req.scope.resolve(
- "postService"
- )
+ // update a post by its ID
+ export const POST = async (
+ req: MedusaRequest,
+ res: MedusaResponse
+ ) => {
+ const postService: PostService = req.scope.resolve(
+ "postService"
+ )
- // basic validation of request body
- if (req.body.id) {
- throw new Error("Can't update post ID")
- }
+ // basic validation of request body
+ if (req.body.id) {
+ throw new Error("Can't update post ID")
+ }
- const post = await postService.update(
- req.params.id,
- req.body
- )
+ const post = await postService.update(
+ req.params.id,
+ req.body
+ )
- res.json({
- post,
- })
-}
+ res.json({
+ post,
+ })
+ }
-// delete a post by its ID
-export const DELETE = async (
- req: MedusaRequest,
- res: MedusaResponse
-) => {
- const postService: PostService = req.scope.resolve(
- "postService"
- )
+ // delete a post by its ID
+ export const DELETE = async (
+ req: MedusaRequest,
+ res: MedusaResponse
+ ) => {
+ const postService: PostService = req.scope.resolve(
+ "postService"
+ )
- await postService.delete(req.params.id)
+ await postService.delete(req.params.id)
- res.status(200).end()
-}
-```
+ res.status(200).end()
+ }
+ ```
-
+
---
diff --git a/www/apps/docs/content/development/backend/prepare-environment.mdx b/www/apps/docs/content/development/backend/prepare-environment.mdx
index 96e117cc94..f898968c18 100644
--- a/www/apps/docs/content/development/backend/prepare-environment.mdx
+++ b/www/apps/docs/content/development/backend/prepare-environment.mdx
@@ -25,60 +25,48 @@ node -v
:::
-
+
+ You can install the executable directly from [the Node.js website](https://nodejs.org/en/#home-downloadhead).
-You can install the executable directly from [the Node.js website](https://nodejs.org/en/#home-downloadhead).
+ For other approaches, you can check out [Node.js’s guide](https://nodejs.org/en/download/package-manager/#windows-1).
+
+
+ You can use the following commands to install Node.js on Ubuntu:
-For other approaches, you can check out [Node.js’s guide](https://nodejs.org/en/download/package-manager/#windows-1).
+ ```bash
+ #Ubuntu
+ sudo apt update
+ sudo apt install nodejs
+ ```
-
-
+ For other Linux distributions, you can check out [Node.js’s guide](https://nodejs.org/en/download/package-manager/).
+
+
+ You can use the following commands to install Node.js on macOS:
-You can use the following commands to install Node.js on Ubuntu:
+
+
+ ```bash
+ brew install node
+ ```
+
+
+ ```bash
+ curl \
+ "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- \
+ https://nodejs.org/dist/latest/ | sed -nE \
+ 's|.*>node-(.*)\.pkg.*|\1|p')}.pkg" \
+ > "$HOME/Downloads/node-latest.pkg" &&
+ sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"
+ ```
+
+
-```bash
-#Ubuntu
-sudo apt update
-sudo apt install nodejs
-```
+ For other approaches, you can check out [Node.js’s guide](https://nodejs.org/en/download/package-manager/#macos).
-For other Linux distributions, you can check out [Node.js’s guide](https://nodejs.org/en/download/package-manager/).
+ Make sure that you have Xcode command line tools installed. If not, run the following command to install it: `xcode-select --install`.
-
-
-
-You can use the following commands to install Node.js on macOS:
-
-
-
-
-```bash
-brew install node
-```
-
-
-
-
-```bash
-curl \
- "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- \
- https://nodejs.org/dist/latest/ | sed -nE \
- 's|.*>node-(.*)\.pkg.*|\1|p')}.pkg" \
- > "$HOME/Downloads/node-latest.pkg" &&
- sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"
-```
-
-
-
-
-For other approaches, you can check out [Node.js’s guide](https://nodejs.org/en/download/package-manager/#macos).
-
-:::tip
-
-Make sure that you have Xcode command line tools installed; if not, run the following command to install it: `xcode-select --install`
-
-:::
-
+
## Git
@@ -86,35 +74,29 @@ Make sure that you have Xcode command line tools installed; if not, run the fol
Medusa uses Git behind the scenes when you create a new project. So, you'll have to install it on your machine to get started.
-
+
+ To install Git on Windows, you need to [download the installable package](https://git-scm.com/download/win).
+
+
+ For Debian/Ubuntu, you can use the following command:
-To install Git on Windows, you need to [download the installable package](https://git-scm.com/download/win).
+ ```bash
+ apt-get install git
+ ```
-
-
+ As for other Linux distributions, please check [git’s guide](https://git-scm.com/download/linux).
+
+
+ You should already have Git installed as part of the Xcode command-line tools.
-For Debian/Ubuntu, you can use the following command:
+ However, if for any reason you need to install it manually, you can install it with Homebrew:
-```bash
-apt-get install git
-```
+ ```bash
+ brew install git
+ ```
-As for other Linux distributions, please check [git’s guide](https://git-scm.com/download/linux).
-
-
-
-
-You should already have Git installed as part of the Xcode command-line tools.
-
-However, if for any reason you need to install it manually, you can install it with Homebrew:
-
-```bash
-brew install git
-```
-
-You can also check out [git’s guide](https://git-scm.com/download/mac) for more installation options.
-
-
+ You can also check out [git’s guide](https://git-scm.com/download/mac) for more installation options.
+
## PostgreSQL
@@ -122,32 +104,26 @@ You can also check out [git’s guide](https://git-scm.com/download/mac) for mor
The Medusa backend uses PostgreSQL to store data of your commerce system.
-
+
+ You can [download the PostgreSQL Windows installer](https://www.postgresql.org/download/windows/) from their website.
+
+
+ If you’re using Ubuntu, you can use the following commands to download and install PostgreSQL:
-You can [download the PostgreSQL Windows installer](https://www.postgresql.org/download/windows/) from their website.
+ ```bash
+ sudo sh -c \
+ 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
+ wget --quiet -O - \
+ https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
+ sudo apt-get update
+ sudo apt-get -y install postgresql
+ ```
-
-
-
-If you’re using Ubuntu, you can use the following commands to download and install PostgreSQL:
-
-```bash
-sudo sh -c \
- 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
-wget --quiet -O - \
- https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
-sudo apt-get update
-sudo apt-get -y install postgresql
-```
-
-For other distributions, you can check out [PostgreSQL’s website for more guides](https://www.postgresql.org/download/linux/).
-
-
-
-
-You can download PostgreSQL on your macOS using [the installer on their website](https://www.postgresql.org/download/macosx/).
-
-
+ For other distributions, you can check out [PostgreSQL’s website for more guides](https://www.postgresql.org/download/linux/).
+
+
+ You can download PostgreSQL on your macOS using [the installer on their website](https://www.postgresql.org/download/macosx/).
+
## (Optional) Medusa CLI
diff --git a/www/apps/docs/content/development/batch-jobs/create.mdx b/www/apps/docs/content/development/batch-jobs/create.mdx
index 20574693b1..c32e682c9a 100644
--- a/www/apps/docs/content/development/batch-jobs/create.mdx
+++ b/www/apps/docs/content/development/batch-jobs/create.mdx
@@ -293,54 +293,54 @@ The first step is to create a batch job using the [Create Batch Job API Route](h
For example, this creates a batch job of the type `publish-products`:
-
+
-```jsx
-medusa.admin.batchJobs.create({
- type: "publish-products",
- context: { },
- dry_run: true,
-})
-.then(( batch_job ) => {
- console.log(batch_job.status)
-})
-```
+ ```jsx
+ medusa.admin.batchJobs.create({
+ type: "publish-products",
+ context: { },
+ dry_run: true,
+ })
+ .then(( batch_job ) => {
+ console.log(batch_job.status)
+ })
+ ```
-
-
+
+
-```jsx
-fetch(`/admin/batch-jobs`, {
- method: "POST",
- credentials: "include",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify({
- type: "publish-products",
- context: { },
- dry_run: true,
- }),
-})
-.then((response) => response.json())
-.then(({ batch_job }) => {
- console.log(batch_job.status)
-})
-```
+ ```jsx
+ fetch(`/admin/batch-jobs`, {
+ method: "POST",
+ credentials: "include",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ type: "publish-products",
+ context: { },
+ dry_run: true,
+ }),
+ })
+ .then((response) => response.json())
+ .then(({ batch_job }) => {
+ console.log(batch_job.status)
+ })
+ ```
-
-
+
+
-```bash
-curl -L -X POST '/admin/batch-jobs' \
--H 'Authorization: Bearer ' \
--H 'Content-Type: application/json' \
---data-raw '{
- "type": "publish-products",
- "context": { },
- "dry_run": true
-}'
-```
+ ```bash
+ curl -L -X POST '/admin/batch-jobs' \
+ -H 'Authorization: Bearer ' \
+ -H 'Content-Type: application/json' \
+ --data-raw '{
+ "type": "publish-products",
+ "context": { },
+ "dry_run": true
+ }'
+ ```
@@ -354,38 +354,38 @@ Make sure to replace `` with the backend URL where applicable.
You can retrieve the batch job afterward to get its status and view details about the process in the `result` property:
-
+
-```jsx
-medusa.admin.batchJobs.retrieve(batchJobId)
-.then(( batch_job ) => {
- console.log(batch_job.status, batch_job.result)
-})
-```
+ ```jsx
+ medusa.admin.batchJobs.retrieve(batchJobId)
+ .then(( batch_job ) => {
+ console.log(batch_job.status, batch_job.result)
+ })
+ ```
-
-
+
+
-```jsx
-fetch(`/admin/batch-jobs/${batchJobId}`, {
- credentials: "include",
-})
-.then((response) => response.json())
-.then(({ batch_job }) => {
- console.log(batch_job.status, batch_job.result)
-})
-```
+ ```jsx
+ fetch(`/admin/batch-jobs/${batchJobId}`, {
+ credentials: "include",
+ })
+ .then((response) => response.json())
+ .then(({ batch_job }) => {
+ console.log(batch_job.status, batch_job.result)
+ })
+ ```
-
-
+
+
-```bash
-curl -L -X GET '/admin/batch-jobs/' \
--H 'Authorization: Bearer '
-# is the ID of the batch job
-```
+ ```bash
+ curl -L -X GET '/admin/batch-jobs/' \
+ -H 'Authorization: Bearer '
+ # is the ID of the batch job
+ ```
-
+
Based on the batch job strategy implemented in this documentation, the `result` property could be something like this:
@@ -409,39 +409,39 @@ Based on the batch job strategy implemented in this documentation, the `result`
To process the batch job, send a request to [confirm the batch job](https://docs.medusajs.com/api/admin#batch-jobs_postbatchjobsbatchjobconfirmprocessing):
-
+
-```jsx
-medusa.admin.batchJobs.confirm(batchJobId)
-.then(( batch_job ) => {
- console.log(batch_job.status)
-})
-```
+ ```jsx
+ medusa.admin.batchJobs.confirm(batchJobId)
+ .then(( batch_job ) => {
+ console.log(batch_job.status)
+ })
+ ```
-
-
+
+
-```jsx
-fetch(`/admin/batch-jobs/${batchJobId}/confirm`, {
- method: "POST",
- credentials: "include",
-})
-.then((response) => response.json())
-.then(({ batch_job }) => {
- console.log(batch_job.status)
-})
-```
+ ```jsx
+ fetch(`/admin/batch-jobs/${batchJobId}/confirm`, {
+ method: "POST",
+ credentials: "include",
+ })
+ .then((response) => response.json())
+ .then(({ batch_job }) => {
+ console.log(batch_job.status)
+ })
+ ```
-
-
+
+
-```bash
-curl -L -X POST '/admin/batch-jobs//confirm' \
--H 'Authorization: Bearer '
-# is the ID of the batch job
-```
+ ```bash
+ curl -L -X POST '/admin/batch-jobs//confirm' \
+ -H 'Authorization: Bearer '
+ # is the ID of the batch job
+ ```
-
+
The batch job will start processing afterward. Based on the batch job strategy implemented in this documentation, draft products will be published.
diff --git a/www/apps/docs/content/development/entities/create.mdx b/www/apps/docs/content/development/entities/create.mdx
index fc4f1c1dad..c80030d9fc 100644
--- a/www/apps/docs/content/development/entities/create.mdx
+++ b/www/apps/docs/content/development/entities/create.mdx
@@ -70,71 +70,71 @@ Your entity may be related to another entity. You can showcase the relation with
For example, you can create another entity `Author` and add a `ManyToOne` relation to it from the `Post`, and a `OneToMany` relation from the `Author` to the `Post`:
-
+
-```ts
-import {
- BeforeInsert,
- Column,
- Entity,
- JoinColumn,
- ManyToOne,
-} from "typeorm"
-import { BaseEntity } from "@medusajs/medusa"
-import { generateEntityId } from "@medusajs/medusa/dist/utils"
-import { Author } from "./author"
+ ```ts
+ import {
+ BeforeInsert,
+ Column,
+ Entity,
+ JoinColumn,
+ ManyToOne,
+ } from "typeorm"
+ import { BaseEntity } from "@medusajs/medusa"
+ import { generateEntityId } from "@medusajs/medusa/dist/utils"
+ import { Author } from "./author"
-@Entity()
-export class Post extends BaseEntity {
- @Column({ type: "varchar" })
- title: string | null
+ @Entity()
+ export class Post extends BaseEntity {
+ @Column({ type: "varchar" })
+ title: string | null
- @Column({ type: "varchar" })
- author_id: string
+ @Column({ type: "varchar" })
+ author_id: string
- @ManyToOne(() => Author, (author) => author.posts)
- @JoinColumn({ name: "author_id" })
- author: Author
+ @ManyToOne(() => Author, (author) => author.posts)
+ @JoinColumn({ name: "author_id" })
+ author: Author
- @BeforeInsert()
- private beforeInsert(): void {
- this.id = generateEntityId(this.id, "post")
- }
-}
-```
+ @BeforeInsert()
+ private beforeInsert(): void {
+ this.id = generateEntityId(this.id, "post")
+ }
+ }
+ ```
-
-
+
+
-```ts
-import { BaseEntity, generateEntityId } from "@medusajs/medusa"
-import {
- BeforeInsert,
- Column,
- Entity,
- OneToMany,
-} from "typeorm"
-import { Post } from "./post"
+ ```ts
+ import { BaseEntity, generateEntityId } from "@medusajs/medusa"
+ import {
+ BeforeInsert,
+ Column,
+ Entity,
+ OneToMany,
+ } from "typeorm"
+ import { Post } from "./post"
-@Entity()
-export class Author extends BaseEntity {
- @Column({ type: "varchar" })
- name: string
+ @Entity()
+ export class Author extends BaseEntity {
+ @Column({ type: "varchar" })
+ name: string
- @Column({ type: "varchar", nullable: true })
- image?: string
+ @Column({ type: "varchar", nullable: true })
+ image?: string
- @OneToMany(() => Post, (post) => post.author)
- posts: Post[]
+ @OneToMany(() => Post, (post) => post.author)
+ posts: Post[]
- @BeforeInsert()
- private beforeInsert(): void {
- this.id = generateEntityId(this.id, "auth")
- }
-}
-```
+ @BeforeInsert()
+ private beforeInsert(): void {
+ this.id = generateEntityId(this.id, "auth")
+ }
+ }
+ ```
-
+
Adding these relations allows you to later on expand these relations when retrieving records of this entity with repositories.
diff --git a/www/apps/docs/content/development/plugins/create.mdx b/www/apps/docs/content/development/plugins/create.mdx
index bd4a7fa402..d0283ffe52 100644
--- a/www/apps/docs/content/development/plugins/create.mdx
+++ b/www/apps/docs/content/development/plugins/create.mdx
@@ -417,24 +417,21 @@ While you develop your plugin, you’ll need to test it on an actual Medusa back
+ In the root of your plugin directory, run the `build` command:
- In the root of your plugin directory, run the `build` command:
-
- ```bash
- npm run build
- ```
+ ```bash
+ npm run build
+ ```
+ In the root of your plugin directory, run the `prepare` command:
- In the root of your plugin directory, run the `prepare` command:
-
- ```bash
- npm run prepare
- ```
-
- If the `prepare` script is not available in your project, you can find it in [this section](#changes-for-admin-plugins).
+ ```bash
+ npm run prepare
+ ```
+ If the `prepare` script is not available in your project, you can find it in [this section](#changes-for-admin-plugins).
@@ -499,30 +496,30 @@ In the directory of the Medusa backend, start the backend with the `dev` command
- ```bash
- npm run dev -- -- --preserve-symlinks
- ```
+ ```bash
+ npm run dev -- -- --preserve-symlinks
+ ```
- ```bash
- yarn dev -- -- --preserve-symlinks
- ```
+ ```bash
+ yarn dev -- -- --preserve-symlinks
+ ```
- ```bash
- yarn dev -- --preserve-symlinks
- ```
+ ```bash
+ yarn dev -- --preserve-symlinks
+ ```
- ```bash
- pnpm run dev -- -- --preserve-symlinks
- ```
+ ```bash
+ pnpm run dev -- -- --preserve-symlinks
+ ```
diff --git a/www/apps/docs/content/development/plugins/publish.mdx b/www/apps/docs/content/development/plugins/publish.mdx
index 59b760eaac..50dbfce9ce 100644
--- a/www/apps/docs/content/development/plugins/publish.mdx
+++ b/www/apps/docs/content/development/plugins/publish.mdx
@@ -45,40 +45,36 @@ Before publishing your plugin, make sure you've set the following fields in your
+ Make sure you add the `publish` script to your `scripts` field:
- Make sure you add the `publish` script to your `scripts` field:
+ ```json title=package.json
+ "scripts": {
+ // other scripts...
+ "build": "cross-env npm run clean && tsc -p tsconfig.json",
+ "prepare": "cross-env NODE_ENV=production npm run build"
+ }
+ ```
- ```json title=package.json
- "scripts": {
- // other scripts...
- "build": "cross-env npm run clean && tsc -p tsconfig.json",
- "prepare": "cross-env NODE_ENV=production npm run build"
- }
- ```
-
- The `build` script ensures that the plugin's built files are placed as explained in the [plugin structure](./create.mdx#plugin-structure) section of the Create Plugin documentation.
-
- The `prepare` script facilitates your publishing process. You would typically run this script before publishing your plugin.
+ The `build` script ensures that the plugin's built files are placed as explained in the [plugin structure](./create.mdx#plugin-structure) section of the Create Plugin documentation.
+ The `prepare` script facilitates your publishing process. You would typically run this script before publishing your plugin.
+ First, make sure to change `tsconfig` files as recommended in the [create guide](./create.mdx#changes-for-admin-plugins).
- First, make sure to change `tsconfig` files as recommended in the [create guide](./create.mdx#changes-for-admin-plugins).
+ Then, add the following `prepare` and `build` scripts to your `scripts`
- Then, add the following `prepare` and `build` scripts to your `scripts`
-
- ```json title=package.json
- "scripts": {
- // other scripts...
- "build:server": "cross-env npm run clean && tsc -p tsconfig.json",
- "prepare": "cross-env NODE_ENV=production npm run build:server && medusa-admin bundle"
- }
- ```
-
- The `build:server` script builds the resources of the backend for development and ensures they are placed as explained in the [plugin structure](./create.mdx#plugin-structure) section of the Create Plugin documentation.
-
- The `prepare` script creates a production build of both backend and admin resources.
+ ```json title=package.json
+ "scripts": {
+ // other scripts...
+ "build:server": "cross-env npm run clean && tsc -p tsconfig.json",
+ "prepare": "cross-env NODE_ENV=production npm run build:server && medusa-admin bundle"
+ }
+ ```
+ The `build:server` script builds the resources of the backend for development and ensures they are placed as explained in the [plugin structure](./create.mdx#plugin-structure) section of the Create Plugin documentation.
+
+ The `prepare` script creates a production build of both backend and admin resources.
diff --git a/www/apps/docs/content/development/publishable-api-keys/admin/manage-publishable-api-keys.mdx b/www/apps/docs/content/development/publishable-api-keys/admin/manage-publishable-api-keys.mdx
index cf9b9e59d7..08bed97415 100644
--- a/www/apps/docs/content/development/publishable-api-keys/admin/manage-publishable-api-keys.mdx
+++ b/www/apps/docs/content/development/publishable-api-keys/admin/manage-publishable-api-keys.mdx
@@ -64,73 +64,73 @@ You can learn more about [authenticating as an admin user in the API reference](
You can retrieve a list of publishable API keys by sending a request to the [List Publishable API Keys route](https://docs.medusajs.com/api/admin#publishable-api-keys_getpublishableapikeys):
-
+
-```ts
-medusa.admin.publishableApiKeys.list()
-.then(({ publishable_api_keys, count, limit, offset }) => {
- console.log(publishable_api_keys)
-})
-```
+ ```ts
+ medusa.admin.publishableApiKeys.list()
+ .then(({ publishable_api_keys, count, limit, offset }) => {
+ console.log(publishable_api_keys)
+ })
+ ```
-
-
+
+
-```tsx
-import { PublishableApiKey } from "@medusajs/medusa"
-import { useAdminPublishableApiKeys } from "medusa-react"
+ ```tsx
+ import { PublishableApiKey } from "@medusajs/medusa"
+ import { useAdminPublishableApiKeys } from "medusa-react"
-const PublishabelApiKeys = () => {
- const { publishable_api_keys, isLoading } =
- useAdminPublishableApiKeys()
+ const PublishabelApiKeys = () => {
+ const { publishable_api_keys, isLoading } =
+ useAdminPublishableApiKeys()
- return (
-
+ )
+ }
-export default Order
-```
+ export default Order
+ ```
-
-
+
+
-```ts
-fetch(`/store/orders/cart/${cartId}`, {
- credentials: "include",
-})
-.then((response) => response.json())
-.then(({ order }) => {
- console.log(order.id)
-})
-```
+ ```ts
+ fetch(`/store/orders/cart/${cartId}`, {
+ credentials: "include",
+ })
+ .then((response) => response.json())
+ .then(({ order }) => {
+ console.log(order.id)
+ })
+ ```
-
+
This API Route requires the ID of the cart as a path parameter.
diff --git a/www/apps/docs/content/modules/price-lists/admin/_import-prices.mdx b/www/apps/docs/content/modules/price-lists/admin/_import-prices.mdx
index 35a91fcb4a..446f3ee75d 100644
--- a/www/apps/docs/content/modules/price-lists/admin/_import-prices.mdx
+++ b/www/apps/docs/content/modules/price-lists/admin/_import-prices.mdx
@@ -3,8 +3,9 @@ description: 'Learn how to bulk-import prices into Medusa using the Admin REST A
addHowToData: true
---
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
+import Tabs from '@theme/Tabs'
+import TabItem from '@theme/TabItem'
+import Details from "@site/src/theme/MDXProvider/Details"
# How to Bulk Import Prices
@@ -39,81 +40,79 @@ Part of the process of importing prices is uploading a CSV file. This requires a
You must have a CSV file that you will use to import prices into your Medusa backend. You can check [this CSV example file](https://medusa-doc-files.s3.amazonaws.com/price-list-import-template.csv) to see which format is required for your import.
-
-
-Expected columns
-
+
+ Expected columns
-
-
-
-
-Column Name
-
-
-Description
-
-
-Is required?
-
-
-
+
+
+
+
+ Column Name
+
+
+ Description
+
+
+ Is required?
+
+
+
-
+
-
-
-Product Variant ID
-
-
-The ID of the product variant this price belongs to.
-
-
-Either this or the SKU column are required.
-
-
+
+
+ Product Variant ID
+
+
+ The ID of the product variant this price belongs to.
+
+
+ Either this or the SKU column are required.
+
+
-
-
-SKU
-
-
-The SKU of the product variant this price belongs to.
-
-
-Either this or the Product Variant ID column are required.
-
-
+
+
+ SKU
+
+
+ The SKU of the product variant this price belongs to.
+
+
+ Either this or the Product Variant ID column are required.
+
+
-
-
-Price (region name)
-
-
-The price amount in a region, where (region name) is the name of the region.
-
-
-No
-
-
+
+
+ Price (region name)
+
+
+ The price amount in a region, where (region name) is the name of the region.
+
+
+ No
+
+
-
-
-Price (currency code)
-
-
-The price amount for a currency, where (currency code) is the 3 character iso code of the currency. For example, "Price USD".
-
-
-No
-
-
+
+
+ Price (currency code)
+
+
+ The price amount for a currency, where (currency code) is the 3 character iso code of the currency. For example, "Price USD".
+
+
+ No
+
+
-
+
-
+
-
+
### JS Client
@@ -148,67 +147,67 @@ The first step is to upload the CSV file to import prices from.
You can do that by sending the following request to the [Upload Files API Route](https://docs.medusajs.com/api/admin#uploads_postuploads):
-
+
-```ts
-medusa.admin.uploads.create(file) // file is an instance of File
-.then(({ uploads }) => {
- const key = uploads[0].key
-})
-```
+ ```ts
+ medusa.admin.uploads.create(file) // file is an instance of File
+ .then(({ uploads }) => {
+ const key = uploads[0].key
+ })
+ ```
-
-
+
+
-```tsx
-import { useAdminUploadFile } from "medusa-react"
+ ```tsx
+ import { useAdminUploadFile } from "medusa-react"
-const ImportPrices = () => {
- const uploadFile = useAdminUploadFile()
- // ...
+ const ImportPrices = () => {
+ const uploadFile = useAdminUploadFile()
+ // ...
- const handleFileUpload = (file: File) => {
- uploadFile.mutate(file)
- }
+ const handleFileUpload = (file: File) => {
+ uploadFile.mutate(file)
+ }
- // ...
-}
+ // ...
+ }
-export default ImportPrices
-```
+ export default ImportPrices
+ ```
-
-
+
+
-```ts
-const formData = new FormData()
-formData.append("files", file) // file is an instance of File
+ ```ts
+ const formData = new FormData()
+ formData.append("files", file) // file is an instance of File
-fetch(`/admin/uploads`, {
- method: "POST",
- credentials: "include",
- headers: {
- "Content-Type": "multipart/form-data",
- },
- body: formData,
-})
-.then((response) => response.json())
-.then(({ uploads }) => {
- const key = uploads[0].key
-})
-```
+ fetch(`/admin/uploads`, {
+ method: "POST",
+ credentials: "include",
+ headers: {
+ "Content-Type": "multipart/form-data",
+ },
+ body: formData,
+ })
+ .then((response) => response.json())
+ .then(({ uploads }) => {
+ const key = uploads[0].key
+ })
+ ```
-
-
+
+
-```bash
-curl -L -X POST '/admin/uploads' \
- -H 'Authorization: Bearer {api_token}' \
- -H 'Content-Type: text/csv' \
- -F 'files=@""'
-```
+ ```bash
+ curl -L -X POST '/admin/uploads' \
+ -H 'Authorization: Bearer {api_token}' \
+ -H 'Content-Type: text/csv' \
+ -F 'files=@""'
+ ```
-
+
This request returns an array of uploads. Each item in the array is an object that includes the properties `url` and `key`. You’ll need the `key` to import the prices next.
@@ -222,93 +221,93 @@ To start a new price import, you must create a batch job.
You can do that by sending the following request to the [Create a Batch Job API Route](https://docs.medusajs.com/api/admin#batch-jobs_postbatchjobs):
-
+
-```ts
-medusa.admin.batchJobs.create({
- type: "price-list-import",
- context: {
- fileKey: key, // obtained from previous step
- price_list_id,
- },
- dry_run: true,
-})
-.then(( batch_job ) => {
- console.log(batch_job.status)
-})
-```
-
-
-
-
-```tsx
-import { useAdminCreateBatchJob } from "medusa-react"
-
-const ImportPrices = () => {
- const createBatchJob = useAdminCreateBatchJob()
- // ...
-
- const handleCreateBatchJob = () => {
- createBatchJob.mutate({
+ ```ts
+ medusa.admin.batchJobs.create({
type: "price-list-import",
context: {
fileKey: key, // obtained from previous step
+ price_list_id,
},
dry_run: true,
})
- }
+ .then(( batch_job ) => {
+ console.log(batch_job.status)
+ })
+ ```
- // ...
-}
+
+
-export default ImportPrices
-```
+ ```tsx
+ import { useAdminCreateBatchJob } from "medusa-react"
-
-
+ const ImportPrices = () => {
+ const createBatchJob = useAdminCreateBatchJob()
+ // ...
-```ts
-fetch(`/admin/batch-jobs`, {
- method: "POST",
- credentials: "include",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify({
- type: "price-list-import",
- context: {
- fileKey: key, // obtained from previous step
- price_list_id,
- },
- dry_run: true,
- }),
-})
-.then((response) => response.json())
-.then(({ batch_job }) => {
- console.log(batch_job.status)
-})
-```
+ const handleCreateBatchJob = () => {
+ createBatchJob.mutate({
+ type: "price-list-import",
+ context: {
+ fileKey: key, // obtained from previous step
+ },
+ dry_run: true,
+ })
+ }
-
-
+ // ...
+ }
-```bash
-curl -L -X POST '/admin/batch-jobs' \
--H 'Authorization: Bearer {api_token}' \
--H 'Content-Type: application/json' \
---data-raw '{
- "type": "price-list-import",
- "context": {
- "fileKey": "",
- "price_list_id": ""
- },
- "dry_run": true
-}'
-# is the key you obtained from the previous step
-# is the ID of the price list to import prices into
-```
+ export default ImportPrices
+ ```
-
+
+
+
+ ```ts
+ fetch(`/admin/batch-jobs`, {
+ method: "POST",
+ credentials: "include",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ type: "price-list-import",
+ context: {
+ fileKey: key, // obtained from previous step
+ price_list_id,
+ },
+ dry_run: true,
+ }),
+ })
+ .then((response) => response.json())
+ .then(({ batch_job }) => {
+ console.log(batch_job.status)
+ })
+ ```
+
+
+
+
+ ```bash
+ curl -L -X POST '/admin/batch-jobs' \
+ -H 'Authorization: Bearer {api_token}' \
+ -H 'Content-Type: application/json' \
+ --data-raw '{
+ "type": "price-list-import",
+ "context": {
+ "fileKey": "",
+ "price_list_id": ""
+ },
+ "dry_run": true
+ }'
+ # is the key you obtained from the previous step
+ # is the ID of the price list to import prices into
+ ```
+
+
In the body of the request, you must pass the following parameters:
@@ -336,65 +335,65 @@ After creating the batch job, it will be pre-processed. At this point, the CSV f
You can retrieve all the details of the batch job, including its status and the brief statistics related to the prices by sending the following request:
-
+
-```ts
-medusa.admin.batchJobs.retrieve(batchJobId)
-.then(( batch_job ) => {
- console.log(batch_job.status, batch_job.result)
-})
-```
+ ```ts
+ medusa.admin.batchJobs.retrieve(batchJobId)
+ .then(( batch_job ) => {
+ console.log(batch_job.status, batch_job.result)
+ })
+ ```
-
-
+
+
-```tsx
-import { useAdminBatchJob } from "medusa-react"
+ ```tsx
+ import { useAdminBatchJob } from "medusa-react"
-const ImportPrices = () => {
- const { batch_job, isLoading } = useAdminBatchJob(batchJobId)
- // ...
+ const ImportPrices = () => {
+ const { batch_job, isLoading } = useAdminBatchJob(batchJobId)
+ // ...
- return (
-
-The status of the product. Its value can be `draft`, `proposed`, `published`, or `rejected`.
-
-
-No
-
-
-
-
-
-Product Thumbnail
-
-
-A URL to the thumbnail of the product
-
-
-No
-
-
-
-
-
-Image (number) Url
-
-
-A URL to a product image. To add more than one image, you can specify the image number in the column title. For example, "Image 1 Url".
-
-
-No
-
-
-
-
-
-Product Weight
-
-
-The weight of the product
-
-
-No
-
-
-
-
-
-Product Length
-
-
-The length of the product
-
-
-No
-
-
-
-
-
-Product Width
-
-
-The width of the product
-
-
-No
-
-
-
-
-
-Product Height
-
-
-The height of the product
-
-
-No
-
-
-
-
-
-Product HS Code
-
-
-The HS Code of the product
-
-
-No
-
-
-
-
-
-Product Origin Country
-
-
-The origin country of the product
-
-
-No
-
-
-
-
-
-Product MID Code
-
-
-The MID code of the product
-
-
-No
-
-
-
-
-
-Product Material
-
-
-The material of the product
-
-
-No
-
-
-
-
-
-Product Discountable
-
-
-A boolean value indicating whether the product is discountable.
-
-
-No
-
-
-
-
-
-Product External Id
-
-
-The external ID of the product. Useful if the product is being imported from another platform and you want to maintain the link to it.
-
-
-No
-
-
-
-
-
-Product Profile Name
-
-
-The name of the product's shipping profile.
-
-
-No
-
-
-
-
-
-Product Profile Type
-
-
-The type of the product's shipping profile. Its value can be `default`, `gift_card`, or `custom`.
-
-
-No
-
-
-
-
-
-
-#### Product Collection columns
-
-:::note
-
-A product collection is only associated with the product if the handle provided exists. Otherwise, it's skipped.
-
-:::
-
-
-
-
-
-Column name
-
-
-Description
-
-
-Is required?
-
-
-
-
-
-
-
-
-Product Collection Title
-
-
-The title of the product collection
-
-
-No
-
-
-
-
-
-Product Collection Handle
-
-
-The handle of the product collection
-
-
-No
-
-
-
-
-
-
-#### Product Type columns
-
-
-
-
-
-Column name
-
-
-Description
-
-
-Is required?
-
-
-
-
-
-
-
-
-Product Type
-
-
-The value of the product type
-
-
-No
-
-
-
-
-
-
-#### Product Tag columns
-
-
-
-
-
-Column name
-
-
-Description
-
-
-Is required?
-
-
-
-
-
-
-
-
-Product Tags
-
-
-A comma-separated list of product tags
-
-
-No
-
-
-
-
-
-
-#### Product Option columns
-
-
-
-
-
-Column name
-
-
-Description
-
-
-Is required?
-
-
-
-
-
-
-
-
-"Option Name" or "Option (number) Name"
-
-
-The name of the product option. If you name the column "Option Name", it means only one option will be added, and there should be no duplicate column with the same name for another option. To add more than one option, use the "Option (number) Name" name. For example, "Option 1 Name".
-
-
-No
-
-
-
-
-
-"Option Value" or "Option (number) Value"
-
-
-The value of the product option. If you name the column "Option Value", it means only one option will be added, and there should be no duplicate column with the same name for another option. To add more than one option value, use the "Option (number) Value" name. For example, "Option 1 Value". The number of the value should correspond to the same option name number.
-
-
-No
-
-
-
-
-
-
-#### Product Variant Columns
-
-
-
-
-
-Column name
-
-
-Description
-
-
-Is required?
-
-
-
-
-
-
-
-
-Variant Id
-
-
-The ID of the product variant
-
-
-No
-
-
-
-
-
-Variant Title
-
-
-The title of the product variant
-
-
-No
-
-
-
-
-
-Variant SKU
-
-
-The SKU of the product variant
-
-
-No
-
-
-
-
-
-Variant Barcode
-
-
-The barcode of the product variant
-
-
-No
-
-
-
-
-
-Variant Inventory Quantity
-
-
-The inventory quantity of the product variant
-
-
-No
-
-
-
-
-
-Variant Allow Backorder
-
-
-A boolean value indicating if the variant can be back-ordered.
-
-
-No
-
-
-
-
-
-Variant Manage Inventory
-
-
-A boolean value indicating if the variant's inventory can be managed.
-
-
-No
-
-
-
-
-
-Variant Weight
-
-
-The weight of the product variant
-
-
-No
-
-
-
-
-
-Variant Length
-
-
-The length of the product variant
-
-
-No
-
-
-
-
-
-Variant Width
-
-
-The width of the product variant
-
-
-No
-
-
-
-
-
-Variant Height
-
-
-The height of the product variant
-
-
-No
-
-
-
-
-
-Variant HS Code
-
-
-The HS Code of the product variant
-
-
-No
-
-
-
-
-
-Variant Origin Country
-
-
-The origin country of the product variant
-
-
-No
-
-
-
-
-
-Variant MID Code
-
-
-The MID code of the product variant
-
-
-No
-
-
-
-
-
-Variant Material
-
-
-The material of the product variant
-
-
-No
-
-
-
-
-
-
-#### Prices columns
-
-
-
-
-
-Column name
-
-
-Description
-
-
-Is required?
-
-
-
-
-
-
-
-
-Price (region name)
-
-
-The price amount for a particular region, where (region name) is the name of the region.
-
-
-No
-
-
-
-
-
-Price (currency code)
-
-
-The price amount for a particular currency, where (currency code) is the 3 character ISO code of the currency. For example, "Price USD".
-
-
-No
-
-
-
-
-
-
-#### Sales channel columns
-
-
-
-
-
-Column name
-
-
-Description
-
-
-Is required?
-
-
-
-
-
-
-
-
-Sales Channel (number) Id
-
-
-The ID of the sales channel this product is available in, if it already exists.
-
-
-No
-
-
-
-
-
-Sales Channel (number) Name
-
-
-The name of the sales channel this product is available in. To specify more than one sales channel, include a number in the name. For example, "Sales Channel 1 Name".
-
-
-No
-
-
-
-
-
-Sales Channel (number) Description
-
-
-The description of the sales channel this product is available in. Make sure the column name has the same number as the corresponding sales channel name.
-
-
-No
-
-
-
-
-
-
-#### Product Category columns
-
-:::note
-
-The [product categories beta feature](../../../beta.md) must be enabled first. Otherwise, these columns will be ignored.
-
-:::
-
-
-
-
-
-Column name
-
-
-Description
-
-
-Is required?
-
-
-
-
-
-
-
-
-Product Category (number) Handle
-
-
-The handle of the product category this product belongs to. If you're specifying more than one product category, you must include a number in the column name. For example, "Product Category 1 Handle". If a product category with this handle doesn't exist, the product category will be ignored.
-
-
-No
-
-
-
-
-
-Product Category (number) Name
-
-
-The name of the product category this product belongs to. Make sure to use the same number as that of the corresponding product category handle.
-
-
-No
-
-
-
-
-
-Product Category (number) Description
-
-
-The description of the product category this product belongs to. Make sure to use the same number as that of the corresponding product category handle.
-
+ The status of the product. Its value can be `draft`, `proposed`, `published`, or `rejected`.
+
+
+ No
+
+
+
+
+
+ Product Thumbnail
+
+
+ A URL to the thumbnail of the product
+
+
+ No
+
+
+
+
+
+ Image (number) Url
+
+
+ A URL to a product image. To add more than one image, you can specify the image number in the column title. For example, "Image 1 Url".
+
+
+ No
+
+
+
+
+
+ Product Weight
+
+
+ The weight of the product
+
+
+ No
+
+
+
+
+
+ Product Length
+
+
+ The length of the product
+
+
+ No
+
+
+
+
+
+ Product Width
+
+
+ The width of the product
+
+
+ No
+
+
+
+
+
+ Product Height
+
+
+ The height of the product
+
+
+ No
+
+
+
+
+
+ Product HS Code
+
+
+ The HS Code of the product
+
+
+ No
+
+
+
+
+
+ Product Origin Country
+
+
+ The origin country of the product
+
+
+ No
+
+
+
+
+
+ Product MID Code
+
+
+ The MID code of the product
+
+
+ No
+
+
+
+
+
+ Product Material
+
+
+ The material of the product
+
+
+ No
+
+
+
+
+
+ Product Discountable
+
+
+ A boolean value indicating whether the product is discountable.
+
+
+ No
+
+
+
+
+
+ Product External Id
+
+
+ The external ID of the product. Useful if the product is being imported from another platform and you want to maintain the link to it.
+
+
+ No
+
+
+
+
+
+ Product Profile Name
+
+
+ The name of the product's shipping profile.
+
+
+ No
+
+
+
+
+
+ Product Profile Type
+
+
+ The type of the product's shipping profile. Its value can be `default`, `gift_card`, or `custom`.
+
+
+ No
+
+
+
+
+
+
+ #### Product Collection columns
+
+ :::note
+
+ A product collection is only associated with the product if the handle provided exists. Otherwise, it's skipped.
+
+ :::
+
+
+
+
+
+ Column name
+
+
+ Description
+
+
+ Is required?
+
+
+
+
+
+
+
+
+ Product Collection Title
+
+
+ The title of the product collection
+
+
+ No
+
+
+
+
+
+ Product Collection Handle
+
+
+ The handle of the product collection
+
+
+ No
+
+
+
+
+
+
+ #### Product Type columns
+
+
+
+
+
+ Column name
+
+
+ Description
+
+
+ Is required?
+
+
+
+
+
+
+
+
+ Product Type
+
+
+ The value of the product type
+
+
+ No
+
+
+
+
+
+
+ #### Product Tag columns
+
+
+
+
+
+ Column name
+
+
+ Description
+
+
+ Is required?
+
+
+
+
+
+
+
+
+ Product Tags
+
+
+ A comma-separated list of product tags
+
+
+ No
+
+
+
+
+
+
+ #### Product Option columns
+
+
+
+
+
+ Column name
+
+
+ Description
+
+
+ Is required?
+
+
+
+
+
+
+
+
+ "Option Name" or "Option (number) Name"
+
+
+ The name of the product option. If you name the column "Option Name", it means only one option will be added, and there should be no duplicate column with the same name for another option. To add more than one option, use the "Option (number) Name" name. For example, "Option 1 Name".
+
+
+ No
+
+
+
+
+
+ "Option Value" or "Option (number) Value"
+
+
+ The value of the product option. If you name the column "Option Value", it means only one option will be added, and there should be no duplicate column with the same name for another option. To add more than one option value, use the "Option (number) Value" name. For example, "Option 1 Value". The number of the value should correspond to the same option name number.
+
+
+ No
+
+
+
+
+
+
+ #### Product Variant Columns
+
+
+
+
+
+ Column name
+
+
+ Description
+
+
+ Is required?
+
+
+
+
+
+
+
+
+ Variant Id
+
+
+ The ID of the product variant
+
+
+ No
+
+
+
+
+
+ Variant Title
+
+
+ The title of the product variant
+
+
+ No
+
+
+
+
+
+ Variant SKU
+
+
+ The SKU of the product variant
+
+
+ No
+
+
+
+
+
+ Variant Barcode
+
+
+ The barcode of the product variant
+
+
+ No
+
+
+
+
+
+ Variant Inventory Quantity
+
+
+ The inventory quantity of the product variant
+
+
+ No
+
+
+
+
+
+ Variant Allow Backorder
+
+
+ A boolean value indicating if the variant can be back-ordered.
+
+
+ No
+
+
+
+
+
+ Variant Manage Inventory
+
+
+ A boolean value indicating if the variant's inventory can be managed.
+
+
+ No
+
+
+
+
+
+ Variant Weight
+
+
+ The weight of the product variant
+
+
+ No
+
+
+
+
+
+ Variant Length
+
+
+ The length of the product variant
+
+
+ No
+
+
+
+
+
+ Variant Width
+
+
+ The width of the product variant
+
+
+ No
+
+
+
+
+
+ Variant Height
+
+
+ The height of the product variant
+
+
+ No
+
+
+
+
+
+ Variant HS Code
+
+
+ The HS Code of the product variant
+
+
+ No
+
+
+
+
+
+ Variant Origin Country
+
+
+ The origin country of the product variant
+
+
+ No
+
+
+
+
+
+ Variant MID Code
+
+
+ The MID code of the product variant
+
+
+ No
+
+
+
+
+
+ Variant Material
+
+
+ The material of the product variant
+
+
+ No
+
+
+
+
+
+
+ #### Prices columns
+
+
+
+
+
+ Column name
+
+
+ Description
+
+
+ Is required?
+
+
+
+
+
+
+
+
+ Price (region name)
+
+
+ The price amount for a particular region, where (region name) is the name of the region.
+
+
+ No
+
+
+
+
+
+ Price (currency code)
+
+
+ The price amount for a particular currency, where (currency code) is the 3 character ISO code of the currency. For example, "Price USD".
+
+
+ No
+
+
+
+
+
+
+ #### Sales channel columns
+
+
+
+
+
+ Column name
+
+
+ Description
+
+
+ Is required?
+
+
+
+
+
+
+
+
+ Sales Channel (number) Id
+
+
+ The ID of the sales channel this product is available in, if it already exists.
+
+
+ No
+
+
+
+
+
+ Sales Channel (number) Name
+
+
+ The name of the sales channel this product is available in. To specify more than one sales channel, include a number in the name. For example, "Sales Channel 1 Name".
+
+
+ No
+
+
+
+
+
+ Sales Channel (number) Description
+
+
+ The description of the sales channel this product is available in. Make sure the column name has the same number as the corresponding sales channel name.
+
+
+ No
+
+
+
+
+
+
+ #### Product Category columns
+
+ :::note
+
+ The [product categories beta feature](../../../beta.md) must be enabled first. Otherwise, these columns will be ignored.
+
+ :::
+
+
+
+
+
+ Column name
+
+
+ Description
+
+
+ Is required?
+
+
+
+
+
+
+
+
+ Product Category (number) Handle
+
+
+ The handle of the product category this product belongs to. If you're specifying more than one product category, you must include a number in the column name. For example, "Product Category 1 Handle". If a product category with this handle doesn't exist, the product category will be ignored.
+
+
+ No
+
+
+
+
+
+ Product Category (number) Name
+
+
+ The name of the product category this product belongs to. Make sure to use the same number as that of the corresponding product category handle.
+
+
+ No
+
+
+
+
+
+ Product Category (number) Description
+
+
+ The description of the product category this product belongs to. Make sure to use the same number as that of the corresponding product category handle.
+
+
+ No
+
+
+
+
+
+
+
### JS Client
@@ -871,66 +869,66 @@ The first step is to upload the CSV file that you want to import products.
You can do that by sending the following request to the [Upload Files API Route](https://docs.medusajs.com/api/admin#uploads_postuploads):
-
+
-```ts
-medusa.admin.uploads.create(file) // file is an instance of File
-.then(({ uploads }) => {
- const key = uploads[0].key
-})
-```
+ ```ts
+ medusa.admin.uploads.create(file) // file is an instance of File
+ .then(({ uploads }) => {
+ const key = uploads[0].key
+ })
+ ```
-
-
+
+
-```tsx
-import { useAdminUploadFile } from "medusa-react"
+ ```tsx
+ import { useAdminUploadFile } from "medusa-react"
-const ImportProducts = () => {
- const uploadFile = useAdminUploadFile()
- // ...
+ const ImportProducts = () => {
+ const uploadFile = useAdminUploadFile()
+ // ...
- const handleFileUpload = (file: File) => {
- uploadFile.mutate(file)
- }
+ const handleFileUpload = (file: File) => {
+ uploadFile.mutate(file)
+ }
- // ...
-}
+ // ...
+ }
-export default ImportProducts
-```
+ export default ImportProducts
+ ```
-
-
+
+
-```ts
-const formData = new FormData()
-formData.append("files", file) // file is an instance of File
+ ```ts
+ const formData = new FormData()
+ formData.append("files", file) // file is an instance of File
-fetch(`/admin/uploads`, {
- method: "POST",
- credentials: "include",
- headers: {
- "Content-Type": "multipart/form-data",
- },
- body: formData,
-})
-.then((response) => response.json())
-.then(({ uploads }) => {
- const key = uploads[0].key
-})
-```
+ fetch(`/admin/uploads`, {
+ method: "POST",
+ credentials: "include",
+ headers: {
+ "Content-Type": "multipart/form-data",
+ },
+ body: formData,
+ })
+ .then((response) => response.json())
+ .then(({ uploads }) => {
+ const key = uploads[0].key
+ })
+ ```
-
-
+
+
-```bash
-curl -L -X POST '/admin/uploads' \
- -H 'Authorization: Bearer ' \
- -F 'files=@""'
-```
+ ```bash
+ curl -L -X POST '/admin/uploads' \
+ -H 'Authorization: Bearer ' \
+ -F 'files=@""'
+ ```
-
+
This request returns an array of uploads. Each item in the array is an object that includes the properties `url` and `key`. You’ll need the `key` to import the products next.
@@ -946,89 +944,89 @@ To start a new product import, you must create a batch job.
You can do that by sending the following request to the [Create a Batch Job API Route](https://docs.medusajs.com/api/admin#batch-jobs_postbatchjobs):
-
+
-```ts
-medusa.admin.batchJobs.create({
- type: "product-import",
- context: {
- fileKey: key, // obtained from previous step
- },
- dry_run: true,
-})
-.then(( batch_job ) => {
- console.log(batch_job.status)
-})
-```
-
-
-
-
-```tsx
-import { useAdminCreateBatchJob } from "medusa-react"
-
-const ImportProducts = () => {
- const createBatchJob = useAdminCreateBatchJob()
- // ...
-
- const handleCreateBatchJob = () => {
- createBatchJob.mutate({
+ ```ts
+ medusa.admin.batchJobs.create({
type: "product-import",
context: {
fileKey: key, // obtained from previous step
},
dry_run: true,
})
- }
+ .then(( batch_job ) => {
+ console.log(batch_job.status)
+ })
+ ```
- // ...
-}
+
+
-export default ImportProducts
-```
+ ```tsx
+ import { useAdminCreateBatchJob } from "medusa-react"
-
-
+ const ImportProducts = () => {
+ const createBatchJob = useAdminCreateBatchJob()
+ // ...
-```ts
-fetch(`/admin/batch-jobs`, {
- method: "POST",
- credentials: "include",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify({
- type: "product-import",
- context: {
- fileKey: key, // obtained from previous step
- },
- dry_run: true,
- }),
-})
-.then((response) => response.json())
-.then(({ batch_job }) => {
- console.log(batch_job.status)
-})
-```
+ const handleCreateBatchJob = () => {
+ createBatchJob.mutate({
+ type: "product-import",
+ context: {
+ fileKey: key, // obtained from previous step
+ },
+ dry_run: true,
+ })
+ }
-
-
+ // ...
+ }
-```bash
-curl -L -X POST '/admin/batch-jobs' \
--H 'Authorization: Bearer ' \
--H 'Content-Type: application/json' \
---data-raw '{
- "type": "product-import",
- "context": {
- "fileKey": ""
- },
- "dry_run": true
-}'
-# is the key you obtained from the previous step
-```
+ export default ImportProducts
+ ```
-
+
+
+
+ ```ts
+ fetch(`/admin/batch-jobs`, {
+ method: "POST",
+ credentials: "include",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ type: "product-import",
+ context: {
+ fileKey: key, // obtained from previous step
+ },
+ dry_run: true,
+ }),
+ })
+ .then((response) => response.json())
+ .then(({ batch_job }) => {
+ console.log(batch_job.status)
+ })
+ ```
+
+
+
+
+ ```bash
+ curl -L -X POST '/admin/batch-jobs' \
+ -H 'Authorization: Bearer ' \
+ -H 'Content-Type: application/json' \
+ --data-raw '{
+ "type": "product-import",
+ "context": {
+ "fileKey": ""
+ },
+ "dry_run": true
+ }'
+ # is the key you obtained from the previous step
+ ```
+
+
In the body of the request, you must pass the following parameters:
@@ -1054,65 +1052,65 @@ After creating the batch job, it will be pre-processed. At this point, the CSV f
You can retrieve all the details of the batch job, including its status and the brief statistics related to the products by sending the following request:
-
+
-```ts
-medusa.admin.batchJobs.retrieve(batchJobId)
-.then(( batch_job ) => {
- console.log(batch_job.status, batch_job.result)
-})
-```
+ ```ts
+ medusa.admin.batchJobs.retrieve(batchJobId)
+ .then(( batch_job ) => {
+ console.log(batch_job.status, batch_job.result)
+ })
+ ```
-
-
+
+
-```tsx
-import { useAdminBatchJob } from "medusa-react"
+ ```tsx
+ import { useAdminBatchJob } from "medusa-react"
-const ImportProducts = () => {
- const { batch_job, isLoading } = useAdminBatchJob(batchJobId)
- // ...
+ const ImportProducts = () => {
+ const { batch_job, isLoading } = useAdminBatchJob(batchJobId)
+ // ...
- return (
-
+ )
+ }
-export default Products
-```
+ export default Products
+ ```
-
-
+
+
-```ts
-fetch(`/store/products?cart_id=${cartId}®ion_id=${regionId}`, {
- credentials: "include",
-})
-.then((response) => response.json())
-.then(({ products, limit, offset, count }) => {
- console.log(products.length)
-})
-```
+ ```ts
+ fetch(`/store/products?cart_id=${cartId}®ion_id=${regionId}`, {
+ credentials: "include",
+ })
+ .then((response) => response.json())
+ .then(({ products, limit, offset, count }) => {
+ console.log(products.length)
+ })
+ ```
-
-
+
+
-```bash
-curl -L -X GET '/store/products?cart_id=®ion_id='
-```
+ ```bash
+ curl -L -X GET '/store/products?cart_id=®ion_id='
+ ```
-
+
### Display Product Price
@@ -447,7 +447,7 @@ You must pass one of the [pricing parameters](#product-pricing-parameters) to th
:::
-Prices in Medusa are stored as the currency's smallest unit. So, for currencies that are not zero-decimal, the amount is stored multiplied by a `100`. You can learn more about this in the [Product conceptual guide](../products.md#storing-the-product-variants-price).
+Prices in Medusa are stored as the currency's smallest unit. So, for currencies that are not zero-decimal, the amount is stored multiplied by a `100`. You can learn more about this in the [Product conceptual guide](../products.mdx#storing-the-product-variants-price).
So, to show the correct price, you would need to convert it to its actual price with a method like this:
@@ -477,105 +477,105 @@ Medusa React provides utility methods such as `formatVariantPrice` that handles
Here’s an example of how you can calculate the price with and without Medusa React:
-
+
-```tsx
-import React, { useEffect, useState } from "react"
-import Medusa from "@medusajs/medusa-js"
+ ```tsx
+ import React, { useEffect, useState } from "react"
+ import Medusa from "@medusajs/medusa-js"
-const medusa = new Medusa({
- baseUrl: "",
- maxRetries: 3,
-})
-
-function Products() {
- const [products, setProducts] = useState([])
-
- useEffect(() => {
- medusa.products.list({
- // TODO assuming region is already defined somewhere
- region_id: region.id,
+ const medusa = new Medusa({
+ baseUrl: "",
+ maxRetries: 3,
})
- .then(({ products, limit, offset, count }) => {
- // ignore pagination for sake of example
- setProducts(products)
- })
- })
- const convertToDecimal = (amount) => {
- return Math.floor(amount) / 100
- }
+ function Products() {
+ const [products, setProducts] = useState([])
- const formatPrice = (amount) => {
- return new Intl.NumberFormat("en-US", {
- style: "currency",
- // TODO assuming region is already defined somewhere
- currency: region.currency_code,
- }).format(convertToDecimal(amount))
- }
-
- return (
-
+ )
+ }
-export default Users
-```
+ export default Users
+ ```
-
-
+
+
-```ts
-fetch(`/admin/users`, {
- credentials: "include",
-})
-.then((response) => response.json())
-.then(({ users }) => {
- console.log(users.length)
-})
-```
+ ```ts
+ fetch(`/admin/users`, {
+ credentials: "include",
+ })
+ .then((response) => response.json())
+ .then(({ users }) => {
+ console.log(users.length)
+ })
+ ```
-
-
+
+
-```bash
-curl -L -X GET '/admin/users' \
--H 'Authorization: Bearer '
-```
+ ```bash
+ curl -L -X GET '/admin/users' \
+ -H 'Authorization: Bearer '
+ ```
-
+
This API Route doesn't require any parameters.
@@ -127,76 +127,76 @@ The request returns an array of user objects.
You can create a user by sending a request to the [Create User API Route](https://docs.medusajs.com/api/admin#users_postusers):
-
+
-```ts
-medusa.admin.users.create({
- email: "user@example.com",
- password: "supersecret",
-})
-.then(({ user }) => {
- console.log(user.id)
-})
-```
-
-
-
-
-```tsx
-import { useAdminCreateUser } from "medusa-react"
-
-const CreateUser = () => {
- const createUser = useAdminCreateUser()
- // ...
-
- const handleCreateUser = () => {
- createUser.mutate({
+ ```ts
+ medusa.admin.users.create({
email: "user@example.com",
password: "supersecret",
})
- }
+ .then(({ user }) => {
+ console.log(user.id)
+ })
+ ```
- // ...
-}
+
+
-export default CreateUser
-```
+ ```tsx
+ import { useAdminCreateUser } from "medusa-react"
-
-
+ const CreateUser = () => {
+ const createUser = useAdminCreateUser()
+ // ...
-```ts
-fetch(`/admin/users`, {
- credentials: "include",
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify({
- email: "user@example.com",
- password: "supersecret",
- }),
-})
-.then((response) => response.json())
-.then(({ user }) => {
- console.log(user.id)
-})
-```
+ const handleCreateUser = () => {
+ createUser.mutate({
+ email: "user@example.com",
+ password: "supersecret",
+ })
+ }
-
-
+ // ...
+ }
-```bash
-curl -L -X POST '/admin/users' \
--H 'Authorization: Bearer ' \
--H 'Content-Type: application/json' \
---data-raw '{
- "email": "user@example.com",
- "password": "supersecret"
-}'
-```
+ export default CreateUser
+ ```
-
+
+
+
+ ```ts
+ fetch(`/admin/users`, {
+ credentials: "include",
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ email: "user@example.com",
+ password: "supersecret",
+ }),
+ })
+ .then((response) => response.json())
+ .then(({ user }) => {
+ console.log(user.id)
+ })
+ ```
+
+
+
+
+ ```bash
+ curl -L -X POST '/admin/users' \
+ -H 'Authorization: Bearer ' \
+ -H 'Content-Type: application/json' \
+ --data-raw '{
+ "email": "user@example.com",
+ "password": "supersecret"
+ }'
+ ```
+
+
This API Route requires the following request body parameters:
@@ -215,72 +215,72 @@ The request returns the created user as an object.
You can update a user’s details by sending a request to the [Update User API Route](https://docs.medusajs.com/api/admin#users_postusersuser):
-
+
-```ts
-medusa.admin.users.update(userId, {
- first_name: "Marcellus",
-})
-.then(({ user }) => {
- console.log(user.id)
-})
-```
-
-
-
-
-```tsx
-import { useAdminUpdateUser } from "medusa-react"
-
-const UpdateUser = () => {
- const updateUser = useAdminUpdateUser(userId)
- // ...
-
- const handleUpdateUser = () => {
- updateUser.mutate({
+ ```ts
+ medusa.admin.users.update(userId, {
first_name: "Marcellus",
})
- }
+ .then(({ user }) => {
+ console.log(user.id)
+ })
+ ```
- // ...
-}
+
+
-export default UpdateUser
-```
+ ```tsx
+ import { useAdminUpdateUser } from "medusa-react"
-
-
+ const UpdateUser = () => {
+ const updateUser = useAdminUpdateUser(userId)
+ // ...
-```ts
-fetch(`/admin/users/${userId}`, {
- credentials: "include",
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify({
- first_name: "Marcellus",
- }),
-})
-.then((response) => response.json())
-.then(({ user }) => {
- console.log(user.id)
-})
-```
+ const handleUpdateUser = () => {
+ updateUser.mutate({
+ first_name: "Marcellus",
+ })
+ }
-
-
+ // ...
+ }
-```bash
-curl -L -X POST '/admin/users/' \
--H 'Authorization: Bearer ' \
--H 'Content-Type: application/json' \
---data-raw '{
- "first_name": "Marcellus"
-}'
-```
+ export default UpdateUser
+ ```
-
+
+
+
+ ```ts
+ fetch(`/admin/users/${userId}`, {
+ credentials: "include",
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({
+ first_name: "Marcellus",
+ }),
+ })
+ .then((response) => response.json())
+ .then(({ user }) => {
+ console.log(user.id)
+ })
+ ```
+
+
+
+
+ ```bash
+ curl -L -X POST '/admin/users/' \
+ -H 'Authorization: Bearer ' \
+ -H 'Content-Type: application/json' \
+ --data-raw '{
+ "first_name": "Marcellus"
+ }'
+ ```
+
+
This API Route requires the ID of the user as a path parameter.
@@ -296,58 +296,58 @@ The request returns the updated user as an object.
You can delete a user by sending a request to the [Delete User API Route](https://docs.medusajs.com/api/admin#users_deleteusersuser):
-
+
-```ts
-medusa.admin.users.delete(userId)
-.then(({ id, object, deleted }) => {
- console.log(id)
-})
-```
+ ```ts
+ medusa.admin.users.delete(userId)
+ .then(({ id, object, deleted }) => {
+ console.log(id)
+ })
+ ```
-
-
+
+
-```tsx
-import { useAdminDeleteUser } from "medusa-react"
+ ```tsx
+ import { useAdminDeleteUser } from "medusa-react"
-const DeleteUser = () => {
- const deleteUser = useAdminDeleteUser(userId)
- // ...
+ const DeleteUser = () => {
+ const deleteUser = useAdminDeleteUser(userId)
+ // ...
- const handleDeleteUser = () => {
- deleteUser.mutate()
- }
+ const handleDeleteUser = () => {
+ deleteUser.mutate()
+ }
- // ...
-}
+ // ...
+ }
-export default DeleteUser
-```
+ export default DeleteUser
+ ```
-
-
+
+
-```ts
-fetch(`/admin/users/${userId}`, {
- credentials: "include",
- method: "DELETE",
-})
-.then((response) => response.json())
-.then(({ id, object, deleted }) => {
- console.log(id)
-})
-```
+ ```ts
+ fetch(`/admin/users/${userId}`, {
+ credentials: "include",
+ method: "DELETE",
+ })
+ .then((response) => response.json())
+ .then(({ id, object, deleted }) => {
+ console.log(id)
+ })
+ ```
-
-
+
+
-```bash
-curl -L -X DELETE '/admin/users/' \
--H 'Authorization: Bearer '
-```
+ ```bash
+ curl -L -X DELETE '/admin/users/' \
+ -H 'Authorization: Bearer '
+ ```
-
+
This API Route requires the user ID as a path parameter.
diff --git a/www/apps/docs/content/modules/users/backend/rbac.mdx b/www/apps/docs/content/modules/users/backend/rbac.mdx
index a83bafaa8d..647a6fab90 100644
--- a/www/apps/docs/content/modules/users/backend/rbac.mdx
+++ b/www/apps/docs/content/modules/users/backend/rbac.mdx
@@ -47,287 +47,285 @@ So, the first step would be to create the `Role` and `Permission` entities to re
},
]} />
-
-
-Example Implementation
-
+
+ Example Implementation
-This is an example implementation of how you can create the Role and Permission entities, and extend the `User` and `Store` entities.
+ This is an example implementation of how you can create the Role and Permission entities, and extend the `User` and `Store` entities.
-Creating an entity requires creating an entity class, a repository, and a migration. You can learn more [here](../../../development/entities/create.mdx). You’ll be creating the migration at the end of this example section.
+ Creating an entity requires creating an entity class, a repository, and a migration. You can learn more [here](../../../development/entities/create.mdx). You’ll be creating the migration at the end of this example section.
-Create the file `src/models/role.ts` with the following content:
+ Create the file `src/models/role.ts` with the following content:
-```ts title=src/models/role.ts
-import {
- BeforeInsert,
- Column,
- Entity,
- Index,
- JoinColumn,
- JoinTable,
- ManyToMany,
- ManyToOne,
- OneToMany,
-} from "typeorm"
-import { BaseEntity } from "@medusajs/medusa"
-import { generateEntityId } from "@medusajs/medusa/dist/utils"
-import { Permission } from "./permission"
-import { User } from "./user"
-import { Store } from "./store"
+ ```ts title=src/models/role.ts
+ import {
+ BeforeInsert,
+ Column,
+ Entity,
+ Index,
+ JoinColumn,
+ JoinTable,
+ ManyToMany,
+ ManyToOne,
+ OneToMany,
+ } from "typeorm"
+ import { BaseEntity } from "@medusajs/medusa"
+ import { generateEntityId } from "@medusajs/medusa/dist/utils"
+ import { Permission } from "./permission"
+ import { User } from "./user"
+ import { Store } from "./store"
-@Entity()
-export class Role extends BaseEntity {
- @Column({ type: "varchar" })
- name: string
+ @Entity()
+ export class Role extends BaseEntity {
+ @Column({ type: "varchar" })
+ name: string
- // only helpful if you're integrating in a marketplace
- @Index()
- @Column({ nullable: true })
- store_id: string
+ // only helpful if you're integrating in a marketplace
+ @Index()
+ @Column({ nullable: true })
+ store_id: string
- @ManyToMany(() => Permission)
- @JoinTable({
- name: "role_permissions",
- joinColumn: {
- name: "role_id",
- referencedColumnName: "id",
- },
- inverseJoinColumn: {
- name: "permission_id",
- referencedColumnName: "id",
- },
- })
- permissions: Permission[]
+ @ManyToMany(() => Permission)
+ @JoinTable({
+ name: "role_permissions",
+ joinColumn: {
+ name: "role_id",
+ referencedColumnName: "id",
+ },
+ inverseJoinColumn: {
+ name: "permission_id",
+ referencedColumnName: "id",
+ },
+ })
+ permissions: Permission[]
- @OneToMany(() => User, (user) => user.teamRole)
- @JoinColumn({ name: "id", referencedColumnName: "role_id" })
- users: User[]
+ @OneToMany(() => User, (user) => user.teamRole)
+ @JoinColumn({ name: "id", referencedColumnName: "role_id" })
+ users: User[]
- @ManyToOne(() => Store, (store) => store.roles)
- @JoinColumn({ name: "store_id" })
- store: Store
+ @ManyToOne(() => Store, (store) => store.roles)
+ @JoinColumn({ name: "store_id" })
+ store: Store
- @BeforeInsert()
- private beforeInsert(): void {
- this.id = generateEntityId(this.id, "role")
+ @BeforeInsert()
+ private beforeInsert(): void {
+ this.id = generateEntityId(this.id, "role")
+ }
}
-}
-```
+ ```
-This creates the `Role` entity. You’ll see errors in your editors, which you’ll resolve by following along the example.
+ This creates the `Role` entity. You’ll see errors in your editors, which you’ll resolve by following along the example.
-The `Role` entity has the following attributes:
+ The `Role` entity has the following attributes:
-- `id`: the ID of the role, which is available implicitly by extending `BaseEntity`
-- `name`: the name of the role
-- `store_id`: the ID of the store this role belongs to. This is only useful if you’re implementing RBAC in a marketplace. Otherwise, you may omit this relation.
+ - `id`: the ID of the role, which is available implicitly by extending `BaseEntity`
+ - `name`: the name of the role
+ - `store_id`: the ID of the store this role belongs to. This is only useful if you’re implementing RBAC in a marketplace. Otherwise, you may omit this relation.
-It also has the following relations:
+ It also has the following relations:
-- `permissions`: an array of permissions included in this role.
-- `store`: the Store this role belongs to.
-- `users`: the users associated with this role.
+ - `permissions`: an array of permissions included in this role.
+ - `store`: the Store this role belongs to.
+ - `users`: the users associated with this role.
-Then, create the file `src/repositories/role.ts` with the following content:
+ Then, create the file `src/repositories/role.ts` with the following content:
-```ts title=src/repositories/role.ts
-import { Role } from "../models/role"
-import {
- dataSource,
-} from "@medusajs/medusa/dist/loaders/database"
+ ```ts title=src/repositories/role.ts
+ import { Role } from "../models/role"
+ import {
+ dataSource,
+ } from "@medusajs/medusa/dist/loaders/database"
-export const RoleRepository = dataSource
- .getRepository(Role)
+ export const RoleRepository = dataSource
+ .getRepository(Role)
-export default RoleRepository
-```
+ export default RoleRepository
+ ```
-Next, create the file `src/models/permission.ts` with the following content:
+ Next, create the file `src/models/permission.ts` with the following content:
-```ts title=src/models/permission.ts
-import {
- BeforeInsert,
- Column,
- Entity,
- JoinTable,
- ManyToMany,
-} from "typeorm"
-import { BaseEntity } from "@medusajs/medusa"
-import {
- DbAwareColumn,
- generateEntityId,
-} from "@medusajs/medusa/dist/utils"
-import { Role } from "./role"
+ ```ts title=src/models/permission.ts
+ import {
+ BeforeInsert,
+ Column,
+ Entity,
+ JoinTable,
+ ManyToMany,
+ } from "typeorm"
+ import { BaseEntity } from "@medusajs/medusa"
+ import {
+ DbAwareColumn,
+ generateEntityId,
+ } from "@medusajs/medusa/dist/utils"
+ import { Role } from "./role"
-@Entity()
-export class Permission extends BaseEntity {
- @Column({ type: "varchar" })
- name: string
+ @Entity()
+ export class Permission extends BaseEntity {
+ @Column({ type: "varchar" })
+ name: string
- // holds the permissions
- @DbAwareColumn({ type: "jsonb", nullable: true })
- metadata: Record
+ // holds the permissions
+ @DbAwareColumn({ type: "jsonb", nullable: true })
+ metadata: Record
- @BeforeInsert()
- private beforeInsert(): void {
- this.id = generateEntityId(this.id, "perm")
+ @BeforeInsert()
+ private beforeInsert(): void {
+ this.id = generateEntityId(this.id, "perm")
+ }
}
-}
-```
+ ```
-This creates a `Permission` entity that has the following attributes:
+ This creates a `Permission` entity that has the following attributes:
-- `id`: the ID of the permission, which is implicitly available through extending `BaseEntity`.
-- `name`: the name of the permission.
-- `metadata`: an object that will include the permissions. The object keys will be an admin path in the backend, and the value will be a boolean indicating whether the user has access to that path or not.
+ - `id`: the ID of the permission, which is implicitly available through extending `BaseEntity`.
+ - `name`: the name of the permission.
+ - `metadata`: an object that will include the permissions. The object keys will be an admin path in the backend, and the value will be a boolean indicating whether the user has access to that path or not.
-Then, create the file `src/repositories/permission.ts` with the following content:
+ Then, create the file `src/repositories/permission.ts` with the following content:
-```ts title=src/repositories/permission.ts
-import { Permission } from "../models/permission"
-import {
- dataSource,
-} from "@medusajs/medusa/dist/loaders/database"
+ ```ts title=src/repositories/permission.ts
+ import { Permission } from "../models/permission"
+ import {
+ dataSource,
+ } from "@medusajs/medusa/dist/loaders/database"
-export const PermissionRepository = dataSource
- .getRepository(Permission)
+ export const PermissionRepository = dataSource
+ .getRepository(Permission)
-export default PermissionRepository
-```
+ export default PermissionRepository
+ ```
-Next, you’ll extend the `User` and `Store` entities. As mentioned earlier, extending the `Store` entity and adding the relation is only useful if you’re implementing RBAC in a marketplace or similar use cases. So, if this doesn’t apply to you, you may skip it.
+ Next, you’ll extend the `User` and `Store` entities. As mentioned earlier, extending the `Store` entity and adding the relation is only useful if you’re implementing RBAC in a marketplace or similar use cases. So, if this doesn’t apply to you, you may skip it.
-Create the file `src/models/user.ts` with the following content:
+ Create the file `src/models/user.ts` with the following content:
-```ts title=src/models/user.ts
-import {
- Column,
- Entity,
- Index,
- JoinColumn,
- ManyToOne,
-} from "typeorm"
-import {
- // alias the core entity to not cause a naming conflict
- User as MedusaUser,
-} from "@medusajs/medusa"
-import { Role } from "./role"
+ ```ts title=src/models/user.ts
+ import {
+ Column,
+ Entity,
+ Index,
+ JoinColumn,
+ ManyToOne,
+ } from "typeorm"
+ import {
+ // alias the core entity to not cause a naming conflict
+ User as MedusaUser,
+ } from "@medusajs/medusa"
+ import { Role } from "./role"
-@Entity()
-export class User extends MedusaUser {
- @Index()
- @Column({ nullable: true })
- role_id: string | null
+ @Entity()
+ export class User extends MedusaUser {
+ @Index()
+ @Column({ nullable: true })
+ role_id: string | null
- @ManyToOne(() => Role, (role) => role.users)
- @JoinColumn({ name: "role_id" })
- teamRole: Role | null
-}
-```
-
-This adds a new attribute `role_id` to the core `User` entity and a `teamRole` relation that optionally associates the user with a role.
-
-Next, create the file `src/models/store.ts` with the following content:
-
-```ts title=src/models/store.ts
-import { Entity, JoinColumn, OneToMany } from "typeorm"
-import {
- // alias the core entity to not cause a naming conflict
- Store as MedusaStore,
-} from "@medusajs/medusa"
-import { Role } from "./role"
-
-@Entity()
-export class Store extends MedusaStore {
- @OneToMany(() => Role, (role) => role.store)
- @JoinColumn({ name: "id", referencedColumnName: "store_id" })
- roles: Role[]
-}
-```
-
-This adds a `roles` relation to the core `Store` entity.
-
-Optionally, if you’re using TypeScript, create the file `src/index.d.ts` with the following content:
-
-```ts title=src/index.d.ts
-import { Role } from "./models/role"
-
-export declare module "@medusajs/medusa/dist/models/user" {
-
- declare interface User {
- role_id: string | null;
+ @ManyToOne(() => Role, (role) => role.users)
+ @JoinColumn({ name: "role_id" })
teamRole: Role | null
}
+ ```
- declare interface Store {
+ This adds a new attribute `role_id` to the core `User` entity and a `teamRole` relation that optionally associates the user with a role.
+
+ Next, create the file `src/models/store.ts` with the following content:
+
+ ```ts title=src/models/store.ts
+ import { Entity, JoinColumn, OneToMany } from "typeorm"
+ import {
+ // alias the core entity to not cause a naming conflict
+ Store as MedusaStore,
+ } from "@medusajs/medusa"
+ import { Role } from "./role"
+
+ @Entity()
+ export class Store extends MedusaStore {
+ @OneToMany(() => Role, (role) => role.store)
+ @JoinColumn({ name: "id", referencedColumnName: "store_id" })
roles: Role[]
}
-}
-```
+ ```
-This ensures that your TypeScript validation and editor autocomplete recognize the new attributes and relations you added on the core entities.
+ This adds a `roles` relation to the core `Store` entity.
-Finally, you need to create a migration to reflect these changes in the database.
+ Optionally, if you’re using TypeScript, create the file `src/index.d.ts` with the following content:
-You can learn about creating migrations [here](../../../development/entities/migrations/create.md). An example of a migration file based on the entities created above:
+ ```ts title=src/index.d.ts
+ import { Role } from "./models/role"
+
+ export declare module "@medusajs/medusa/dist/models/user" {
+
+ declare interface User {
+ role_id: string | null;
+ teamRole: Role | null
+ }
+
+ declare interface Store {
+ roles: Role[]
+ }
+ }
+ ```
+
+ This ensures that your TypeScript validation and editor autocomplete recognize the new attributes and relations you added on the core entities.
+
+ Finally, you need to create a migration to reflect these changes in the database.
+
+ You can learn about creating migrations [here](../../../development/entities/migrations/create.md). An example of a migration file based on the entities created above:
-```ts title=src/migrations/1693225851284-AddRolesAndPermissions.ts
-import { MigrationInterface, QueryRunner, Table, TableIndex } from "typeorm"
+ ```ts title=src/migrations/1693225851284-AddRolesAndPermissions.ts
+ import { MigrationInterface, QueryRunner, Table, TableIndex } from "typeorm"
-export class AddRolesAndPermissions1693225851284 implements MigrationInterface {
+ export class AddRolesAndPermissions1693225851284 implements MigrationInterface {
- public async up(queryRunner: QueryRunner): Promise {
- await queryRunner.query(`ALTER TABLE "user" ADD "role_id" character varying`)
- await queryRunner.query(`CREATE TABLE "permission" ("id" character varying NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "name" character varying NOT NULL, "metadata" jsonb, CONSTRAINT "PK_3b8b97af9d9d8807e41e6f48362" PRIMARY KEY ("id"))`)
- await queryRunner.query(`CREATE TABLE "role" ("id" character varying NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "name" character varying NOT NULL, "store_id" character varying, CONSTRAINT "PK_b36bcfe02fc8de3c57a8b2391c2" PRIMARY KEY ("id"))`)
- await queryRunner.query(`CREATE INDEX "IDX_29259dd58b1052aef9be56941d" ON "role" ("store_id") `)
- await queryRunner.query(`CREATE TABLE "role_permissions" ("role_id" character varying NOT NULL, "permission_id" character varying NOT NULL, CONSTRAINT "PK_25d24010f53bb80b78e412c9656" PRIMARY KEY ("role_id", "permission_id"))`)
- await queryRunner.query(`CREATE INDEX "IDX_178199805b901ccd220ab7740e" ON "role_permissions" ("role_id") `)
- await queryRunner.query(`CREATE INDEX "IDX_17022daf3f885f7d35423e9971" ON "role_permissions" ("permission_id") `)
+ public async up(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(`ALTER TABLE "user" ADD "role_id" character varying`)
+ await queryRunner.query(`CREATE TABLE "permission" ("id" character varying NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "name" character varying NOT NULL, "metadata" jsonb, CONSTRAINT "PK_3b8b97af9d9d8807e41e6f48362" PRIMARY KEY ("id"))`)
+ await queryRunner.query(`CREATE TABLE "role" ("id" character varying NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "name" character varying NOT NULL, "store_id" character varying, CONSTRAINT "PK_b36bcfe02fc8de3c57a8b2391c2" PRIMARY KEY ("id"))`)
+ await queryRunner.query(`CREATE INDEX "IDX_29259dd58b1052aef9be56941d" ON "role" ("store_id") `)
+ await queryRunner.query(`CREATE TABLE "role_permissions" ("role_id" character varying NOT NULL, "permission_id" character varying NOT NULL, CONSTRAINT "PK_25d24010f53bb80b78e412c9656" PRIMARY KEY ("role_id", "permission_id"))`)
+ await queryRunner.query(`CREATE INDEX "IDX_178199805b901ccd220ab7740e" ON "role_permissions" ("role_id") `)
+ await queryRunner.query(`CREATE INDEX "IDX_17022daf3f885f7d35423e9971" ON "role_permissions" ("permission_id") `)
- await queryRunner.query(`ALTER TABLE "role_permissions" ADD CONSTRAINT "FK_178199805b901ccd220ab7740ec" FOREIGN KEY ("role_id") REFERENCES "role"("id") ON DELETE CASCADE ON UPDATE CASCADE`)
- await queryRunner.query(`ALTER TABLE "role_permissions" ADD CONSTRAINT "FK_17022daf3f885f7d35423e9971e" FOREIGN KEY ("permission_id") REFERENCES "permission"("id") ON DELETE CASCADE ON UPDATE CASCADE`)
- await queryRunner.query(`ALTER TABLE "user" ADD CONSTRAINT "FK_fb2e442d14add3cefbdf33c4561" FOREIGN KEY ("role_id") REFERENCES "role"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`)
- await queryRunner.query(`ALTER TABLE "role" ADD CONSTRAINT "FK_29259dd58b1052aef9be56941d4" FOREIGN KEY ("store_id") REFERENCES "store"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`)
- await queryRunner.query(`CREATE INDEX "IDX_fb2e442d14add3cefbdf33c456" ON "user" ("role_id") `)
- }
+ await queryRunner.query(`ALTER TABLE "role_permissions" ADD CONSTRAINT "FK_178199805b901ccd220ab7740ec" FOREIGN KEY ("role_id") REFERENCES "role"("id") ON DELETE CASCADE ON UPDATE CASCADE`)
+ await queryRunner.query(`ALTER TABLE "role_permissions" ADD CONSTRAINT "FK_17022daf3f885f7d35423e9971e" FOREIGN KEY ("permission_id") REFERENCES "permission"("id") ON DELETE CASCADE ON UPDATE CASCADE`)
+ await queryRunner.query(`ALTER TABLE "user" ADD CONSTRAINT "FK_fb2e442d14add3cefbdf33c4561" FOREIGN KEY ("role_id") REFERENCES "role"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`)
+ await queryRunner.query(`ALTER TABLE "role" ADD CONSTRAINT "FK_29259dd58b1052aef9be56941d4" FOREIGN KEY ("store_id") REFERENCES "store"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`)
+ await queryRunner.query(`CREATE INDEX "IDX_fb2e442d14add3cefbdf33c456" ON "user" ("role_id") `)
+ }
- public async down(queryRunner: QueryRunner): Promise {
- await queryRunner.query(`ALTER TABLE "role_permissions" DROP CONSTRAINT "FK_17022daf3f885f7d35423e9971e"`)
- await queryRunner.query(`ALTER TABLE "role_permissions" DROP CONSTRAINT "FK_178199805b901ccd220ab7740ec"`)
- await queryRunner.query(`ALTER TABLE "role" DROP CONSTRAINT "FK_29259dd58b1052aef9be56941d4"`)
- await queryRunner.query(`DROP INDEX "public"."IDX_fb2e442d14add3cefbdf33c456"`)
- await queryRunner.query(`ALTER TABLE "user" DROP CONSTRAINT "FK_fb2e442d14add3cefbdf33c4561"`)
- await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "role_id"`)
- await queryRunner.query(`DROP INDEX "public"."IDX_17022daf3f885f7d35423e9971"`)
- await queryRunner.query(`DROP INDEX "public"."IDX_178199805b901ccd220ab7740e"`)
- await queryRunner.query(`DROP TABLE "role_permissions"`)
- await queryRunner.query(`DROP INDEX "public"."IDX_29259dd58b1052aef9be56941d"`)
- await queryRunner.query(`DROP TABLE "role"`)
- await queryRunner.query(`DROP TABLE "permission"`)
- }
+ public async down(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(`ALTER TABLE "role_permissions" DROP CONSTRAINT "FK_17022daf3f885f7d35423e9971e"`)
+ await queryRunner.query(`ALTER TABLE "role_permissions" DROP CONSTRAINT "FK_178199805b901ccd220ab7740ec"`)
+ await queryRunner.query(`ALTER TABLE "role" DROP CONSTRAINT "FK_29259dd58b1052aef9be56941d4"`)
+ await queryRunner.query(`DROP INDEX "public"."IDX_fb2e442d14add3cefbdf33c456"`)
+ await queryRunner.query(`ALTER TABLE "user" DROP CONSTRAINT "FK_fb2e442d14add3cefbdf33c4561"`)
+ await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "role_id"`)
+ await queryRunner.query(`DROP INDEX "public"."IDX_17022daf3f885f7d35423e9971"`)
+ await queryRunner.query(`DROP INDEX "public"."IDX_178199805b901ccd220ab7740e"`)
+ await queryRunner.query(`DROP TABLE "role_permissions"`)
+ await queryRunner.query(`DROP INDEX "public"."IDX_29259dd58b1052aef9be56941d"`)
+ await queryRunner.query(`DROP TABLE "role"`)
+ await queryRunner.query(`DROP TABLE "permission"`)
+ }
-}
-```
+ }
+ ```
-Finally, to reflect these changes, run the `build` command in the root directory of your medusa backend:
+ Finally, to reflect these changes, run the `build` command in the root directory of your medusa backend:
-```bash npm2yarn
-npm run build
-```
+ ```bash npm2yarn
+ npm run build
+ ```
-Then, run the migrations:
+ Then, run the migrations:
-```bash
-npx medusa migrations run
-```
+ ```bash
+ npx medusa migrations run
+ ```
-This will reflect the entity changes in your database.
+ This will reflect the entity changes in your database.
-
+
---
@@ -347,99 +345,99 @@ Since the Medusa backend uses Express, you can create a middleware and attach it
}
}} />
-
-Example Implementation
+
+ Example Implementation
-In this example, you’ll create a middleware that runs on all admin-authenticated routes and checks the logged-in user’s permissions before giving them access to an API Route.
+ In this example, you’ll create a middleware that runs on all admin-authenticated routes and checks the logged-in user’s permissions before giving them access to an API Route.
-Create the file `src/api/middlewares.ts` with the following content:
+ Create the file `src/api/middlewares.ts` with the following content:
-```ts title=src/api/middlewares.ts
-import type {
- MiddlewaresConfig,
- UserService,
-} from "@medusajs/medusa"
-import express from "express"
-import type {
- MedusaRequest,
- MedusaResponse,
- MedusaNextFunction,
-} from "@medusajs/medusa"
+ ```ts title=src/api/middlewares.ts
+ import type {
+ MiddlewaresConfig,
+ UserService,
+ } from "@medusajs/medusa"
+ import express from "express"
+ import type {
+ MedusaRequest,
+ MedusaResponse,
+ MedusaNextFunction,
+ } from "@medusajs/medusa"
-export const permissions = async (
- req: MedusaRequest,
- res: MedusaResponse,
- next: MedusaNextFunction
-) => {
- if (!req.user || !req.user.userId) {
- next()
- return
- }
- // retrieve currently logged-in user
- const userService = req.scope.resolve(
- "userService"
- ) as UserService
- const loggedInUser = await userService.retrieve(
- req.user.userId,
- {
- select: ["id"],
- relations: ["teamRole", "teamRole.permissions"],
- })
-
- if (!loggedInUser.teamRole) {
- // considered as super user
- next()
- return
- }
-
- const isAllowed = loggedInUser.teamRole?.permissions.some(
- (permission) => {
- const metadataKey = Object.keys(permission.metadata).find(
- (key) => key === req.path
- )
- if (!metadataKey) {
- return false
- }
-
- // boolean value
- return permission.metadata[metadataKey]
+ export const permissions = async (
+ req: MedusaRequest,
+ res: MedusaResponse,
+ next: MedusaNextFunction
+ ) => {
+ if (!req.user || !req.user.userId) {
+ next()
+ return
}
- )
+ // retrieve currently logged-in user
+ const userService = req.scope.resolve(
+ "userService"
+ ) as UserService
+ const loggedInUser = await userService.retrieve(
+ req.user.userId,
+ {
+ select: ["id"],
+ relations: ["teamRole", "teamRole.permissions"],
+ })
- if (isAllowed) {
- next()
- return
+ if (!loggedInUser.teamRole) {
+ // considered as super user
+ next()
+ return
+ }
+
+ const isAllowed = loggedInUser.teamRole?.permissions.some(
+ (permission) => {
+ const metadataKey = Object.keys(permission.metadata).find(
+ (key) => key === req.path
+ )
+ if (!metadataKey) {
+ return false
+ }
+
+ // boolean value
+ return permission.metadata[metadataKey]
+ }
+ )
+
+ if (isAllowed) {
+ next()
+ return
+ }
+
+ // deny access
+ res.sendStatus(401)
}
- // deny access
- res.sendStatus(401)
-}
+ export const config: MiddlewaresConfig = {
+ routes: [
+ {
+ matcher: "/admin/*",
+ middlewares: [permissions],
+ },
+ ],
+ }
+ ```
-export const config: MiddlewaresConfig = {
- routes: [
- {
- matcher: "/admin/*",
- middlewares: [permissions],
- },
- ],
-}
-```
+ In this middleware, you ensure that there is a logged-in user and the logged-in user has a role. If not, the user is admitted to access the API Route. Here, you presume that logged-in users who don’t have a role are “super-admin” users who can access all API Routes. You may choose to implement this differently.
-In this middleware, you ensure that there is a logged-in user and the logged-in user has a role. If not, the user is admitted to access the API Route. Here, you presume that logged-in users who don’t have a role are “super-admin” users who can access all API Routes. You may choose to implement this differently.
+ If there’s a logged-in user that has a role, you check that the role’s permissions give them access to the current API Route. You do that by checking if a permission’s metadata has a key with the same request’s path. It may be better here to check for matching using regular expressions, for example, to check routes with path parameters.
-If there’s a logged-in user that has a role, you check that the role’s permissions give them access to the current API Route. You do that by checking if a permission’s metadata has a key with the same request’s path. It may be better here to check for matching using regular expressions, for example, to check routes with path parameters.
+ Otherwise, if the user’s role doesn’t provide them with enough permissions, you return a `401` response code.
-Otherwise, if the user’s role doesn’t provide them with enough permissions, you return a `401` response code.
+ :::tip
-:::tip
+ Notice that you use `req.path` here to get the current API Route path. However, in middlewares, this doesn’t include the mount point which is `/admin`. So, for example, if the API Route path is `/admin/products`, `req.path` will be `/products`. You can alternatively use `req.originalUrl`. Learn more in [Express’s documentation](https://expressjs.com/en/api.html#req.originalUrl).
-Notice that you use `req.path` here to get the current API Route path. However, in middlewares, this doesn’t include the mount point which is `/admin`. So, for example, if the API Route path is `/admin/products`, `req.path` will be `/products`. You can alternatively use `req.originalUrl`. Learn more in [Express’s documentation](https://expressjs.com/en/api.html#req.originalUrl).
+ :::
-:::
+ After defining the middleware, you apply it on all API Routes starting with `/admin/`.
-After defining the middleware, you apply it on all API Routes starting with `/admin/`.
-
-
+
---
@@ -481,292 +479,290 @@ Furthermore, you may need to extend core services if you need to perform actions
},
]} />
-
-
-Example Implementation
-
+
+ Example Implementation
-In this example, you’ll only implement two API Routes for simplicity: create role API Route that create a new role with permissions, and associate user API Route that associates a user with a role.
+ In this example, you’ll only implement two API Routes for simplicity: create role API Route that create a new role with permissions, and associate user API Route that associates a user with a role.
-You’ll also create basic services for `Role` and `Permission` to perform the functionalities of each of these API Routes and extend the core `UserService` to allow associating roles with users.
+ You’ll also create basic services for `Role` and `Permission` to perform the functionalities of each of these API Routes and extend the core `UserService` to allow associating roles with users.
-Start by creating the file `src/services/permission.ts` with the following content:
+ Start by creating the file `src/services/permission.ts` with the following content:
-```ts title=src/services/permission.ts
-import { TransactionBaseService } from "@medusajs/medusa"
-import { Permission } from "../models/permission"
-import PermissionRepository from "../repositories/permission"
+ ```ts title=src/services/permission.ts
+ import { TransactionBaseService } from "@medusajs/medusa"
+ import { Permission } from "../models/permission"
+ import PermissionRepository from "../repositories/permission"
-export type CreatePayload = Pick<
- Permission,
- "name" | "metadata"
->
+ export type CreatePayload = Pick<
+ Permission,
+ "name" | "metadata"
+ >
-type InjectedDependencies = {
- permissionRepository: typeof PermissionRepository
-}
-
-class PermissionService extends TransactionBaseService {
- protected readonly permissionRepository_:
- typeof PermissionRepository
-
- constructor(container: InjectedDependencies) {
- super(container)
- this.permissionRepository_ = container.permissionRepository
+ type InjectedDependencies = {
+ permissionRepository: typeof PermissionRepository
}
- async create(data: CreatePayload) {
- // omitting validation for simplicity
- return this.atomicPhase_(async (manager) => {
- const permissionRepo = manager.withRepository(
- this.permissionRepository_
- )
- const permission = permissionRepo.create(data)
+ class PermissionService extends TransactionBaseService {
+ protected readonly permissionRepository_:
+ typeof PermissionRepository
+
+ constructor(container: InjectedDependencies) {
+ super(container)
+ this.permissionRepository_ = container.permissionRepository
+ }
- const result = await permissionRepo.save(permission)
-
- return result
- })
- }
-}
-
-export default PermissionService
-```
-
-This creates the `PermissionService` with only a `create` method that can be used to create a permission.
-
-Next, create the file `src/services/user.ts` with the following content:
-
-```ts title=src/services/user.ts
-import {
- UserService as MedusaUserService, User,
-} from "@medusajs/medusa"
-import {
- UpdateUserInput,
-} from "@medusajs/medusa/dist/types/user"
-
-class UserService extends MedusaUserService {
- async update(userId: string, update: UpdateUserInput & {
- role_id?: string
- }): Promise {
- return super.update(userId, update)
- }
-}
-
-export default UserService
-```
-
-This extends the core `UserService` to allow updating a user’s role. You may also want to extend the `create` method to allow specifying the role on creation.
-
-Then, create the file `src/services/role.ts` with the following content:
-
-```ts title=src/services/role.ts
-import { TransactionBaseService } from "@medusajs/medusa"
-import { Role } from "../models/role"
-import RoleRepository from "../repositories/role"
-import PermissionService, {
- CreatePayload as PermissionCreatePayload,
-} from "./permission"
-import UserService from "./user"
-
-type CreatePayload = Pick & {
- permissions?: PermissionCreatePayload[]
-}
-
-type InjectedDependencies = {
- roleRepository: typeof RoleRepository
- permissionService: PermissionService
- userService: UserService
-}
-
-class RoleService extends TransactionBaseService {
- protected readonly roleRpository_: typeof RoleRepository
- protected readonly permissionService_: PermissionService
- protected readonly userService_: UserService
-
- constructor(container: InjectedDependencies) {
- super(container)
-
- this.roleRpository_ = container.roleRepository
- this.permissionService_ = container.permissionService
- this.userService_ = container.userService
- }
-
- async retrieve(id: string): Promise {
- // for simplicity, we retrieve all relations
- // however, it's best to supply the relations
- // as an optional method parameter
- const roleRepo = this.manager_.withRepository(
- this.roleRpository_
- )
- return await roleRepo.findOne({
- where: {
- id,
- },
- relations: [
- "permissions",
- "store",
- "users",
- ],
- })
- }
-
- async create(data: CreatePayload): Promise {
- return this.atomicPhase_(async (manager) => {
+ async create(data: CreatePayload) {
// omitting validation for simplicity
- const { permissions: permissionsData = [] } = data
- delete data.permissions
-
- const roleRepo = manager.withRepository(
+ return this.atomicPhase_(async (manager) => {
+ const permissionRepo = manager.withRepository(
+ this.permissionRepository_
+ )
+ const permission = permissionRepo.create(data)
+
+ const result = await permissionRepo.save(permission)
+
+ return result
+ })
+ }
+ }
+
+ export default PermissionService
+ ```
+
+ This creates the `PermissionService` with only a `create` method that can be used to create a permission.
+
+ Next, create the file `src/services/user.ts` with the following content:
+
+ ```ts title=src/services/user.ts
+ import {
+ UserService as MedusaUserService, User,
+ } from "@medusajs/medusa"
+ import {
+ UpdateUserInput,
+ } from "@medusajs/medusa/dist/types/user"
+
+ class UserService extends MedusaUserService {
+ async update(userId: string, update: UpdateUserInput & {
+ role_id?: string
+ }): Promise {
+ return super.update(userId, update)
+ }
+ }
+
+ export default UserService
+ ```
+
+ This extends the core `UserService` to allow updating a user’s role. You may also want to extend the `create` method to allow specifying the role on creation.
+
+ Then, create the file `src/services/role.ts` with the following content:
+
+ ```ts title=src/services/role.ts
+ import { TransactionBaseService } from "@medusajs/medusa"
+ import { Role } from "../models/role"
+ import RoleRepository from "../repositories/role"
+ import PermissionService, {
+ CreatePayload as PermissionCreatePayload,
+ } from "./permission"
+ import UserService from "./user"
+
+ type CreatePayload = Pick & {
+ permissions?: PermissionCreatePayload[]
+ }
+
+ type InjectedDependencies = {
+ roleRepository: typeof RoleRepository
+ permissionService: PermissionService
+ userService: UserService
+ }
+
+ class RoleService extends TransactionBaseService {
+ protected readonly roleRpository_: typeof RoleRepository
+ protected readonly permissionService_: PermissionService
+ protected readonly userService_: UserService
+
+ constructor(container: InjectedDependencies) {
+ super(container)
+
+ this.roleRpository_ = container.roleRepository
+ this.permissionService_ = container.permissionService
+ this.userService_ = container.userService
+ }
+
+ async retrieve(id: string): Promise {
+ // for simplicity, we retrieve all relations
+ // however, it's best to supply the relations
+ // as an optional method parameter
+ const roleRepo = this.manager_.withRepository(
this.roleRpository_
)
- const role = roleRepo.create(data)
-
- role.permissions = []
-
- for (const permissionData of permissionsData) {
- role.permissions.push(
- await this.permissionService_.create(
- permissionData
- )
- )
- }
- const result = await roleRepo.save(role)
-
- return await this.retrieve(result.id)
- })
- }
-
- async associateUser(
- role_id: string,
- user_id: string
- ): Promise {
- return this.atomicPhase_(async () => {
- // omitting validation for simplicity
- await this.userService_.update(user_id, {
- role_id,
+ return await roleRepo.findOne({
+ where: {
+ id,
+ },
+ relations: [
+ "permissions",
+ "store",
+ "users",
+ ],
})
-
- return await this.retrieve(role_id)
- })
- }
-}
-
-export default RoleService
-```
-
-This creates the `RoleService` with three methods:
-
-- `retrieve`: Retrieves a role with its relations.
-- `create`: Creates a new role and, if provided, its permissions as well.
-- `associateUser`: associates a user with a role.
-
-Now, you can create the API Routes.
-
-Start by creating the file `src/api/admin/roles/route.ts` with the following content:
-
-```ts title=src/api/admin/roles/route.ts
-import type {
- MedusaRequest,
- MedusaResponse,
-} from "@medusajs/medusa"
-import RoleService from "../../../../services/role"
-
-export const POST = async (
- req: MedusaRequest,
- res: MedusaResponse
-) => {
- // omitting validation for simplicity
- const {
- name,
- store_id,
- permissions = [],
- } = req.body
-
- const roleService = req.scope.resolve(
- "roleService"
- ) as RoleService
-
- const role = await roleService.create({
- name,
- store_id,
- permissions,
- })
-
- res.json(role)
-}
-```
-
-This creates the Create Role API Route at `/admin/roles` that uses the `RoleService` to create a new role. Notice that validation of received body parameters is omitted for simplicity.
-
-Next, create the file `src/api/routes/admin/roles/[id]/user/[user_id]/route.ts` with the following content:
-
-```ts title=src/api/routes/admin/roles/[id]/user/[user_id]/route.ts
-import type {
- MedusaRequest,
- MedusaResponse,
-} from "@medusajs/medusa"
-import RoleService from "../../../../services/role"
-
-export const POST = async (
- req: MedusaRequest,
- res: MedusaResponse
-) => {
- // omitting validation for simplicity purposes
- const {
- id,
- user_id,
- } = req.params
-
- const roleService = req.scope.resolve(
- "roleService"
- ) as RoleService
- const role = await roleService.associateUser(id, user_id)
-
- res.json(role)
-}
-```
-
-This creates the Associate User API Route at `/admin/roles/[id]/user/[user_id]` that uses the `RoleService` to associate a role with a user.
-
-To test the API Routes out, run the `build` command in the root directory of your Medusa backend project:
-
-```bash npm2yarn
-npm run build
-```
-
-Then, start the backend with the following command:
-
-```bash
-npx medusa develop
-```
-
-Try first to log in using the [Admin User Login API Route](https://docs.medusajs.com/api/admin#auth_postauth) with an existing admin user. Then, send a `POST` request to the `localhost:9000/admin/roles` API Route with the following request body parameters:
-
-```json
-{
- "store_id": "store_01H8XPDY8WA1Z650MZSEY4Y0V0",
- "name": "Product Manager",
- "permissions": [
- {
- "name": "Allow Products",
- "metadata": {
- "/products": true
- }
}
- ]
-}
-```
-Make sure to replace the `store_id`'s value with your store’s ID. You can retrieve the store’s ID using the [Get Store Details API Route](https://docs.medusajs.com/api/admin#store_getstore).
+ async create(data: CreatePayload): Promise {
+ return this.atomicPhase_(async (manager) => {
+ // omitting validation for simplicity
+ const { permissions: permissionsData = [] } = data
+ delete data.permissions
+
+ const roleRepo = manager.withRepository(
+ this.roleRpository_
+ )
+ const role = roleRepo.create(data)
-This will create a new role with a permission that allows users of this role to access the `/admin/products` API Route. As mentioned before, because of the middleware’s implementation, you must specify the path without the `/admin` prefix. If you chose to implement this differently, such as with regular expressions, then change the permission’s metadata accordingly.
+ role.permissions = []
-Next, create a new user using the [Create User API Route](https://docs.medusajs.com/api/admin#users_postusers). Then, send a `POST` request to `localhost:9000/admin/roles//user/`, where `` is the ID of the role you created, and `` is the ID of the user you created. This will associate the user with the role you created.
+ for (const permissionData of permissionsData) {
+ role.permissions.push(
+ await this.permissionService_.create(
+ permissionData
+ )
+ )
+ }
+ const result = await roleRepo.save(role)
-Finally, login with the user you created, then try to access any API Route other than `/admin/products`. You’ll receive a `401` unauthorized response. Then, try to access the [List Products API Route](https://docs.medusajs.com/api/admin#products_getproducts), and the user should be able to access it as expected.
+ return await this.retrieve(result.id)
+ })
+ }
-
+ async associateUser(
+ role_id: string,
+ user_id: string
+ ): Promise {
+ return this.atomicPhase_(async () => {
+ // omitting validation for simplicity
+ await this.userService_.update(user_id, {
+ role_id,
+ })
+
+ return await this.retrieve(role_id)
+ })
+ }
+ }
+
+ export default RoleService
+ ```
+
+ This creates the `RoleService` with three methods:
+
+ - `retrieve`: Retrieves a role with its relations.
+ - `create`: Creates a new role and, if provided, its permissions as well.
+ - `associateUser`: associates a user with a role.
+
+ Now, you can create the API Routes.
+
+ Start by creating the file `src/api/admin/roles/route.ts` with the following content:
+
+ ```ts title=src/api/admin/roles/route.ts
+ import type {
+ MedusaRequest,
+ MedusaResponse,
+ } from "@medusajs/medusa"
+ import RoleService from "../../../../services/role"
+
+ export const POST = async (
+ req: MedusaRequest,
+ res: MedusaResponse
+ ) => {
+ // omitting validation for simplicity
+ const {
+ name,
+ store_id,
+ permissions = [],
+ } = req.body
+
+ const roleService = req.scope.resolve(
+ "roleService"
+ ) as RoleService
+
+ const role = await roleService.create({
+ name,
+ store_id,
+ permissions,
+ })
+
+ res.json(role)
+ }
+ ```
+
+ This creates the Create Role API Route at `/admin/roles` that uses the `RoleService` to create a new role. Notice that validation of received body parameters is omitted for simplicity.
+
+ Next, create the file `src/api/routes/admin/roles/[id]/user/[user_id]/route.ts` with the following content:
+
+ ```ts title=src/api/routes/admin/roles/[id]/user/[user_id]/route.ts
+ import type {
+ MedusaRequest,
+ MedusaResponse,
+ } from "@medusajs/medusa"
+ import RoleService from "../../../../services/role"
+
+ export const POST = async (
+ req: MedusaRequest,
+ res: MedusaResponse
+ ) => {
+ // omitting validation for simplicity purposes
+ const {
+ id,
+ user_id,
+ } = req.params
+
+ const roleService = req.scope.resolve(
+ "roleService"
+ ) as RoleService
+ const role = await roleService.associateUser(id, user_id)
+
+ res.json(role)
+ }
+ ```
+
+ This creates the Associate User API Route at `/admin/roles/[id]/user/[user_id]` that uses the `RoleService` to associate a role with a user.
+
+ To test the API Routes out, run the `build` command in the root directory of your Medusa backend project:
+
+ ```bash npm2yarn
+ npm run build
+ ```
+
+ Then, start the backend with the following command:
+
+ ```bash
+ npx medusa develop
+ ```
+
+ Try first to log in using the [Admin User Login API Route](https://docs.medusajs.com/api/admin#auth_postauth) with an existing admin user. Then, send a `POST` request to the `localhost:9000/admin/roles` API Route with the following request body parameters:
+
+ ```json
+ {
+ "store_id": "store_01H8XPDY8WA1Z650MZSEY4Y0V0",
+ "name": "Product Manager",
+ "permissions": [
+ {
+ "name": "Allow Products",
+ "metadata": {
+ "/products": true
+ }
+ }
+ ]
+ }
+ ```
+
+ Make sure to replace the `store_id`'s value with your store’s ID. You can retrieve the store’s ID using the [Get Store Details API Route](https://docs.medusajs.com/api/admin#store_getstore).
+
+ This will create a new role with a permission that allows users of this role to access the `/admin/products` API Route. As mentioned before, because of the middleware’s implementation, you must specify the path without the `/admin` prefix. If you chose to implement this differently, such as with regular expressions, then change the permission’s metadata accordingly.
+
+ Next, create a new user using the [Create User API Route](https://docs.medusajs.com/api/admin#users_postusers). Then, send a `POST` request to `localhost:9000/admin/roles//user/`, where `` is the ID of the role you created, and `` is the ID of the user you created. This will associate the user with the role you created.
+
+ Finally, login with the user you created, then try to access any API Route other than `/admin/products`. You’ll receive a `401` unauthorized response. Then, try to access the [List Products API Route](https://docs.medusajs.com/api/admin#products_getproducts), and the user should be able to access it as expected.
+
+
---
diff --git a/www/apps/docs/content/plugins/cms/contentful.md b/www/apps/docs/content/plugins/cms/contentful.mdx
similarity index 64%
rename from www/apps/docs/content/plugins/cms/contentful.md
rename to www/apps/docs/content/plugins/cms/contentful.mdx
index 6178a4ec81..fb0a20cf08 100644
--- a/www/apps/docs/content/plugins/cms/contentful.md
+++ b/www/apps/docs/content/plugins/cms/contentful.mdx
@@ -95,69 +95,59 @@ const plugins = [
The rest of this section includes the field names you can customize using this option for each content model type.
-
-
-product
-
+
+ product
-- `title`
-- `subtitle`
-- `description`
-- `variants`
-- `options`
-- `medusaId`
-- `type`
-- `collection`
-- `tags`
-- `handle`
+ - `title`
+ - `subtitle`
+ - `description`
+ - `variants`
+ - `options`
+ - `medusaId`
+ - `type`
+ - `collection`
+ - `tags`
+ - `handle`
-
+
-
-
-variant
-
+
+ variant
-- `title`
-- `sku`
-- `prices`
-- `options`
-- `medusaId`
+ - `title`
+ - `sku`
+ - `prices`
+ - `options`
+ - `medusaId`
-
+
-
-
-region
-
+
+ region
-- `name`
-- `countries`
-- `paymentProviders`
-- `fulfillmentProviders`
-- `medusaId`
+ - `name`
+ - `countries`
+ - `paymentProviders`
+ - `fulfillmentProviders`
+ - `medusaId`
-
+
-
-
-collection
-
+
+ collection
-- `title`
-- `medusaId`
+ - `title`
+ - `medusaId`
-
+
-
-
-type
-
+
+ type
-- `name`
-- `medusaId`
+ - `name`
+ - `medusaId`
-
+
### Migrate Content Models
@@ -173,252 +163,244 @@ Before creating the migration scripts, run the following command in the root of
npm install --save-dev contentful-migration
```
-
-
-product Content Model
-
+
+ product Content Model
-Create the file `src/loaders/contentful-migrations/product.ts` with the following content:
+ Create the file `src/loaders/contentful-migrations/product.ts` with the following content:
-```ts title=src/loaders/contentful-migrations/product.ts
-import Migration, {
- MigrationContext,
-} from "contentful-migration"
+ ```ts title=src/loaders/contentful-migrations/product.ts
+ import Migration, {
+ MigrationContext,
+ } from "contentful-migration"
-export function productMigration(
- migration: Migration,
- context?: MigrationContext
-) {
- const product = migration
- .createContentType("product")
- .name("Product")
- .displayField("title")
+ export function productMigration(
+ migration: Migration,
+ context?: MigrationContext
+ ) {
+ const product = migration
+ .createContentType("product")
+ .name("Product")
+ .displayField("title")
- product
- .createField("title")
- .name("Title")
- .type("Symbol")
- .required(true)
- product
- .createField("subtitle")
- .name("Subtitle")
- .type("Symbol")
- product
- .createField("handle")
- .name("Handle")
- .type("Symbol")
- product
- .createField("thumbnail")
- .name("Thumbnail")
- .type("Link")
- .linkType("Asset")
- product
- .createField("description")
- .name("Description")
- .type("Text")
- product
- .createField("options")
- .name("Options")
- .type("Object")
- product
- .createField("tags")
- .name("Tags")
- .type("Object")
- product
- .createField("collection")
- .name("Collection")
- .type("Symbol")
- product
- .createField("type")
- .name("Type")
- .type("Symbol")
- product
- .createField("variants")
- .name("Variants")
- .type("Array")
- .items({
- type: "Link",
- linkType: "Entry",
- validations: [
- {
- linkContentType: ["productVariant"],
- },
- ],
- })
- product
- .createField("medusaId")
- .name("Medusa ID")
- .type("Symbol")
-}
-```
-
-
-
-
-
-productVariant Content Model
-
-
-Create the file `src/loaders/contentful-migrations/product-variant.ts` with the following content:
-
-```ts title=src/loaders/contentful-migrations/product-variant.ts
-import Migration, {
- MigrationContext,
-} from "contentful-migration"
-
-export function productVariantMigration(
- migration: Migration,
- context?: MigrationContext
-) {
- const productVariant = migration
- .createContentType("productVariant")
- .name("Product Variant")
- .displayField("title")
-
- productVariant
- .createField("title")
- .name("Title")
- .type("Symbol")
- .required(true)
- productVariant
- .createField("sku")
- .name("SKU")
- .type("Symbol")
- productVariant
- .createField("options")
- .name("Options")
- .type("Object")
- productVariant
- .createField("prices")
- .name("Prices")
- .type("Object")
- productVariant
- .createField("medusaId")
- .name("Medusa ID")
- .type("Symbol")
-}
-```
-
-
-
-
-
-collection Content Model
-
-
-Create the file `src/loaders/contentful-migrations/product-collection.ts` with the following content:
-
-```ts title=src/loaders/contentful-migrations/product-collection.ts
-import Migration, {
- MigrationContext,
-} from "contentful-migration"
-
-export function productCollectionMigration(
- migration: Migration,
- context?: MigrationContext
-) {
- const collection = migration
- .createContentType("collection")
- .name("Product Collection")
- .displayField("title")
-
- collection
+ product
.createField("title")
.name("Title")
.type("Symbol")
.required(true)
- collection
+ product
+ .createField("subtitle")
+ .name("Subtitle")
+ .type("Symbol")
+ product
+ .createField("handle")
+ .name("Handle")
+ .type("Symbol")
+ product
+ .createField("thumbnail")
+ .name("Thumbnail")
+ .type("Link")
+ .linkType("Asset")
+ product
+ .createField("description")
+ .name("Description")
+ .type("Text")
+ product
+ .createField("options")
+ .name("Options")
+ .type("Object")
+ product
+ .createField("tags")
+ .name("Tags")
+ .type("Object")
+ product
+ .createField("collection")
+ .name("Collection")
+ .type("Symbol")
+ product
+ .createField("type")
+ .name("Type")
+ .type("Symbol")
+ product
+ .createField("variants")
+ .name("Variants")
+ .type("Array")
+ .items({
+ type: "Link",
+ linkType: "Entry",
+ validations: [
+ {
+ linkContentType: ["productVariant"],
+ },
+ ],
+ })
+ product
.createField("medusaId")
.name("Medusa ID")
.type("Symbol")
-}
-```
-
+ }
+ ```
-
-
-productType Content Model
-
+
-Create the file `src/loaders/contentful-migrations/product-type.ts` with the following content:
+
+ productVariant Content Model
-```ts title=src/loaders/contentful-migrations/product-type.ts
-import Migration, {
- MigrationContext,
-} from "contentful-migration"
+ Create the file `src/loaders/contentful-migrations/product-variant.ts` with the following content:
-export function productTypeMigration(
- migration: Migration,
- context?: MigrationContext
-) {
- const collection = migration
- .createContentType("productType")
- .name("Product Type")
- .displayField("title")
+ ```ts title=src/loaders/contentful-migrations/product-variant.ts
+ import Migration, {
+ MigrationContext,
+ } from "contentful-migration"
- collection
+ export function productVariantMigration(
+ migration: Migration,
+ context?: MigrationContext
+ ) {
+ const productVariant = migration
+ .createContentType("productVariant")
+ .name("Product Variant")
+ .displayField("title")
+
+ productVariant
.createField("title")
.name("Title")
.type("Symbol")
.required(true)
- collection
+ productVariant
+ .createField("sku")
+ .name("SKU")
+ .type("Symbol")
+ productVariant
+ .createField("options")
+ .name("Options")
+ .type("Object")
+ productVariant
+ .createField("prices")
+ .name("Prices")
+ .type("Object")
+ productVariant
.createField("medusaId")
.name("Medusa ID")
.type("Symbol")
-}
-```
-
+ }
+ ```
+
+
+
+
+ collection Content Model
+
+ Create the file `src/loaders/contentful-migrations/product-collection.ts` with the following content:
+
+ ```ts title=src/loaders/contentful-migrations/product-collection.ts
+ import Migration, {
+ MigrationContext,
+ } from "contentful-migration"
+
+ export function productCollectionMigration(
+ migration: Migration,
+ context?: MigrationContext
+ ) {
+ const collection = migration
+ .createContentType("collection")
+ .name("Product Collection")
+ .displayField("title")
+
+ collection
+ .createField("title")
+ .name("Title")
+ .type("Symbol")
+ .required(true)
+ collection
+ .createField("medusaId")
+ .name("Medusa ID")
+ .type("Symbol")
+ }
+ ```
+
+
+
+
+ productType Content Model
+
+ Create the file `src/loaders/contentful-migrations/product-type.ts` with the following content:
+
+ ```ts title=src/loaders/contentful-migrations/product-type.ts
+ import Migration, {
+ MigrationContext,
+ } from "contentful-migration"
+
+ export function productTypeMigration(
+ migration: Migration,
+ context?: MigrationContext
+ ) {
+ const collection = migration
+ .createContentType("productType")
+ .name("Product Type")
+ .displayField("title")
+
+ collection
+ .createField("title")
+ .name("Title")
+ .type("Symbol")
+ .required(true)
+ collection
+ .createField("medusaId")
+ .name("Medusa ID")
+ .type("Symbol")
+ }
+ ```
+
+
-
-
-region Content Model
-
+
+ region Content Model
-Create the file `src/loaders/contentful-migrations/region.ts` with the following content:
+ Create the file `src/loaders/contentful-migrations/region.ts` with the following content:
-```ts title=src/loaders/contentful-migrations/region.ts
-import Migration, {
- MigrationContext,
-} from "contentful-migration"
+ ```ts title=src/loaders/contentful-migrations/region.ts
+ import Migration, {
+ MigrationContext,
+ } from "contentful-migration"
-export function regionMigration(
- migration: Migration,
- context?: MigrationContext
-) {
- const region = migration
- .createContentType("region")
- .name("Region")
- .displayField("name")
+ export function regionMigration(
+ migration: Migration,
+ context?: MigrationContext
+ ) {
+ const region = migration
+ .createContentType("region")
+ .name("Region")
+ .displayField("name")
- region
- .createField("name")
- .name("Name")
- .type("Symbol")
- .required(true)
- region
- .createField("countries")
- .name("Options")
- .type("Object")
- region
- .createField("paymentProviders")
- .name("Payment Providers")
- .type("Object")
- region
- .createField("fulfillmentProviders")
- .name("Fulfillment Providers")
- .type("Object")
- region
- .createField("currencyCode")
- .name("Currency Code")
- .type("Symbol")
- region
- .createField("medusaId")
- .name("Medusa ID")
- .type("Symbol")
-}
-```
+ region
+ .createField("name")
+ .name("Name")
+ .type("Symbol")
+ .required(true)
+ region
+ .createField("countries")
+ .name("Options")
+ .type("Object")
+ region
+ .createField("paymentProviders")
+ .name("Payment Providers")
+ .type("Object")
+ region
+ .createField("fulfillmentProviders")
+ .name("Fulfillment Providers")
+ .type("Object")
+ region
+ .createField("currencyCode")
+ .name("Currency Code")
+ .type("Symbol")
+ region
+ .createField("medusaId")
+ .name("Medusa ID")
+ .type("Symbol")
+ }
+ ```
-
+
Finally, create a [loader](../../development/loaders/overview.mdx) at `src/loaders/index.ts` with the following content:
diff --git a/www/apps/docs/content/plugins/notifications/sendgrid.mdx b/www/apps/docs/content/plugins/notifications/sendgrid.mdx
index f9246d11ac..aee3dfa4b9 100644
--- a/www/apps/docs/content/plugins/notifications/sendgrid.mdx
+++ b/www/apps/docs/content/plugins/notifications/sendgrid.mdx
@@ -71,7 +71,7 @@ Medusa supports localization so you can also create multiple templates for multi
## Template Reference
-This section covers the template types supported by the plugin and what variables you can expect in your dynamic template. You can use the variables to add details like order total or customer name.
+This section covers the template types supported by the plugin and what variables you can expect in your dynamic template. You can use the variables to add Details like order total or customer name.
:::note
@@ -85,9 +85,9 @@ You don’t have to create a template for every type in the reference. You can s
**Description:** Template to be sent to the customer when they place a new order.
-
- Example Data
-
+
+ Example Data
+
```json noReport
{
"beforeInsert": [Function],
@@ -304,7 +304,8 @@ You don’t have to create a template for every type in the reference. You can s
"updated_at": Any,
}
```
-
+
+
### Order Canceled
@@ -312,8 +313,8 @@ You don’t have to create a template for every type in the reference. You can s
**Description:** Template to be sent to a customer when their order is canceled.
-
- Example Data
+
+ Example Data
```json noReport
{
@@ -535,7 +536,8 @@ You don’t have to create a template for every type in the reference. You can s
"updated_at": Any,
}
```
-
+
+
### Order Shipment Created
@@ -543,8 +545,8 @@ You don’t have to create a template for every type in the reference. You can s
**Description:** Template to be sent to the customer when a shipment of their order has been created.
-
- Example Data
+
+ Example Data
```json noReport
{
@@ -817,7 +819,8 @@ You don’t have to create a template for every type in the reference. You can s
"tracking_number": "",
}
```
-
+
+
### Order Return Requested
@@ -825,8 +828,8 @@ You don’t have to create a template for every type in the reference. You can s
**Description:** Template to be sent to the customer when a return request is made for an order.
-
- Example Data
+
+ Example Data
```json noReport
{
@@ -1259,7 +1262,8 @@ You don’t have to create a template for every type in the reference. You can s
"subtotal": "12.00 USD",
}
```
-
+
+
### Order Items Returned
@@ -1267,8 +1271,8 @@ You don’t have to create a template for every type in the reference. You can s
**Description:** Template to be sent to the customer when an order’s items have been returned.
-
- Example Data
+
+ Example Data
```json noReport
{
@@ -1701,7 +1705,8 @@ You don’t have to create a template for every type in the reference. You can s
"subtotal": "12.00 USD",
}
```
-
+
+
### Claim Shipment Created
@@ -1709,8 +1714,8 @@ You don’t have to create a template for every type in the reference. You can s
**Description:** Template to be sent to the customer when a Claim shipment has been created.
-
- Example Data
+
+ Example Data
```json noReport
{
@@ -1998,7 +2003,8 @@ You don’t have to create a template for every type in the reference. You can s
"tracking_number": "",
}
```
-
+
+
### Swap Created
@@ -2006,8 +2012,8 @@ You don’t have to create a template for every type in the reference. You can s
**Description:** Template to be sent to the customer when a swap for an order has been created.
-
- Example Data
+
+ Example Data
```json noReport
{
@@ -2507,7 +2513,8 @@ You don’t have to create a template for every type in the reference. You can s
"additional_total": "11.25 USD"
}
```
-
+
+
### Swap Shipment Created
@@ -2515,8 +2522,8 @@ You don’t have to create a template for every type in the reference. You can s
**Description:** Template to be sent to the customer when a shipment of a swap of an order has been created.
-
- Example Data
+
+ Example Data
```json noReport
Object {
@@ -3087,7 +3094,8 @@ You don’t have to create a template for every type in the reference. You can s
"tracking_number": "",
}
```
-
+
+
### Swap Received
@@ -3095,8 +3103,8 @@ You don’t have to create a template for every type in the reference. You can s
**Description:** Template to be sent to the customer when a swap of an order has been received.
-
- Example Data
+
+ Example Data
```json noReport
{
@@ -3597,7 +3605,8 @@ You don’t have to create a template for every type in the reference. You can s
"additional_total": "11.25 USD"
}
```
-
+
+
### Gift Card Created
@@ -3605,8 +3614,8 @@ You don’t have to create a template for every type in the reference. You can s
**Description:** Template to be to the customer sent when a gift card in their order has been created.
-
- Example Data
+
+ Example Data
```json noReport
Object {
@@ -3765,7 +3774,8 @@ You don’t have to create a template for every type in the reference. You can s
"display_value": 4
}
```
-
+
+
### Customer Password Reset
@@ -3773,8 +3783,8 @@ You don’t have to create a template for every type in the reference. You can s
**Description:** Template to be sent to the customer when they request a password reset.
-
- Example Data
+
+ Example Data
```json noReport
Object {
@@ -3785,7 +3795,8 @@ You don’t have to create a template for every type in the reference. You can s
"token": Any,
}
```
-
+
+
### User Password Reset
@@ -3793,8 +3804,8 @@ You don’t have to create a template for every type in the reference. You can s
**Description:** Template to be sent to the admin user when they request a password reset.
-
- Example Data
+
+ Example Data
```json noReport
Object {
@@ -3802,7 +3813,8 @@ You don’t have to create a template for every type in the reference. You can s
"token": Any,
}
```
-
+
+
### Restock Notification
@@ -3810,8 +3822,8 @@ You don’t have to create a template for every type in the reference. You can s
**Description:** Template to be sent to admin users when a product has hit the restock quantity threshold.
-
- Example Data
+
+ Example Data
```json noReport
Object {
@@ -3899,7 +3911,8 @@ You don’t have to create a template for every type in the reference. You can s
]
}
```
-
+
+
---
@@ -4004,8 +4017,7 @@ export const POST = async (
to: "customer@mail.com",
dynamic_template_data: { dynamic: "data" },
}
-
- sendgridService.sendEmail(sendOptions)
+ sendgridService.sendEmail(sendOptions)
}
```
diff --git a/www/apps/docs/content/recipes/b2b.mdx b/www/apps/docs/content/recipes/b2b.mdx
index a878fe04d4..c1f595ecc2 100644
--- a/www/apps/docs/content/recipes/b2b.mdx
+++ b/www/apps/docs/content/recipes/b2b.mdx
@@ -266,62 +266,60 @@ Medusa allows you to create custom API Routes exposed as REST APIs.
}
}} />
-
-
-Example Implementation
-
+
+ Example Implementation
-For example, create the following API Route that allows you to check the customer’s group and whether it has the `is_b2b` flag enabled:
+ For example, create the following API Route that allows you to check the customer’s group and whether it has the `is_b2b` flag enabled:
+
+ ```ts title=src/api/store/customers/is-b2b/route.ts
+ import type {
+ CustomerService,
+ MedusaRequest,
+ MedusaResponse,
+ } from "@medusajs/medusa"
+
+ export const GET = async (
+ req: MedusaRequest,
+ res: MedusaResponse
+ ) => {
+ const customerService: CustomerService = req.scope.resolve(
+ "customerService"
+ )
+
+ const customer = await customerService
+ .retrieve(req.user.customer_id, {
+ relations: ["groups"],
+ })
+
+ const is_b2b = customer.groups.some(
+ (group) => group.metadata.is_b2b === "true"
+ )
-```ts title=src/api/store/customers/is-b2b/route.ts
-import type {
- CustomerService,
- MedusaRequest,
- MedusaResponse,
-} from "@medusajs/medusa"
-
-export const GET = async (
- req: MedusaRequest,
- res: MedusaResponse
-) => {
- const customerService: CustomerService = req.scope.resolve(
- "customerService"
- )
-
- const customer = await customerService
- .retrieve(req.user.customer_id, {
- relations: ["groups"],
+ return res.json({
+ is_b2b,
})
+ }
+ ```
- const is_b2b = customer.groups.some(
- (group) => group.metadata.is_b2b === "true"
- )
-
- return res.json({
- is_b2b,
- })
-}
-```
+ Then add the `requireCustomerAuthentication` middleware in `src/api/middlewares.ts` that ensures only authenticated customer can access this API Route:
-Then add the `requireCustomerAuthentication` middleware in `src/api/middlewares.ts` that ensures only authenticated customer can access this API Route:
+ ```ts title=src/api/middlewares.ts
+ import {
+ requireCustomerAuthentication,
+ type MiddlewaresConfig,
+ } from "@medusajs/medusa"
-```ts title=src/api/middlewares.ts
-import {
- requireCustomerAuthentication,
- type MiddlewaresConfig,
-} from "@medusajs/medusa"
+ export const config: MiddlewaresConfig = {
+ routes: [
+ {
+ matcher: "/store/customers/is-b2b",
+ middlewares: [requireCustomerAuthentication()],
+ },
+ ],
+ }
+ ```
-export const config: MiddlewaresConfig = {
- routes: [
- {
- matcher: "/store/customers/is-b2b",
- middlewares: [requireCustomerAuthentication()],
- },
- ],
-}
-```
-
-
+
---
diff --git a/www/apps/docs/content/recipes/commerce-automation.mdx b/www/apps/docs/content/recipes/commerce-automation.mdx
index 0c4e92a812..32522bd9b4 100644
--- a/www/apps/docs/content/recipes/commerce-automation.mdx
+++ b/www/apps/docs/content/recipes/commerce-automation.mdx
@@ -100,85 +100,83 @@ Medusa also provides official notification plugins that integrate with third-par
},
]} />
-
-
-Example: Sending an email for new notes
-
-
-Here’s an example of a subscriber that uses the SendGrid plugin to send an email to the customer when the order has a new note:
+
+ Example: Sending an email for new notes
-```ts title=src/subscribers/new-note.ts
-import {
- EventBusService,
- NoteService,
- OrderService,
-} from "@medusajs/medusa"
+ Here’s an example of a subscriber that uses the SendGrid plugin to send an email to the customer when the order has a new note:
-type InjectedDependencies = {
- eventBusService: EventBusService
- sendgridService: any
- noteService: NoteService
- orderService: OrderService
-}
+ ```ts title=src/subscribers/new-note.ts
+ import {
+ EventBusService,
+ NoteService,
+ OrderService,
+ } from "@medusajs/medusa"
-class NewNoteSubscriber {
- protected sendGridService_: any
- protected noteService_: NoteService
- protected orderService_: OrderService
-
- constructor({
- eventBusService,
- sendgridService,
- noteService,
- orderService,
- }: InjectedDependencies) {
- this.noteService_ = noteService
- this.orderService_ = orderService
- this.sendGridService_ = sendgridService
- eventBusService.subscribe(
- "note.created",
- this.handleNoteCreated
- )
+ type InjectedDependencies = {
+ eventBusService: EventBusService
+ sendgridService: any
+ noteService: NoteService
+ orderService: OrderService
}
- handleNoteCreated = async (data) => {
- // retrieve note by id
- const note = await this.noteService_.retrieve(data.id, {
- relations: ["author"],
- })
+ class NewNoteSubscriber {
+ protected sendGridService_: any
+ protected noteService_: NoteService
+ protected orderService_: OrderService
- if (!note || note.resource_type !== "order") {
- return
+ constructor({
+ eventBusService,
+ sendgridService,
+ noteService,
+ orderService,
+ }: InjectedDependencies) {
+ this.noteService_ = noteService
+ this.orderService_ = orderService
+ this.sendGridService_ = sendgridService
+ eventBusService.subscribe(
+ "note.created",
+ this.handleNoteCreated
+ )
}
- // retrieve note's order
- const order = await this.orderService_.retrieve(
- note.resource_id
- )
+ handleNoteCreated = async (data) => {
+ // retrieve note by id
+ const note = await this.noteService_.retrieve(data.id, {
+ relations: ["author"],
+ })
- if (!order) {
- return
+ if (!note || note.resource_type !== "order") {
+ return
+ }
+
+ // retrieve note's order
+ const order = await this.orderService_.retrieve(
+ note.resource_id
+ )
+
+ if (!order) {
+ return
+ }
+
+ this.sendGridService_.sendEmail({
+ templateId: "order-update",
+ from: "hello@medusajs.com",
+ to: order.email,
+ dynamic_template_data: {
+ // any data necessary for your template...
+ note_text: note.value,
+ note_author: note.author.first_name,
+ note_date: note.created_at,
+ order_id: order.display_id,
+ },
+ })
}
-
- this.sendGridService_.sendEmail({
- templateId: "order-update",
- from: "hello@medusajs.com",
- to: order.email,
- dynamic_template_data: {
- // any data necessary for your template...
- note_text: note.value,
- note_author: note.author.first_name,
- note_date: note.created_at,
- order_id: order.display_id,
- },
- })
}
-}
-export default NewNoteSubscriber
-```
+ export default NewNoteSubscriber
+ ```
-
+
---
@@ -198,75 +196,73 @@ You can implement automatic synchronization in Medusa using scheduled jobs. A sc
}
}} />
-
-
-Example: Synchronizing products with a third-party service
-
+
+ Example: Synchronizing products with a third-party service
-Here’s an example of synchronizing products with a third party service using a [loader](../development/loaders/create.md):
+ Here’s an example of synchronizing products with a third party service using a [loader](../development/loaders/create.md):
-```ts title=src/loaders/sync-products.ts
-import {
- Logger,
- ProductService,
- StoreService,
-} from "@medusajs/medusa"
-import {
- ProductSelector,
-} from "@medusajs/medusa/dist/types/product"
-import { AwilixContainer } from "awilix"
+ ```ts title=src/loaders/sync-products.ts
+ import {
+ Logger,
+ ProductService,
+ StoreService,
+ } from "@medusajs/medusa"
+ import {
+ ProductSelector,
+ } from "@medusajs/medusa/dist/types/product"
+ import { AwilixContainer } from "awilix"
-export default async (
- container: AwilixContainer,
- config: Record
-): Promise => {
- const logger = container.resolve("logger")
- logger.info("Synchronizing products...")
- const productService = container.resolve(
- "productService"
- )
- const storeService = container.resolve(
- "storeService"
- )
- // retrieve store to get last sync date
- const store = await storeService.retrieve()
+ export default async (
+ container: AwilixContainer,
+ config: Record
+ ): Promise => {
+ const logger = container.resolve("logger")
+ logger.info("Synchronizing products...")
+ const productService = container.resolve(
+ "productService"
+ )
+ const storeService = container.resolve(
+ "storeService"
+ )
+ // retrieve store to get last sync date
+ const store = await storeService.retrieve()
- const productFilters: ProductSelector = {}
+ const productFilters: ProductSelector = {}
- if (store.metadata.last_sync_date) {
- productFilters.updated_at = {
- gt: new Date(
- store.metadata.last_sync_date as string
- ),
+ if (store.metadata.last_sync_date) {
+ productFilters.updated_at = {
+ gt: new Date(
+ store.metadata.last_sync_date as string
+ ),
+ }
}
+
+ const updatedProducts = await productService.list(
+ productFilters
+ )
+
+ updatedProducts.forEach((product) => {
+ // assuming client is an initialized connection
+ // with a third-party service
+ client.sync(product)
+ })
+
+ await storeService.update({
+ metadata: {
+ last_sync_date: new Date(),
+ },
+ })
+
+ logger.info("Finish synchronizing products")
}
+ ```
- const updatedProducts = await productService.list(
- productFilters
- )
-
- updatedProducts.forEach((product) => {
- // assuming client is an initialized connection
- // with a third-party service
- client.sync(product)
- })
+ Notice that here it’s assumed that:
- await storeService.update({
- metadata: {
- last_sync_date: new Date(),
- },
- })
-
- logger.info("Finish synchronizing products")
-}
-```
+ 1. The last update date is stored in the `Store`'s metadata object. You can instead use a custom entity to handle this.
+ 2. The connection to the third-party service is assumed to be available and handled within the `client` variable.
-Notice that here it’s assumed that:
-
-1. The last update date is stored in the `Store`'s metadata object. You can instead use a custom entity to handle this.
-2. The connection to the third-party service is assumed to be available and handled within the `client` variable.
-
-
+
---
@@ -419,88 +415,86 @@ For example, if you're grouping customers with over twenty orders, you can use a
},
]} />
-
-
-Example: Add customer to VIP group
-
+
+ Example: Add customer to VIP group
-Here’s an example of a subscriber that listens to the `order.placed` event and checks if the customer should be added to the VIP customer group based on their number of orders:
+ Here’s an example of a subscriber that listens to the `order.placed` event and checks if the customer should be added to the VIP customer group based on their number of orders:
-```ts title=src/subscribers/add-custom-to-vip.ts
-import {
- CustomerGroupService,
- CustomerService,
- EventBusService,
- OrderService,
-} from "@medusajs/medusa"
+ ```ts title=src/subscribers/add-custom-to-vip.ts
+ import {
+ CustomerGroupService,
+ CustomerService,
+ EventBusService,
+ OrderService,
+ } from "@medusajs/medusa"
-type InjectedDependencies = {
- orderService: OrderService
- customerService: CustomerService
- customerGroupService: CustomerGroupService
- eventBusService: EventBusService
-}
-
-class AddCustomerToVipSubscriber {
- protected orderService_: OrderService
- protected customerService_: CustomerService
- protected customerGroupService_: CustomerGroupService
-
- constructor({
- orderService,
- customerService,
- customerGroupService,
- eventBusService,
- }: InjectedDependencies) {
- this.orderService_ = orderService
- this.customerService_ = customerService
- this.customerGroupService_ = customerGroupService
- eventBusService.subscribe(
- "order.placed",
- this.handleOrderPlaced
- )
+ type InjectedDependencies = {
+ orderService: OrderService
+ customerService: CustomerService
+ customerGroupService: CustomerGroupService
+ eventBusService: EventBusService
}
- handleOrderPlaced = async ({ id }) => {
- // check if VIP group exists
- const vipGroup = await this.customerGroupService_.list({
- name: "VIP",
- }, {
- relations: ["customers"],
- })
- if (!vipGroup.length) {
- return
- }
+ class AddCustomerToVipSubscriber {
+ protected orderService_: OrderService
+ protected customerService_: CustomerService
+ protected customerGroupService_: CustomerGroupService
- // retrieve order and its customer
- const order = await this.orderService_.retrieve(id)
-
- if (!order || !order.customer_id ||
- vipGroup[0].customers.find(
- (customer) => customer.id === order.customer_id
- ) !== undefined) {
- return
- }
-
- // retrieve orders of this customer
- const [, count] = await this.orderService_.listAndCount({
- customer_id: order.customer_id,
- })
-
- if (count >= 20) {
- // add customer to VIP group
- this.customerGroupService_.addCustomers(
- vipGroup[0].id,
- order.customer_id
+ constructor({
+ orderService,
+ customerService,
+ customerGroupService,
+ eventBusService,
+ }: InjectedDependencies) {
+ this.orderService_ = orderService
+ this.customerService_ = customerService
+ this.customerGroupService_ = customerGroupService
+ eventBusService.subscribe(
+ "order.placed",
+ this.handleOrderPlaced
)
}
+
+ handleOrderPlaced = async ({ id }) => {
+ // check if VIP group exists
+ const vipGroup = await this.customerGroupService_.list({
+ name: "VIP",
+ }, {
+ relations: ["customers"],
+ })
+ if (!vipGroup.length) {
+ return
+ }
+
+ // retrieve order and its customer
+ const order = await this.orderService_.retrieve(id)
+
+ if (!order || !order.customer_id ||
+ vipGroup[0].customers.find(
+ (customer) => customer.id === order.customer_id
+ ) !== undefined) {
+ return
+ }
+
+ // retrieve orders of this customer
+ const [, count] = await this.orderService_.listAndCount({
+ customer_id: order.customer_id,
+ })
+
+ if (count >= 20) {
+ // add customer to VIP group
+ this.customerGroupService_.addCustomers(
+ vipGroup[0].id,
+ order.customer_id
+ )
+ }
+ }
}
-}
-export default AddCustomerToVipSubscriber
-```
+ export default AddCustomerToVipSubscriber
+ ```
-
+
---
@@ -543,105 +537,103 @@ You can alternatively have a Scheduled Job that checks if the number of new prod
},
]} />
-
-
-Example: Sending a newsletter email after adding ten products
-
+
+ Example: Sending a newsletter email after adding ten products
-Here’s an example of listening to the `product.created` event in a subscriber and send a newsletter if the condition is met:
+ Here’s an example of listening to the `product.created` event in a subscriber and send a newsletter if the condition is met:
-```ts title=src/subscribers/send-products-newsletter.ts
-import {
- CustomerService,
- EventBusService,
- NoteService,
- OrderService,
- ProductService,
- StoreService,
-} from "@medusajs/medusa"
-import {
- ProductSelector,
-} from "@medusajs/medusa/dist/types/product"
+ ```ts title=src/subscribers/send-products-newsletter.ts
+ import {
+ CustomerService,
+ EventBusService,
+ NoteService,
+ OrderService,
+ ProductService,
+ StoreService,
+ } from "@medusajs/medusa"
+ import {
+ ProductSelector,
+ } from "@medusajs/medusa/dist/types/product"
-type InjectedDependencies = {
- eventBusService: EventBusService
- sendgridService: any
- productService: ProductService
- storeService: StoreService
- customerService: CustomerService
-}
-
-class SendProductsNewsletterSubscriber {
- protected sendGridService_: any
- protected productService_: ProductService
- protected storeService_: StoreService
- protected customerService_: CustomerService
-
- constructor({
- eventBusService,
- sendgridService,
- productService,
- storeService,
- customerService,
- }: InjectedDependencies) {
- this.productService_ = productService
- this.sendGridService_ = sendgridService
- this.storeService_ = storeService
- this.customerService_ = customerService
- eventBusService.subscribe(
- "product.created",
- this.handleProductCreated
- )
+ type InjectedDependencies = {
+ eventBusService: EventBusService
+ sendgridService: any
+ productService: ProductService
+ storeService: StoreService
+ customerService: CustomerService
}
- handleProductCreated = async ({ id }) => {
- // retrieve store to have access to last send date
- const store = await this.storeService_.retrieve()
-
- const productFilters: ProductSelector = {}
- if (store.metadata.last_send_date) {
- productFilters.created_at = {
- gt: new Date(store.metadata.last_send_date as string),
+ class SendProductsNewsletterSubscriber {
+ protected sendGridService_: any
+ protected productService_: ProductService
+ protected storeService_: StoreService
+ protected customerService_: CustomerService
+
+ constructor({
+ eventBusService,
+ sendgridService,
+ productService,
+ storeService,
+ customerService,
+ }: InjectedDependencies) {
+ this.productService_ = productService
+ this.sendGridService_ = sendgridService
+ this.storeService_ = storeService
+ this.customerService_ = customerService
+ eventBusService.subscribe(
+ "product.created",
+ this.handleProductCreated
+ )
+ }
+
+ handleProductCreated = async ({ id }) => {
+ // retrieve store to have access to last send date
+ const store = await this.storeService_.retrieve()
+
+ const productFilters: ProductSelector = {}
+ if (store.metadata.last_send_date) {
+ productFilters.created_at = {
+ gt: new Date(store.metadata.last_send_date as string),
+ }
+ }
+
+ const products = await this.productService_.list(
+ productFilters
+ )
+
+ if (products.length > 10) {
+ // get subscribed customers
+ const customers = await this.customerService_.list({
+ metadata: {
+ is_subscribed: true,
+ },
+ })
+ this.sendGridService_.sendEmail({
+ templateId: "product-newsletter",
+ from: "hello@medusajs.com",
+ to: customers.map((customer) => ({
+ name: customer.first_name,
+ email: customer.email,
+ })),
+ dynamic_template_data: {
+ // any data necessary for your template...
+ products,
+ },
+ })
+
+ await this.storeService_.update({
+ metadata: {
+ last_send_date: new Date(),
+ },
+ })
}
}
-
- const products = await this.productService_.list(
- productFilters
- )
-
- if (products.length > 10) {
- // get subscribed customers
- const customers = await this.customerService_.list({
- metadata: {
- is_subscribed: true,
- },
- })
- this.sendGridService_.sendEmail({
- templateId: "product-newsletter",
- from: "hello@medusajs.com",
- to: customers.map((customer) => ({
- name: customer.first_name,
- email: customer.email,
- })),
- dynamic_template_data: {
- // any data necessary for your template...
- products,
- },
- })
-
- await this.storeService_.update({
- metadata: {
- last_send_date: new Date(),
- },
- })
- }
}
-}
-export default SendProductsNewsletterSubscriber
-```
+ export default SendProductsNewsletterSubscriber
+ ```
-
+
---
diff --git a/www/apps/docs/content/recipes/digital-products.mdx b/www/apps/docs/content/recipes/digital-products.mdx
index 44235e6539..b1326b13c0 100644
--- a/www/apps/docs/content/recipes/digital-products.mdx
+++ b/www/apps/docs/content/recipes/digital-products.mdx
@@ -135,99 +135,97 @@ For example, if you're selling the Harry Potter movies, you would have a `Produc
},
]} />
-
-
-Example: Create ProductMedia Entity
-
+
+ Example: Create ProductMedia Entity
-In this example, you’ll create a `ProductMedia` entity that is associated with the `ProductVariant` entity in a one-to-many relation.
+ In this example, you’ll create a `ProductMedia` entity that is associated with the `ProductVariant` entity in a one-to-many relation.
-To do that, create the file `src/models/product-media.ts` with the following content:
+ To do that, create the file `src/models/product-media.ts` with the following content:
-```ts title=src/models/product-media.ts
-import {
- BeforeInsert,
- Column,
- Entity,
-} from "typeorm"
-import { BaseEntity, ProductVariant } from "@medusajs/medusa"
-import { generateEntityId } from "@medusajs/medusa/dist/utils"
+ ```ts title=src/models/product-media.ts
+ import {
+ BeforeInsert,
+ Column,
+ Entity,
+ } from "typeorm"
+ import { BaseEntity, ProductVariant } from "@medusajs/medusa"
+ import { generateEntityId } from "@medusajs/medusa/dist/utils"
-export enum MediaType {
- MAIN = "main",
- PREVIEW = "preview"
-}
-
-@Entity()
-export class ProductMedia extends BaseEntity {
- @Column({ type: "varchar" })
- name: string
-
- @Column ({ type: "enum", enum: MediaType, default: "main" })
- type: MediaType
-
- @Column({ type: "varchar" })
- file_key: string
-
- @Column({ type: "varchar" })
- mime_type: string
-
- @Column({ type: "varchar" })
- variant_id: string
-
- variant?: ProductVariant
-
- @BeforeInsert()
- private beforeInsert(): void {
- this.id = generateEntityId(this.id, "post")
+ export enum MediaType {
+ MAIN = "main",
+ PREVIEW = "preview"
}
-}
-```
-The entity has the following attributes:
+ @Entity()
+ export class ProductMedia extends BaseEntity {
+ @Column({ type: "varchar" })
+ name: string
-- `name`: a string indicating the file name or a name entered by the merchant.
-- `type`: an enum value indicating the type of file. If the file’s type is `main`, it means that this is the file that customers download when they purchase the product. If its type is `preview`, it means that the file is only used to preview the product variant to the customer.
-- `file_key`: a string that indicates the downloadable file’s key. The key is retrieved by the installed file service, which is covered in the next step, and it’s used later if you want to get a downloadable link or delete the file.
-- `variant_id`: a string indicating the ID of the product variant this file is associated with.
-- `mime_type`: a string indicating the MIME type of the product variant.
+ @Column ({ type: "enum", enum: MediaType, default: "main" })
+ type: MediaType
-Next, you need to create a migration script that reflects the changes on the database schema.
+ @Column({ type: "varchar" })
+ file_key: string
-To do that, run the following command to create a migration file:
+ @Column({ type: "varchar" })
+ mime_type: string
-```bash
-npx typeorm migration:create src/migrations/ProductMediaCreate
-```
+ @Column({ type: "varchar" })
+ variant_id: string
-This will create a file in the `src/migrations` directory. The file’s name will be of the format `-ProductMediaCreate.ts`, where `` is the time this migration was created.
+ variant?: ProductVariant
-In the class defined in the file, change the `up` and `down` method to the following:
+ @BeforeInsert()
+ private beforeInsert(): void {
+ this.id = generateEntityId(this.id, "post")
+ }
+ }
+ ```
+
+ The entity has the following attributes:
+
+ - `name`: a string indicating the file name or a name entered by the merchant.
+ - `type`: an enum value indicating the type of file. If the file’s type is `main`, it means that this is the file that customers download when they purchase the product. If its type is `preview`, it means that the file is only used to preview the product variant to the customer.
+ - `file_key`: a string that indicates the downloadable file’s key. The key is retrieved by the installed file service, which is covered in the next step, and it’s used later if you want to get a downloadable link or delete the file.
+ - `variant_id`: a string indicating the ID of the product variant this file is associated with.
+ - `mime_type`: a string indicating the MIME type of the product variant.
+
+ Next, you need to create a migration script that reflects the changes on the database schema.
+
+ To do that, run the following command to create a migration file:
+
+ ```bash
+ npx typeorm migration:create src/migrations/ProductMediaCreate
+ ```
+
+ This will create a file in the `src/migrations` directory. The file’s name will be of the format `-ProductMediaCreate.ts`, where `` is the time this migration was created.
+
+ In the class defined in the file, change the `up` and `down` method to the following:
-```ts
-export class ProductMediaCreate1693901604934 implements MigrationInterface {
- public async up(queryRunner: QueryRunner): Promise {
- await queryRunner.query(`CREATE TYPE "public"."product_media_type_enum" AS ENUM('main', 'preview')`)
- await queryRunner.query(`CREATE TABLE "product_media" ("id" character varying NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "name" character varying NOT NULL, "type" "public"."product_media_type_enum" NOT NULL DEFAULT 'main', "file_key" character varying NOT NULL, "mime_type" character varying NOT NULL, "variant_id" character varying NOT NULL, CONSTRAINT "PK_09d4639de8082a32aa27f3ac9a6" PRIMARY KEY ("id"))`)
+ ```ts
+ export class ProductMediaCreate1693901604934 implements MigrationInterface {
+ public async up(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(`CREATE TYPE "public"."product_media_type_enum" AS ENUM('main', 'preview')`)
+ await queryRunner.query(`CREATE TABLE "product_media" ("id" character varying NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "name" character varying NOT NULL, "type" "public"."product_media_type_enum" NOT NULL DEFAULT 'main', "file_key" character varying NOT NULL, "mime_type" character varying NOT NULL, "variant_id" character varying NOT NULL, CONSTRAINT "PK_09d4639de8082a32aa27f3ac9a6" PRIMARY KEY ("id"))`)
+ }
+
+ public async down(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(`DROP TABLE "product_media"`)
+ await queryRunner.query(`DROP TYPE "public"."product_media_type_enum"`)
+ }
}
+ ```
- public async down(queryRunner: QueryRunner): Promise {
- await queryRunner.query(`DROP TABLE "product_media"`)
- await queryRunner.query(`DROP TYPE "public"."product_media_type_enum"`)
- }
-}
-```
+ To apply the migrations on your database and create the `product_media` table, run the following commands in the root directory of your Medusa backend:
-To apply the migrations on your database and create the `product_media` table, run the following commands in the root directory of your Medusa backend:
+ ```bash npm2yarn
+ npm run build
+ npx medusa migrations run
+ ```
-```bash npm2yarn
-npm run build
-npx medusa migrations run
-```
-
-
+
---
@@ -267,263 +265,261 @@ Creating an API Route also requires creating a service, which is a class that ty
},
]} />
-
-
-Example: List and Create API Routes
-
+
+ Example: List and Create API Routes
-This example showcases how you can create the list and create API Routes for digital products. These API Routes are chosen in particular as they’re used in later parts of this recipe. You may follow the same instructions to create other necessary API Routes.
+ This example showcases how you can create the list and create API Routes for digital products. These API Routes are chosen in particular as they’re used in later parts of this recipe. You may follow the same instructions to create other necessary API Routes.
-Before creating the API Routes, you’ll create the `ProductMediaService`. Create the file `src/services/product-media.ts` with the following content:
+ Before creating the API Routes, you’ll create the `ProductMediaService`. Create the file `src/services/product-media.ts` with the following content:
-```ts title=src/services/product-media.ts
-import {
- FindConfig,
- ProductVariantService,
- Selector,
- TransactionBaseService,
- buildQuery,
-} from "@medusajs/medusa"
-import { ProductMedia } from "../models/product-media"
-import { MedusaError } from "@medusajs/utils"
+ ```ts title=src/services/product-media.ts
+ import {
+ FindConfig,
+ ProductVariantService,
+ Selector,
+ TransactionBaseService,
+ buildQuery,
+ } from "@medusajs/medusa"
+ import { ProductMedia } from "../models/product-media"
+ import { MedusaError } from "@medusajs/utils"
-type InjectedDependencies = {
- productVariantService: ProductVariantService
-}
-
-class ProductMediaService extends TransactionBaseService {
- protected productVariantService_: ProductVariantService
-
- constructor(container: InjectedDependencies) {
- super(container)
- this.productVariantService_ =
- container.productVariantService
+ type InjectedDependencies = {
+ productVariantService: ProductVariantService
}
- private checkVariantInRelations(
- relations: string[]
- ): [string[], boolean] {
- const variantsRelationIndex = relations.indexOf("variant")
- const isVariantsEnabled = variantsRelationIndex !== -1
- if (isVariantsEnabled) {
- relations.splice(variantsRelationIndex, 1)
+ class ProductMediaService extends TransactionBaseService {
+ protected productVariantService_: ProductVariantService
+
+ constructor(container: InjectedDependencies) {
+ super(container)
+ this.productVariantService_ =
+ container.productVariantService
}
- return [relations, isVariantsEnabled]
- }
+ private checkVariantInRelations(
+ relations: string[]
+ ): [string[], boolean] {
+ const variantsRelationIndex = relations.indexOf("variant")
+ const isVariantsEnabled = variantsRelationIndex !== -1
+ if (isVariantsEnabled) {
+ relations.splice(variantsRelationIndex, 1)
+ }
- async listAndCount(
- selector?: Selector,
- config: FindConfig = {
- skip: 0,
- take: 20,
- relations: [],
- }
- ): Promise<[ProductMedia[], number]> {
- const productMediaRepo = this.activeManager_.getRepository(
- ProductMedia
- )
-
- const [
- relations,
- isVariantsEnabled,
- ] = this.checkVariantInRelations(
- config.relations || []
- )
-
- config.relations = relations
-
- const query = buildQuery(selector, config)
-
- const [
- productMedias,
- count,
- ] = await productMediaRepo.findAndCount(query)
-
- if (isVariantsEnabled) {
- // retrieve product variants
- await Promise.all(productMedias.map(
- async (media, index) => {
- productMedias[index].variant =
- await this.retrieveVariantByMedia(media)
- }))
+ return [relations, isVariantsEnabled]
}
- return [productMedias, count]
- }
-
- async list(
- selector?: Selector,
- config: FindConfig = {
- skip: 0,
- take: 20,
- relations: [],
- }
- ): Promise {
- const [productMedias] = await this.listAndCount(
- selector, config
+ async listAndCount(
+ selector?: Selector,
+ config: FindConfig = {
+ skip: 0,
+ take: 20,
+ relations: [],
+ }
+ ): Promise<[ProductMedia[], number]> {
+ const productMediaRepo = this.activeManager_.getRepository(
+ ProductMedia
)
- return productMedias
- }
+ const [
+ relations,
+ isVariantsEnabled,
+ ] = this.checkVariantInRelations(
+ config.relations || []
+ )
- async retrieve(
- id: string,
- config?: FindConfig
- ): Promise {
- const productMediaRepo = this.activeManager_.getRepository(
- ProductMedia
- )
+ config.relations = relations
- const query = buildQuery({
- id,
- }, config)
+ const query = buildQuery(selector, config)
- const productMedia = await productMediaRepo.findOne(query)
+ const [
+ productMedias,
+ count,
+ ] = await productMediaRepo.findAndCount(query)
- if (!productMedia) {
- throw new MedusaError(
- MedusaError.Types.NOT_FOUND,
- "ProductMedia was not found"
+ if (isVariantsEnabled) {
+ // retrieve product variants
+ await Promise.all(productMedias.map(
+ async (media, index) => {
+ productMedias[index].variant =
+ await this.retrieveVariantByMedia(media)
+ }))
+ }
+
+ return [productMedias, count]
+ }
+
+ async list(
+ selector?: Selector,
+ config: FindConfig = {
+ skip: 0,
+ take: 20,
+ relations: [],
+ }
+ ): Promise {
+ const [productMedias] = await this.listAndCount(
+ selector, config
+ )
+
+ return productMedias
+ }
+
+ async retrieve(
+ id: string,
+ config?: FindConfig
+ ): Promise {
+ const productMediaRepo = this.activeManager_.getRepository(
+ ProductMedia
+ )
+
+ const query = buildQuery({
+ id,
+ }, config)
+
+ const productMedia = await productMediaRepo.findOne(query)
+
+ if (!productMedia) {
+ throw new MedusaError(
+ MedusaError.Types.NOT_FOUND,
+ "ProductMedia was not found"
+ )
+ }
+
+ if (config.relations.includes("variant")) {
+ productMedia.variant = await this.retrieveVariantByMedia(
+ productMedia
+ )
+ }
+
+ return productMedia
+ }
+
+ async retrieveVariantByMedia(productMedia: ProductMedia) {
+ return await this.productVariantService_.retrieve(
+ productMedia.variant_id,
+ {
+ relations: ["product"],
+ }
)
}
- if (config.relations.includes("variant")) {
- productMedia.variant = await this.retrieveVariantByMedia(
- productMedia
- )
+ async create(
+ data: Pick<
+ ProductMedia,
+ "name" | "file_key" | "variant_id" | "type" | "mime_type"
+ >
+ ): Promise {
+ return this.atomicPhase_(async (manager) => {
+ const productMediaRepo = manager.getRepository(
+ ProductMedia
+ )
+ const productMedia = productMediaRepo.create(data)
+ const result = await productMediaRepo.save(productMedia)
+
+ return result
+ })
}
- return productMedia
+ async update(
+ id: string,
+ data: Omit, "id">
+ ): Promise {
+ return await this.atomicPhase_(async (manager) => {
+ const productMediaRepo = manager.getRepository(
+ ProductMedia
+ )
+ const productMedia = await this.retrieve(id)
+
+ Object.assign(productMedia, data)
+
+ return await productMediaRepo.save(productMedia)
+ })
+ }
+
+ async delete(id: string): Promise {
+ return await this.atomicPhase_(async (manager) => {
+ const productMediaRepo = manager.getRepository(
+ ProductMedia
+ )
+ const productMedia = await this.retrieve(id)
+
+ await productMediaRepo.remove([productMedia])
+ })
+ }
}
- async retrieveVariantByMedia(productMedia: ProductMedia) {
- return await this.productVariantService_.retrieve(
- productMedia.variant_id,
- {
- relations: ["product"],
+ export default ProductMediaService
+ ```
+
+ This service implements the necessary methods to perform the basic CRUD operations. You can add any other method if necessary.
+
+ You can now create the API Routes. Create the file `src/api/admin/product-media/route.ts` with the following content:
+
+ ```ts title=src/api/admin/product-media/route.ts
+ import type {
+ MedusaRequest,
+ MedusaResponse,
+ } from "@medusajs/medusa"
+ import ProductMediaService
+ from "../../../services/product-media"
+ import { MediaType } from "../../../models/product-media"
+
+ export const GET = async (
+ req: MedusaRequest,
+ res: MedusaResponse
+ ) => {
+ const productMediaService = req.scope.resolve<
+ ProductMediaService
+ >("productMediaService")
+ // omitting pagination for simplicity
+ const [productMedias, count] = await productMediaService
+ .listAndCount({
+ type: MediaType.MAIN,
+ }, {
+ relations: ["variant"],
}
)
- }
- async create(
- data: Pick<
- ProductMedia,
- "name" | "file_key" | "variant_id" | "type" | "mime_type"
- >
- ): Promise {
- return this.atomicPhase_(async (manager) => {
- const productMediaRepo = manager.getRepository(
- ProductMedia
- )
- const productMedia = productMediaRepo.create(data)
- const result = await productMediaRepo.save(productMedia)
-
- return result
+ res.json({
+ product_medias: productMedias,
+ count,
})
}
- async update(
- id: string,
- data: Omit, "id">
- ): Promise {
- return await this.atomicPhase_(async (manager) => {
- const productMediaRepo = manager.getRepository(
- ProductMedia
- )
- const productMedia = await this.retrieve(id)
+ export const POST = async (
+ req: MedusaRequest,
+ res: MedusaResponse
+ ) => {
+ // validation omitted for simplicity
+ const {
+ variant_id,
+ file_key,
+ type = "main",
+ name,
+ mime_type,
+ } = req.body
- Object.assign(productMedia, data)
+ const productMediaService = req.scope.resolve<
+ ProductMediaService
+ >("productMediaService")
+ const productMedia = await productMediaService.create({
+ variant_id,
+ file_key,
+ type,
+ name,
+ })
- return await productMediaRepo.save(productMedia)
+ res.json({
+ product_media: productMedia,
})
}
+ ```
- async delete(id: string): Promise {
- return await this.atomicPhase_(async (manager) => {
- const productMediaRepo = manager.getRepository(
- ProductMedia
- )
- const productMedia = await this.retrieve(id)
-
- await productMediaRepo.remove([productMedia])
- })
- }
-}
+ This creates two API Routes:
-export default ProductMediaService
-```
+ - a `GET` API Route at `/admin/product-media` that retrieves a list of product media records that have the type `main`. It also retrieves the relations `variant` and `variant.product` to access the product media’s variant and main product.
+ - a `POST` API Route at `/admin/product-media` that accepts the necessary data to create a product media, then returns the created product media.
-This service implements the necessary methods to perform the basic CRUD operations. You can add any other method if necessary.
-
-You can now create the API Routes. Create the file `src/api/admin/product-media/route.ts` with the following content:
-
-```ts title=src/api/admin/product-media/route.ts
-import type {
- MedusaRequest,
- MedusaResponse,
-} from "@medusajs/medusa"
-import ProductMediaService
- from "../../../services/product-media"
-import { MediaType } from "../../../models/product-media"
-
-export const GET = async (
- req: MedusaRequest,
- res: MedusaResponse
-) => {
- const productMediaService = req.scope.resolve<
- ProductMediaService
- >("productMediaService")
- // omitting pagination for simplicity
- const [productMedias, count] = await productMediaService
- .listAndCount({
- type: MediaType.MAIN,
- }, {
- relations: ["variant"],
- }
- )
-
- res.json({
- product_medias: productMedias,
- count,
- })
-}
-
-export const POST = async (
- req: MedusaRequest,
- res: MedusaResponse
-) => {
- // validation omitted for simplicity
- const {
- variant_id,
- file_key,
- type = "main",
- name,
- mime_type,
- } = req.body
-
- const productMediaService = req.scope.resolve<
- ProductMediaService
- >("productMediaService")
- const productMedia = await productMediaService.create({
- variant_id,
- file_key,
- type,
- name,
- })
-
- res.json({
- product_media: productMedia,
- })
-}
-```
-
-This creates two API Routes:
-
-- a `GET` API Route at `/admin/product-media` that retrieves a list of product media records that have the type `main`. It also retrieves the relations `variant` and `variant.product` to access the product media’s variant and main product.
-- a `POST` API Route at `/admin/product-media` that accepts the necessary data to create a product media, then returns the created product media.
-
-
+
---
@@ -564,362 +560,360 @@ To add an interface that allows the admin user to upload digital products, you c
},
]} />
-
-
-Example: Digital Products Page in Admin
-
+
+ Example: Digital Products Page in Admin
-In this example, you’ll add a single page that lists the digital products and allows you to create a new one. The implementation will be minimal for the purpose of simplicity, so you can elaborate on it based on your use case.
-
-Before starting off, make sure to install the necessary dependencies in your Medusa backend project:
+ In this example, you’ll add a single page that lists the digital products and allows you to create a new one. The implementation will be minimal for the purpose of simplicity, so you can elaborate on it based on your use case.
+
+ Before starting off, make sure to install the necessary dependencies in your Medusa backend project:
-```bash npm2yarn
-npm install medusa-react @tanstack/react-query @medusajs/ui
-```
+ ```bash npm2yarn
+ npm install medusa-react @tanstack/react-query @medusajs/ui
+ ```
-This installs the necessary packages to use the Medusa React client and the [Medusa UI package](https://docs.medusajs.com/ui).
+ This installs the necessary packages to use the Medusa React client and the [Medusa UI package](https://docs.medusajs.com/ui).
-You also need to create types for the expected requests and responses of the API Routes you created. This is helpful when using Medusa React’s custom hooks. To do that, create the file `src/types/product-media.ts` with the following content:
+ You also need to create types for the expected requests and responses of the API Routes you created. This is helpful when using Medusa React’s custom hooks. To do that, create the file `src/types/product-media.ts` with the following content:
-```ts title=src/types/product-media.ts
-import {
- MediaType,
- ProductMedia,
-} from "../models/product-media"
+ ```ts title=src/types/product-media.ts
+ import {
+ MediaType,
+ ProductMedia,
+ } from "../models/product-media"
-export type ListProductMediasRequest = {
- // no expected parameters
-};
+ export type ListProductMediasRequest = {
+ // no expected parameters
+ };
-export type ListProductMediasResponse = {
- product_medias: ProductMedia[]
- count: number
-};
+ export type ListProductMediasResponse = {
+ product_medias: ProductMedia[]
+ count: number
+ };
-export type CreateProductMediaRequest = {
- variant_id: string
- name: string
- file_key: string
- type?: MediaType
- mime_type: string
-};
+ export type CreateProductMediaRequest = {
+ variant_id: string
+ name: string
+ file_key: string
+ type?: MediaType
+ mime_type: string
+ };
-export type CreateProductMediaResponse = {
- product_media: ProductMedia
-};
-```
+ export type CreateProductMediaResponse = {
+ product_media: ProductMedia
+ };
+ ```
-You can now create your admin UI route. To do that, create the file `src/admin/routes/product-media/page.tsx` with the following content:
+ You can now create your admin UI route. To do that, create the file `src/admin/routes/product-media/page.tsx` with the following content:
-```tsx title=src/admin/routes/product-media/page.tsx
-import { RouteConfig } from "@medusajs/admin"
-import { DocumentText } from "@medusajs/icons"
-import { useAdminCustomQuery } from "medusa-react"
-import {
- ListProductMediasRequest,
- ListProductMediasResponse,
-} from "../../../types/product-media"
-import {
- Button,
- Container,
- Drawer,
- Heading,
- Table,
-} from "@medusajs/ui"
-import { Link } from "react-router-dom"
-import { RouteProps } from "@medusajs/admin-ui"
-import ProductMediaCreateForm
- from "../../components/product-media/CreateForm"
-
-const ProductMediaListPage = (props: RouteProps) => {
- const { data, isLoading } = useAdminCustomQuery<
+ ```tsx title=src/admin/routes/product-media/page.tsx
+ import { RouteConfig } from "@medusajs/admin"
+ import { DocumentText } from "@medusajs/icons"
+ import { useAdminCustomQuery } from "medusa-react"
+ import {
ListProductMediasRequest,
- ListProductMediasResponse
- >(
- "/product-media",
- ["product-media"]
- )
+ ListProductMediasResponse,
+ } from "../../../types/product-media"
+ import {
+ Button,
+ Container,
+ Drawer,
+ Heading,
+ Table,
+ } from "@medusajs/ui"
+ import { Link } from "react-router-dom"
+ import { RouteProps } from "@medusajs/admin-ui"
+ import ProductMediaCreateForm
+ from "../../components/product-media/CreateForm"
- return (
-
-
- )}
-
- )
-}
-
-export const config: RouteConfig = {
- link: {
- label: "Digital Products",
- icon: DocumentText,
- },
-}
-
-export default ProductMediaListPage
-```
-
-This UI route will show under the sidebar with the label “Digital Products”. In the page, you use the `useAdminCustomQuery` hook imported from `medusa-react` to send a request to your custom “list digital products” API Route.
-
-In the page, you’ll show the list of digital products in a table, if there are any. You’ll also show a button that opens a drawer to the side of the page.
-
-In the drawer, you show the Create Digital Product form. To create this form, create the file `src/admin/components/product-media/CreateForm/index.tsx` with the following content:
-
-```tsx title=src/admin/components/product-media/CreateForm/index.tsx
-import { useState } from "react"
-import { MediaType } from "../../../../models/product-media"
-import {
- useAdminCreateProduct,
- useAdminCustomPost,
- useAdminUploadProtectedFile,
-} from "medusa-react"
-import {
- CreateProductMediaRequest,
- CreateProductMediaResponse,
-} from "../../../../types/product-media"
-import {
- Button,
- Container,
- Input,
- Label,
- Select,
-} from "@medusajs/ui"
-import { RouteProps } from "@medusajs/admin-ui"
-import { useNavigate } from "react-router-dom"
-
-const ProductMediaCreateForm = ({
- notify,
-}: RouteProps) => {
- const [productName, setProductName] = useState("")
- const [
- productVariantName,
- setProductVariantName,
- ] = useState("")
- const [name, setName] = useState("")
- const [type, setType] = useState("main")
- const [file, setFile] = useState()
-
- const createProduct = useAdminCreateProduct()
- const uploadFile = useAdminUploadProtectedFile()
- const {
- mutate: createDigitalProduct,
- isLoading,
- } = useAdminCustomPost<
- CreateProductMediaRequest,
- CreateProductMediaResponse
- >(
- "/product-media",
- ["product-media"]
- )
-
- const navigate = useNavigate()
-
- const handleSubmit = (
- e: React.FormEvent
- ) => {
- e.preventDefault()
-
- createProduct.mutate({
- title: productName,
- is_giftcard: false,
- discountable: false,
- options: [
- {
- title: "Digital Product",
- },
- ],
- variants: [
- {
- title: productVariantName,
- options: [
- {
- value: name, // can also be the file name
- },
- ],
- // for simplicity, prices are omitted from form.
- // Those can be edited from the product's page.
- prices: [],
- },
- ],
- }, {
- onSuccess: ({ product }) => {
- // upload file
- uploadFile.mutate(file, {
- onSuccess: ({ uploads }) => {
- if (!("key" in uploads[0])) {
- return
- }
- // create the digital product
- createDigitalProduct({
- variant_id: product.variants[0].id,
- name,
- file_key: uploads[0].key as string,
- type: type as MediaType,
- mime_type: file.type,
- }, {
- onSuccess: () => {
- notify.success(
- "Success",
- "Digital Product Created Successfully"
- )
- navigate("/a/product-media")
- },
- })
- },
- })
- },
- })
+
+
+ {data.product_medias.map((product_media) => (
+
+
+ {product_media.variant.product.title}
+
+
+ {product_media.variant.title}
+
+
+ {product_media.file_key}
+
+
+
+ View Product
+
+
+
+ ))}
+
+
+ )}
+
+ )
}
- return (
-
-
-
- )
-}
+ export const config: RouteConfig = {
+ link: {
+ label: "Digital Products",
+ icon: DocumentText,
+ },
+ }
-export default ProductMediaCreateForm
-```
+ export default ProductMediaListPage
+ ```
-In this component, you create a form that accepts basic information needed to create the digital product. This form only accepts one file for one variant for simplicity purposes. You can expand on this based on your use case.
+ This UI route will show under the sidebar with the label “Digital Products”. In the page, you use the `useAdminCustomQuery` hook imported from `medusa-react` to send a request to your custom “list digital products” API Route.
-Notice that an alternative approach would be to inject a widget to the Product Details page and allow users to upload the files from there. It depends on whether you’re only supporting Digital Products or you want the distinction between them, as done here.
+ In the page, you’ll show the list of digital products in a table, if there are any. You’ll also show a button that opens a drawer to the side of the page.
-When the user submits the form, you first create a product with a variant. Then, you upload the file using the [Upload Protected File API Route](https://docs.medusajs.com/api/admin#uploads_postuploadsprotected). Finally, you create the digital product using the custom API Route you created.
+ In the drawer, you show the Create Digital Product form. To create this form, create the file `src/admin/components/product-media/CreateForm/index.tsx` with the following content:
-The product’s details can still be edited from the same Products interface, similar to regular products. You can edit its price, add more variants, and more.
+ ```tsx title=src/admin/components/product-media/CreateForm/index.tsx
+ import { useState } from "react"
+ import { MediaType } from "../../../../models/product-media"
+ import {
+ useAdminCreateProduct,
+ useAdminCustomPost,
+ useAdminUploadProtectedFile,
+ } from "medusa-react"
+ import {
+ CreateProductMediaRequest,
+ CreateProductMediaResponse,
+ } from "../../../../types/product-media"
+ import {
+ Button,
+ Container,
+ Input,
+ Label,
+ Select,
+ } from "@medusajs/ui"
+ import { RouteProps } from "@medusajs/admin-ui"
+ import { useNavigate } from "react-router-dom"
-To test it out, build changes and run the `develop` command:
+ const ProductMediaCreateForm = ({
+ notify,
+ }: RouteProps) => {
+ const [productName, setProductName] = useState("")
+ const [
+ productVariantName,
+ setProductVariantName,
+ ] = useState("")
+ const [name, setName] = useState("")
+ const [type, setType] = useState("main")
+ const [file, setFile] = useState()
-```bash npm2yarn
-npm run build
-npx medusa develop
-```
+ const createProduct = useAdminCreateProduct()
+ const uploadFile = useAdminUploadProtectedFile()
+ const {
+ mutate: createDigitalProduct,
+ isLoading,
+ } = useAdminCustomPost<
+ CreateProductMediaRequest,
+ CreateProductMediaResponse
+ >(
+ "/product-media",
+ ["product-media"]
+ )
-If you open the admin now, you’ll find a new Digital Products item in the sidebar. You can try adding Digital Products and viewing them.
+ const navigate = useNavigate()
-
+ const handleSubmit = (
+ e: React.FormEvent
+ ) => {
+ e.preventDefault()
+
+ createProduct.mutate({
+ title: productName,
+ is_giftcard: false,
+ discountable: false,
+ options: [
+ {
+ title: "Digital Product",
+ },
+ ],
+ variants: [
+ {
+ title: productVariantName,
+ options: [
+ {
+ value: name, // can also be the file name
+ },
+ ],
+ // for simplicity, prices are omitted from form.
+ // Those can be edited from the product's page.
+ prices: [],
+ },
+ ],
+ }, {
+ onSuccess: ({ product }) => {
+ // upload file
+ uploadFile.mutate(file, {
+ onSuccess: ({ uploads }) => {
+ if (!("key" in uploads[0])) {
+ return
+ }
+ // create the digital product
+ createDigitalProduct({
+ variant_id: product.variants[0].id,
+ name,
+ file_key: uploads[0].key as string,
+ type: type as MediaType,
+ mime_type: file.type,
+ }, {
+ onSuccess: () => {
+ notify.success(
+ "Success",
+ "Digital Product Created Successfully"
+ )
+ navigate("/a/product-media")
+ },
+ })
+ },
+ })
+ },
+ })
+ }
+
+ return (
+
+
+
+ )
+ }
+
+ export default ProductMediaCreateForm
+ ```
+
+ In this component, you create a form that accepts basic information needed to create the digital product. This form only accepts one file for one variant for simplicity purposes. You can expand on this based on your use case.
+
+ Notice that an alternative approach would be to inject a widget to the Product Details page and allow users to upload the files from there. It depends on whether you’re only supporting Digital Products or you want the distinction between them, as done here.
+
+ When the user submits the form, you first create a product with a variant. Then, you upload the file using the [Upload Protected File API Route](https://docs.medusajs.com/api/admin#uploads_postuploadsprotected). Finally, you create the digital product using the custom API Route you created.
+
+ The product’s details can still be edited from the same Products interface, similar to regular products. You can edit its price, add more variants, and more.
+
+ To test it out, build changes and run the `develop` command:
+
+ ```bash npm2yarn
+ npm run build
+ npx medusa develop
+ ```
+
+ If you open the admin now, you’ll find a new Digital Products item in the sidebar. You can try adding Digital Products and viewing them.
+
+
---
@@ -947,110 +941,108 @@ Finally, you can send a notification, such as an email, to the customer using th
}
}} />
-
-
-Example: Using SendGrid
-
+
+ Example: Using SendGrid
-:::note
+ :::note
-An alternative solution is to create a store download API Route that allows authenticated customers to download products they've purchased, then add the link to the API Route or a storefront page that calls the API Route in the email. Learn how to implement the download API Route [here](#download-product-after-purchase).
+ An alternative solution is to create a store download API Route that allows authenticated customers to download products they've purchased, then add the link to the API Route or a storefront page that calls the API Route in the email. Learn how to implement the download API Route [here](#download-product-after-purchase).
-:::
+ :::
-Here’s an example of a subscriber that retrieves the download links and sends them to the customer using the SendGrid plugin:
-
-```ts title=src/subscribers/handle-order.ts
-import {
- AbstractFileService,
- EventBusService,
- OrderService,
-} from "@medusajs/medusa"
+ Here’s an example of a subscriber that retrieves the download links and sends them to the customer using the SendGrid plugin:
+
+ ```ts title=src/subscribers/handle-order.ts
+ import {
+ AbstractFileService,
+ EventBusService,
+ OrderService,
+ } from "@medusajs/medusa"
-type InjectedDependencies = {
- eventBusService: EventBusService
- orderService: OrderService
- sendgridService: any
- fileService: AbstractFileService
-}
-
-class HandleOrderSubscribers {
- protected readonly orderService_: OrderService
- protected readonly sendgridService_: any
- protected readonly fileService_: AbstractFileService
-
- constructor({
- eventBusService,
- orderService,
- sendgridService,
- fileService,
- }: InjectedDependencies) {
- this.orderService_ = orderService
- this.sendgridService_ = sendgridService
- this.fileService_ = fileService
- eventBusService.subscribe(
- "order.placed",
- this.handleOrderPlaced
- )
+ type InjectedDependencies = {
+ eventBusService: EventBusService
+ orderService: OrderService
+ sendgridService: any
+ fileService: AbstractFileService
}
- handleOrderPlaced = async (
- data: Record
- ) => {
- const order = await this.orderService_.retrieve(data.id, {
- relations: [
- "items",
- "items.variant",
- "items.variant.product_medias",
- ],
- })
+ class HandleOrderSubscribers {
+ protected readonly orderService_: OrderService
+ protected readonly sendgridService_: any
+ protected readonly fileService_: AbstractFileService
- // find product medias in the order
- const urls = []
- for (const item of order.items) {
- if (!item.variant.product_medias.length) {
+ constructor({
+ eventBusService,
+ orderService,
+ sendgridService,
+ fileService,
+ }: InjectedDependencies) {
+ this.orderService_ = orderService
+ this.sendgridService_ = sendgridService
+ this.fileService_ = fileService
+ eventBusService.subscribe(
+ "order.placed",
+ this.handleOrderPlaced
+ )
+ }
+
+ handleOrderPlaced = async (
+ data: Record
+ ) => {
+ const order = await this.orderService_.retrieve(data.id, {
+ relations: [
+ "items",
+ "items.variant",
+ "items.variant.product_medias",
+ ],
+ })
+
+ // find product medias in the order
+ const urls = []
+ for (const item of order.items) {
+ if (!item.variant.product_medias.length) {
+ return
+ }
+
+ await Promise.all([
+ item.variant.product_medias.forEach(
+ async (productMedia) => {
+ // get the download URL from the file service
+ const downloadUrl = await
+ this.fileService_.getPresignedDownloadUrl({
+ fileKey: productMedia.file_key,
+ isPrivate: true,
+ })
+
+ urls.push(downloadUrl)
+ }),
+ ])
+ }
+
+ if (!urls.length) {
return
}
- await Promise.all([
- item.variant.product_medias.forEach(
- async (productMedia) => {
- // get the download URL from the file service
- const downloadUrl = await
- this.fileService_.getPresignedDownloadUrl({
- fileKey: productMedia.file_key,
- isPrivate: true,
- })
-
- urls.push(downloadUrl)
- }),
- ])
+ this.sendgridService_.sendEmail({
+ templateId: "digital-download",
+ from: "hello@medusajs.com",
+ to: order.email,
+ dynamic_template_data: {
+ // any data necessary for your template...
+ digital_download_urls: urls,
+ },
+ })
}
-
- if (!urls.length) {
- return
- }
-
- this.sendgridService_.sendEmail({
- templateId: "digital-download",
- from: "hello@medusajs.com",
- to: order.email,
- dynamic_template_data: {
- // any data necessary for your template...
- digital_download_urls: urls,
- },
- })
}
-}
-export default HandleOrderSubscribers
-```
+ export default HandleOrderSubscribers
+ ```
-Notice that regardless of what file service you have installed, you can access it using dependency injection under the name `fileService`.
+ Notice that regardless of what file service you have installed, you can access it using dependency injection under the name `fileService`.
-The `handleOrderPlaced` method retrieves the order, loops over its items to find digital products and retrieve their download links, then uses SendGrid to send the email, passing it the urls as a data payload. You can customize the sent data based on your SendGrid template and your use case.
+ The `handleOrderPlaced` method retrieves the order, loops over its items to find digital products and retrieve their download links, then uses SendGrid to send the email, passing it the urls as a data payload. You can customize the sent data based on your SendGrid template and your use case.
-
+
---
@@ -1070,251 +1062,247 @@ In the product detail's page, you can add a button that allows customers to down
To implement this, create a storefront API Route that allows you to fetch the digital product, then customize the Next.js storefront to show the preview button if a product is digital.
-
-
-Example
-
+
+ Example
-Before you customize the Next.js storefront, you need to add a store API Route in your backend.
+ Before you customize the Next.js storefront, you need to add a store API Route in your backend.
-Create the file `src/api/store/product-media/route.ts` with the following content:
+ Create the file `src/api/store/product-media/route.ts` with the following content:
-```ts title=src/api/store/product-media/route.ts
-import type {
- MedusaRequest,
- MedusaResponse,
-} from "@medusajs/medusa"
-import ProductMediaService
- from "../../../services/product-media"
-import { MediaType } from "../../../models/product-media"
+ ```ts title=src/api/store/product-media/route.ts
+ import type {
+ MedusaRequest,
+ MedusaResponse,
+ } from "@medusajs/medusa"
+ import ProductMediaService
+ from "../../../services/product-media"
+ import { MediaType } from "../../../models/product-media"
-export const GET = async (
- req: MedusaRequest,
- res: MedusaResponse
-) => {
- const productMediaService = req.scope.resolve<
- ProductMediaService
- >("productMediaService")
- // omitting pagination for simplicity
- const [
- productMedias,
- count,
- ] = await productMediaService.listAndCount({
- type: MediaType.PREVIEW,
- ...(req.query),
- }, {
- relations: ["variant"],
- })
+ export const GET = async (
+ req: MedusaRequest,
+ res: MedusaResponse
+ ) => {
+ const productMediaService = req.scope.resolve<
+ ProductMediaService
+ >("productMediaService")
+ // omitting pagination for simplicity
+ const [
+ productMedias,
+ count,
+ ] = await productMediaService.listAndCount({
+ type: MediaType.PREVIEW,
+ ...(req.query),
+ }, {
+ relations: ["variant"],
+ })
- res.json({
- product_medias: productMedias,
- count,
- })
-}
-```
+ res.json({
+ product_medias: productMedias,
+ count,
+ })
+ }
+ ```
-This adds a store API Route that returns a list of product medias of type `preview`. It also allows you to pass query parameters to filter the returned products medias.
+ This adds a store API Route that returns a list of product medias of type `preview`. It also allows you to pass query parameters to filter the returned products medias.
-Now, you can customize the Next.js storefront to show the preview button.
+ Now, you can customize the Next.js storefront to show the preview button.
-First, if you're using TypeScript for your development, create the file `src/types/product-media.ts` with the following content:
+ First, if you're using TypeScript for your development, create the file `src/types/product-media.ts` with the following content:
-```ts title=src/types/product-media.ts
+ ```ts title=src/types/product-media.ts
-import { Product } from "@medusajs/medusa"
-import { ProductVariant } from "@medusajs/product"
+ import { Product } from "@medusajs/medusa"
+ import { ProductVariant } from "@medusajs/product"
-export enum ProductMediaVariantType {
- PREVIEW = "preview",
- MAIN = "main",
-}
+ export enum ProductMediaVariantType {
+ PREVIEW = "preview",
+ MAIN = "main",
+ }
-export type ProductMedia = {
- id: string
- variant_id: string
- name?: string
- file_key?: string
- mime_type?: string
- created_at?: Date
- updated_at?: Date
- type?: ProductMediaVariantType
- variant_id?: string
- variants?: ProductVariant[]
- created_at: Date
- updated_at: Date
-}
+ export type ProductMedia = {
+ id: string
+ variant_id: string
+ name?: string
+ file_key?: string
+ mime_type?: string
+ created_at?: Date
+ updated_at?: Date
+ type?: ProductMediaVariantType
+ variant_id?: string
+ variants?: ProductVariant[]
+ created_at: Date
+ updated_at: Date
+ }
-export type DigitalProduct = Omit & {
- product_medias?: ProductMedia[]
- variants?: DigitalProductVariant[]
-}
+ export type DigitalProduct = Omit & {
+ product_medias?: ProductMedia[]
+ variants?: DigitalProductVariant[]
+ }
-export type DigitalProductVariant = ProductVariant & {
- product_medias?: ProductMedia
-}
-```
+ export type DigitalProductVariant = ProductVariant & {
+ product_medias?: ProductMedia
+ }
+ ```
-Then, add in `src/lib/data/index.ts` a new function that retrieves the product media of the product variant being viewed:
+ Then, add in `src/lib/data/index.ts` a new function that retrieves the product media of the product variant being viewed:
-```ts title=src/lib/data/index.ts
-import {
- DigitalProduct,
- ProductMedia,
-} from "types/product-media"
+ ```ts title=src/lib/data/index.ts
+ import {
+ DigitalProduct,
+ ProductMedia,
+ } from "types/product-media"
-// ... rest of the functions
+ // ... rest of the functions
-export async function getProductMediaPreviewByVariant(
- variant: Variant
-): Promise {
- const {
- product_medias,
- } = await medusaRequest(
- "GET",
- `/product-media`,
- {
- query: {
- variant_ids: variant.id,
- },
+ export async function getProductMediaPreviewByVariant(
+ variant: Variant
+ ): Promise {
+ const {
+ product_medias,
+ } = await medusaRequest(
+ "GET",
+ `/product-media`,
+ {
+ query: {
+ variant_ids: variant.id,
+ },
+ }
+ )
+ .then((res) => res.body)
+ .catch((err) => {
+ throw err
+ })
+
+ return product_medias[0]
+ }
+ ```
+
+ To allow customers to download the file preview without exposing its URL, create a Next.js API route in the file `src/app/api/download/preview/route.ts` with the following content:
+
+ ```ts title=src/app/api/download/preview/route.ts
+ import { NextRequest, NextResponse } from "next/server"
+
+ export async function GET(req: NextRequest) {
+ // Get the file info from the URL
+ const {
+ file_path,
+ file_name,
+ mime_type,
+ } = Object.fromEntries(req.nextUrl.searchParams)
+
+ // Fetch the file
+ const response = await fetch(file_path)
+
+ // Handle the case where the file could not be fetched
+ if (!response.ok) {
+ return new NextResponse("File not found", { status: 404 })
}
- )
- .then((res) => res.body)
- .catch((err) => {
- throw err
- })
- return product_medias[0]
-}
-```
+ // Get the file content as a buffer
+ const fileBuffer = await response.arrayBuffer()
-To allow customers to download the file preview without exposing its URL, create a Next.js API route in the file `src/app/api/download/preview/route.ts` with the following content:
-
-```ts title=src/app/api/download/preview/route.ts
-import { NextRequest, NextResponse } from "next/server"
-
-export async function GET(req: NextRequest) {
- // Get the file info from the URL
- const {
- file_path,
- file_name,
- mime_type,
- } = Object.fromEntries(req.nextUrl.searchParams)
-
- // Fetch the file
- const response = await fetch(file_path)
-
- // Handle the case where the file could not be fetched
- if (!response.ok) {
- return new NextResponse("File not found", { status: 404 })
- }
-
- // Get the file content as a buffer
- const fileBuffer = await response.arrayBuffer()
-
- // Define response headers
- const headers = {
- "Content-Type": mime_type,
- // This sets the file name for the download
- "Content-Disposition": `attachment; filename="${
- file_name
- }"`,
- }
-
- // Create a NextResponse with the file content and headers
- const response = new NextResponse(fileBuffer, {
- status: 200,
- headers,
- })
-
- return response
-}
-```
-
-Next, create the preview button in the file `src/modules/products/components/product-media-preview/index.tsx`:
-
-```tsx title=src/modules/products/components/product-media-preview/index.tsx
-import Button from "@modules/common/components/button"
-import { ProductMedia } from "types/product-media"
-
-type Props = {
- media: ProductMedia
-}
-
-const ProductMediaPreview: React.FC = ({ media }) => {
- const downloadPreview = () => {
- window.location.href = `${
- process.env.NEXT_PUBLIC_BASE_URL
- }/api/download/preview?file_path=${
- media.file_key
- }&file_name=${
- media.name
- }&mime_type=${
- media.mime_type
- }`
- }
-
- return (
-
-
-
- )
-}
-
-export default ProductMediaPreview
-```
-
-Finally, add the button as one of the product actions defined in `src/modules/products/components/product-actions/index.tsx`. These are the actions shown to the customer in the product details page:
-
-```tsx title=src/modules/products/components/product-actions/index.tsx
-// other imports...
-import ProductMediaPreview from "../product-media-preview"
-import { getProductMediaPreviewByVariant } from "@lib/data"
-import { ProductMedia } from "types/product-media"
-
-
-const ProductActions: React.FC = ({
- product,
-}) => {
- // other code...
-
- const [productMedia, setProductMedia] = useState<
- ProductMedia
- >({})
-
- useEffect(() => {
- const getProductMedia = async () => {
- if (!variant) {return}
- await getProductMediaPreviewByVariant(variant)
- .then((res) => {
- setProductMedia(res)
- })
+ // Define response headers
+ const headers = {
+ "Content-Type": mime_type,
+ // This sets the file name for the download
+ "Content-Disposition": `attachment; filename="${
+ file_name
+ }"`,
}
- getProductMedia()
- }, [variant])
- return (
-
- {/* other code... */}
+ // Create a NextResponse with the file content and headers
+ const response = new NextResponse(fileBuffer, {
+ status: 200,
+ headers,
+ })
- {productMedia && (
-
- )}
+ return response
+ }
+ ```
-
-
+ )
+ }
+
+ export default ProductActions
+ ```
+
+
### Update Product Tabs
@@ -1322,960 +1310,954 @@ In the product details page, additional information related to the product and i
You can change this section to show information relevant to the product. For example, how many pages are in an e-book, or how the e-book will be delivered to the customer.
-
-
-Example
-
+
+ Example
-In this example, you'll change the content of the Product Information and Shipping & Returns tabs to show information relevant to the digital product. The Product Information tab will include custom information relevant to digital products, and the Shipping & Returns tab will be changed to "E-book delivery" and will hold details about how the e-book will be delivered to the customer.
+ In this example, you'll change the content of the Product Information and Shipping & Returns tabs to show information relevant to the digital product. The Product Information tab will include custom information relevant to digital products, and the Shipping & Returns tab will be changed to "E-book delivery" and will hold details about how the e-book will be delivered to the customer.
-One way to store custom information relevant to the digital product is using the `metadata` field. For example, to store the number of pages of an e-book, set the `metadata` field to the following:
+ One way to store custom information relevant to the digital product is using the `metadata` field. For example, to store the number of pages of an e-book, set the `metadata` field to the following:
-```json
-{
- "metadata": {
- "Pages": "420"
+ ```json
+ {
+ "metadata": {
+ "Pages": "420"
+ }
}
-}
-```
+ ```
-Then, you can customize the product additional details section to loop through the `metadata` field's properties and show their information.
+ Then, you can customize the product additional details section to loop through the `metadata` field's properties and show their information.
-Next, change the `ProductTabs`, `ProductInfoTab`, and `ShippingInfoTab` components defined in `src/modules/products/components/product-tabs/index.tsx` to the following:
+ Next, change the `ProductTabs`, `ProductInfoTab`, and `ShippingInfoTab` components defined in `src/modules/products/components/product-tabs/index.tsx` to the following:
-```tsx title=src/modules/products/components/product-tabs/index.tsx
-const ProductTabs = ({ product }: ProductTabsProps) => {
- const tabs = useMemo(() => {
- return [
- {
- label: "Product Information",
- component: ,
- },
- {
- label: "E-book delivery",
- component: ,
- },
- ]
- }, [product])
- // ... rest of code
-}
+ ```tsx title=src/modules/products/components/product-tabs/index.tsx
+ const ProductTabs = ({ product }: ProductTabsProps) => {
+ const tabs = useMemo(() => {
+ return [
+ {
+ label: "Product Information",
+ component: ,
+ },
+ {
+ label: "E-book delivery",
+ component: ,
+ },
+ ]
+ }, [product])
+ // ... rest of code
+ }
-const ProductInfoTab = ({ product }: ProductTabsProps) => {
- // map the metadata object to an array
- const metadata = useMemo(() => {
- if (!product.metadata) {return []}
- return Object.keys(product.metadata).map((key) => {
- return [key, product.metadata?.[key]]
- })
- }, [product])
+ const ProductInfoTab = ({ product }: ProductTabsProps) => {
+ // map the metadata object to an array
+ const metadata = useMemo(() => {
+ if (!product.metadata) {return []}
+ return Object.keys(product.metadata).map((key) => {
+ return [key, product.metadata?.[key]]
+ })
+ }, [product])
- return (
-
-
-
- {/* Map the metadata as product information */}
- {metadata &&
- metadata.slice(0, 2).map(([key, value], i) => (
-
- )
-}
+ )
+ }
-export default ShippingDetails
-```
+ export default ShippingDetails
+ ```
-
+
### Download Product After Purchase
After the customer purchases the digital product you can show a download button to allow them to immediately download the product.
-
-
-Example
-
+
+ Example
-Before you implement the storefront changes, you need to create a new API Route in the backend that ensures that the currently logged-in customer has purchased the digital product and, if so, returns a presigned URL to download it.
+ Before you implement the storefront changes, you need to create a new API Route in the backend that ensures that the currently logged-in customer has purchased the digital product and, if so, returns a presigned URL to download it.
-Create the file `src/api/store/product-media/download/[variant_id]/route.ts` with the following content:
+ Create the file `src/api/store/product-media/download/[variant_id]/route.ts` with the following content:
-```ts title=src/api/store/product-media/download/route.ts
-import type {
- AbstractFileService,
- MedusaRequest,
- MedusaResponse,
- OrderService,
- ProductVariant,
-} from "@medusajs/medusa"
-import ProductMediaService
- from "../../../../services/product-media"
-import { MediaType } from "../../../../models/product-media"
+ ```ts title=src/api/store/product-media/download/route.ts
+ import type {
+ AbstractFileService,
+ MedusaRequest,
+ MedusaResponse,
+ OrderService,
+ ProductVariant,
+ } from "@medusajs/medusa"
+ import ProductMediaService
+ from "../../../../services/product-media"
+ import { MediaType } from "../../../../models/product-media"
-export const GET = async (
- req: MedusaRequest,
- res: MedusaResponse
-) => {
- const variantId = req.params.variant_id
- if (!variantId) {
- throw new Error("Variant ID is required")
- }
- const ordersService = req.scope.resolve<
- OrderService
- >("orderService")
- const orders = await ordersService.list({
- customer_id: req.user.customer_id,
- }, {
- relations: ["items", "items.variant"],
- })
-
- let variant: ProductVariant
- orders.some((order) => (
- order.items.some((item) => {
- if (item.variant_id === variantId) {
- variant = item.variant
- return true
- }
-
- return false
+ export const GET = async (
+ req: MedusaRequest,
+ res: MedusaResponse
+ ) => {
+ const variantId = req.params.variant_id
+ if (!variantId) {
+ throw new Error("Variant ID is required")
+ }
+ const ordersService = req.scope.resolve<
+ OrderService
+ >("orderService")
+ const orders = await ordersService.list({
+ customer_id: req.user.customer_id,
+ }, {
+ relations: ["items", "items.variant"],
})
- ))
+
+ let variant: ProductVariant
+ orders.some((order) => (
+ order.items.some((item) => {
+ if (item.variant_id === variantId) {
+ variant = item.variant
+ return true
+ }
- if (!variant) {
- throw new Error("Customer hasn't purchased this product.")
+ return false
+ })
+ ))
+
+ if (!variant) {
+ throw new Error("Customer hasn't purchased this product.")
+ }
+
+ // get the product media and the presigned URL
+ const productMediaService = req.scope.resolve<
+ ProductMediaService
+ >("productMediaService")
+ const productMedias = await productMediaService.list({
+ type: MediaType.MAIN,
+ variant_id: variant.id,
+ })
+
+ const fileService = req.scope.resolve<
+ AbstractFileService
+ >("fileService")
+
+ res.json({
+ url: await fileService.getPresignedDownloadUrl({
+ fileKey: productMedias[0].file_key,
+ isPrivate: true,
+ }),
+ name: productMedias[0].name,
+ mime_type: productMedias[0].mime_type,
+ })
}
+ ```
- // get the product media and the presigned URL
- const productMediaService = req.scope.resolve<
- ProductMediaService
- >("productMediaService")
- const productMedias = await productMediaService.list({
- type: MediaType.MAIN,
- variant_id: variant.id,
- })
+ Then, add the `requireCustomerAuthentication` middleware to this API Route in `src/api/middlewares.ts`:
- const fileService = req.scope.resolve<
- AbstractFileService
- >("fileService")
+ ```ts title=src/api/middlewares.ts
+ import {
+ requireCustomerAuthentication,
+ type MiddlewaresConfig,
+ } from "@medusajs/medusa"
- res.json({
- url: await fileService.getPresignedDownloadUrl({
- fileKey: productMedias[0].file_key,
- isPrivate: true,
- }),
- name: productMedias[0].name,
- mime_type: productMedias[0].mime_type,
- })
-}
-```
-
-Then, add the `requireCustomerAuthentication` middleware to this API Route in `src/api/middlewares.ts`:
-
-```ts title=src/api/middlewares.ts
-import {
- requireCustomerAuthentication,
- type MiddlewaresConfig,
-} from "@medusajs/medusa"
-
-export const config: MiddlewaresConfig = {
- routes: [
- {
- matcher: "/store/product-media/download/*",
- middlewares: [requireCustomerAuthentication()],
- },
- ],
-}
-```
-
-This ensures that only logged-in customers can access this API Route.
-
-You can use this API Route in your storefront to add a button that allows downloading the purchased digital product.
-
-To mask the presigned URL, create a Next.js API route at `src/app/api/download/main/[variant_id]/route.ts` with the following content:
-
-```ts title=src/app/api/download/main/[variant_id]/route.ts
-import { NextRequest, NextResponse } from "next/server"
-
-export async function GET(
- req: NextRequest,
- { params }: { params: Record }
-) {
- // Get the variant ID from the URL
- const { variant_id } = params
-
- // Define the API URL
- const apiUrl = `${
- process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL
- }/store/product-media/download/${variant_id}`
-
- // Fetch the file data
- const {
- url,
- name,
- mime_type,
- } = await fetch(apiUrl)
- .then((res) => res.json())
-
- // Handle the case where the file doesn't exist
- // or the customer didn't purchase the product
- if (!url) {
- return new NextResponse(
- "File doesn't exist",
- { status: 401 }
- )
+ export const config: MiddlewaresConfig = {
+ routes: [
+ {
+ matcher: "/store/product-media/download/*",
+ middlewares: [requireCustomerAuthentication()],
+ },
+ ],
}
+ ```
- // Fetch the file
- const response = await fetch(url)
+ This ensures that only logged-in customers can access this API Route.
- // Handle the case where the file could not be fetched
- if (!response.ok) {
- return new NextResponse(
- "File not found",
- { status: 404 }
- )
+ You can use this API Route in your storefront to add a button that allows downloading the purchased digital product.
+
+ To mask the presigned URL, create a Next.js API route at `src/app/api/download/main/[variant_id]/route.ts` with the following content:
+
+ ```ts title=src/app/api/download/main/[variant_id]/route.ts
+ import { NextRequest, NextResponse } from "next/server"
+
+ export async function GET(
+ req: NextRequest,
+ { params }: { params: Record }
+ ) {
+ // Get the variant ID from the URL
+ const { variant_id } = params
+
+ // Define the API URL
+ const apiUrl = `${
+ process.env.NEXT_PUBLIC_MEDUSA_BACKEND_URL
+ }/store/product-media/download/${variant_id}`
+
+ // Fetch the file data
+ const {
+ url,
+ name,
+ mime_type,
+ } = await fetch(apiUrl)
+ .then((res) => res.json())
+
+ // Handle the case where the file doesn't exist
+ // or the customer didn't purchase the product
+ if (!url) {
+ return new NextResponse(
+ "File doesn't exist",
+ { status: 401 }
+ )
+ }
+
+ // Fetch the file
+ const response = await fetch(url)
+
+ // Handle the case where the file could not be fetched
+ if (!response.ok) {
+ return new NextResponse(
+ "File not found",
+ { status: 404 }
+ )
+ }
+
+ // Get the file content as a buffer
+ const fileBuffer = await response.arrayBuffer()
+
+ // Define response headers
+ const headers = {
+ "Content-Type": mime_type,
+ // This sets the file name for the download
+ "Content-Disposition": `attachment; filename="${name}"`,
+ }
+
+ // Create a NextResponse with the PDF content and headers
+ const response = new NextResponse(fileBuffer, {
+ status: 200,
+ headers,
+ })
+
+ return response
}
+ ```
- // Get the file content as a buffer
- const fileBuffer = await response.arrayBuffer()
+ Finally, add a button in the storefront that uses this route to allow customers to download the digital product after purchase.
- // Define response headers
- const headers = {
- "Content-Type": mime_type,
- // This sets the file name for the download
- "Content-Disposition": `attachment; filename="${name}"`,
- }
-
- // Create a NextResponse with the PDF content and headers
- const response = new NextResponse(fileBuffer, {
- status: 200,
- headers,
- })
-
- return response
-}
-```
-
-Finally, add a button in the storefront that uses this route to allow customers to download the digital product after purchase.
-
-For example, you can change the `src/modules/order/components/items/index.tsx` file that shows the items to the customer in the order confirmation page to include a new download button:
+ For example, you can change the `src/modules/order/components/items/index.tsx` file that shows the items to the customer in the order confirmation page to include a new download button:
-```tsx title=src/modules/order/components/items/index.tsx
-import useEnrichedLineItems from "@lib/hooks/use-enrich-line-items"
-import { LineItem, Region } from "@medusajs/medusa"
-import LineItemOptions from "@modules/common/components/line-item-options"
-import LineItemPrice from "@modules/common/components/line-item-price"
-import Thumbnail from "@modules/products/components/thumbnail"
-import SkeletonLineItem from "@modules/skeletons/components/skeleton-line-item"
-import Link from "next/link"
-import medusaRequest from "../medusa-fetch"
+ ```tsx title=src/modules/order/components/items/index.tsx
+ import useEnrichedLineItems from "@lib/hooks/use-enrich-line-items"
+ import { LineItem, Region } from "@medusajs/medusa"
+ import LineItemOptions from "@modules/common/components/line-item-options"
+ import LineItemPrice from "@modules/common/components/line-item-price"
+ import Thumbnail from "@modules/products/components/thumbnail"
+ import SkeletonLineItem from "@modules/skeletons/components/skeleton-line-item"
+ import Link from "next/link"
+ import medusaRequest from "../medusa-fetch"
-type ItemsProps = {
- items: LineItem[]
- region: Region
- cartId: string
-}
-
-const Items = ({ items, region, cartId }: ItemsProps) => {
- const enrichedItems = useEnrichedLineItems(items, cartId)
-
- const handleDownload = async (variantId: string) => {
- window.location.href = `${process.env.NEXT_PUBLIC_BASE_URL}/api/download/main/${variant_id}`
+ type ItemsProps = {
+ items: LineItem[]
+ region: Region
+ cartId: string
}
- return (
-
+ )
+ }
-export default Items
-```
+ export default Items
+ ```
-
+
---
diff --git a/www/apps/docs/content/recipes/marketplace.mdx b/www/apps/docs/content/recipes/marketplace.mdx
index cc1080e15e..3bab9d1e5a 100644
--- a/www/apps/docs/content/recipes/marketplace.mdx
+++ b/www/apps/docs/content/recipes/marketplace.mdx
@@ -41,105 +41,105 @@ To associate these entities with the `Store` entity, you need to extend and cust
}
}} />
-
-Example: Associate User with Store
+
+ Example: Associate User with Store
-For example, to associate the `User` entity with the `Store` entity, create the file `src/models/user.ts` with the following content:
+ For example, to associate the `User` entity with the `Store` entity, create the file `src/models/user.ts` with the following content:
-```ts title=src/models/user.ts
-import {
- Column,
- Entity,
- Index,
- JoinColumn,
- ManyToOne,
-} from "typeorm"
-import {
- User as MedusaUser,
-} from "@medusajs/medusa"
-import { Store } from "./store"
+ ```ts title=src/models/user.ts
+ import {
+ Column,
+ Entity,
+ Index,
+ JoinColumn,
+ ManyToOne,
+ } from "typeorm"
+ import {
+ User as MedusaUser,
+ } from "@medusajs/medusa"
+ import { Store } from "./store"
-@Entity()
-export class User extends MedusaUser {
- @Index("UserStoreId")
- @Column({ nullable: true })
- store_id?: string
+ @Entity()
+ export class User extends MedusaUser {
+ @Index("UserStoreId")
+ @Column({ nullable: true })
+ store_id?: string
- @ManyToOne(() => Store, (store) => store.members)
- @JoinColumn({ name: "store_id", referencedColumnName: "id" })
- store?: Store
-}
-```
+ @ManyToOne(() => Store, (store) => store.members)
+ @JoinColumn({ name: "store_id", referencedColumnName: "id" })
+ store?: Store
+ }
+ ```
-Then, you need to extend the `UserRepository` to point to your extended entity. To do that, create the file `src/repositories/user.ts` with the following content:
+ Then, you need to extend the `UserRepository` to point to your extended entity. To do that, create the file `src/repositories/user.ts` with the following content:
-```ts title=src/repositories/user.ts
-import { User } from "../models/user"
-import {
- dataSource,
-} from "@medusajs/medusa/dist/loaders/database"
-import {
- UserRepository as MedusaUserRepository,
-} from "@medusajs/medusa/dist/repositories/user"
+ ```ts title=src/repositories/user.ts
+ import { User } from "../models/user"
+ import {
+ dataSource,
+ } from "@medusajs/medusa/dist/loaders/database"
+ import {
+ UserRepository as MedusaUserRepository,
+ } from "@medusajs/medusa/dist/repositories/user"
-export const UserRepository = dataSource
- .getRepository(User)
- .extend({
- ...Object.assign(
- MedusaUserRepository,
- { target: User }
- ),
- })
+ export const UserRepository = dataSource
+ .getRepository(User)
+ .extend({
+ ...Object.assign(
+ MedusaUserRepository,
+ { target: User }
+ ),
+ })
-export default UserRepository
-```
+ export default UserRepository
+ ```
-Next, you need to create a migration that reflects the changes on the `User` entity in your database. To do that, run the following command to create a migration file:
+ Next, you need to create a migration that reflects the changes on the `User` entity in your database. To do that, run the following command to create a migration file:
-```bash
-npx typeorm migration:create src/migrations/add-user-store-id
-```
+ ```bash
+ npx typeorm migration:create src/migrations/add-user-store-id
+ ```
-This creates a file in the `src/migrations` directory of the format `_add-user-store-id.ts`. Replace the `up` and `down` methods in that file with the methods here:
+ This creates a file in the `src/migrations` directory of the format `_add-user-store-id.ts`. Replace the `up` and `down` methods in that file with the methods here:
-```ts title=src/migrations/_add-user-store-id.ts
-// ...
+ ```ts title=src/migrations/_add-user-store-id.ts
+ // ...
-export class AddUserStoreId1681287255173
- implements MigrationInterface {
- // ...
+ export class AddUserStoreId1681287255173
+ implements MigrationInterface {
+ // ...
- public async up(queryRunner: QueryRunner): Promise {
- await queryRunner.query(
- `ALTER TABLE "user" ADD "store_id" character varying`
- )
- await queryRunner.query(
- `CREATE INDEX "UserStoreId" ON "user" ("store_id")`
- )
- }
+ public async up(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(
+ `ALTER TABLE "user" ADD "store_id" character varying`
+ )
+ await queryRunner.query(
+ `CREATE INDEX "UserStoreId" ON "user" ("store_id")`
+ )
+ }
- public async down(queryRunner: QueryRunner): Promise {
- await queryRunner.query(
- `DROP INDEX "public"."UserStoreId"`
- )
- await queryRunner.query(
- `ALTER TABLE "user" DROP COLUMN "store_id"`
- )
- }
+ public async down(queryRunner: QueryRunner): Promise {
+ await queryRunner.query(
+ `DROP INDEX "public"."UserStoreId"`
+ )
+ await queryRunner.query(
+ `ALTER TABLE "user" DROP COLUMN "store_id"`
+ )
+ }
-}
-```
+ }
+ ```
-Finally, to reflect these changes and start using them, `build` your changes and run migrations with the following commands:
+ Finally, to reflect these changes and start using them, `build` your changes and run migrations with the following commands:
-```bash npm2yarn
-npm run build
-npx medusa migrations run
-```
+ ```bash npm2yarn
+ npm run build
+ npx medusa migrations run
+ ```
-You can extend other entities in a similar manner to associate them with a store.
+ You can extend other entities in a similar manner to associate them with a store.
-
+
---
@@ -179,75 +179,76 @@ You can also extend services if you need to customize a functionality implemente
}
}} />
-
-Example: Extend User Service
+
+ Example: Extend User Service
-You can extend the user service to change how the `create` method is implemented.
+ You can extend the user service to change how the `create` method is implemented.
-To extend the user service, create the file `src/services/user.ts` with the following content:
+ To extend the user service, create the file `src/services/user.ts` with the following content:
-```ts title=src/services/user.ts
-import { Lifetime } from "awilix"
-import {
- UserService as MedusaUserService,
-} from "@medusajs/medusa"
-import { User } from "../models/user"
-import {
- CreateUserInput as MedusaCreateUserInput,
-} from "@medusajs/medusa/dist/types/user"
-import StoreRepository from "../repositories/store"
+ ```ts title=src/services/user.ts
+ import { Lifetime } from "awilix"
+ import {
+ UserService as MedusaUserService,
+ } from "@medusajs/medusa"
+ import { User } from "../models/user"
+ import {
+ CreateUserInput as MedusaCreateUserInput,
+ } from "@medusajs/medusa/dist/types/user"
+ import StoreRepository from "../repositories/store"
-type CreateUserInput = {
- store_id?: string
-} & MedusaCreateUserInput
+ type CreateUserInput = {
+ store_id?: string
+ } & MedusaCreateUserInput
-class UserService extends MedusaUserService {
- static LIFE_TIME = Lifetime.SCOPED
- protected readonly loggedInUser_: User | null
- protected readonly storeRepository_: typeof StoreRepository
+ class UserService extends MedusaUserService {
+ static LIFE_TIME = Lifetime.SCOPED
+ protected readonly loggedInUser_: User | null
+ protected readonly storeRepository_: typeof StoreRepository
- constructor(container, options) {
- super(...arguments)
- this.storeRepository_ = container.storeRepository
+ constructor(container, options) {
+ super(...arguments)
+ this.storeRepository_ = container.storeRepository
- try {
- this.loggedInUser_ = container.loggedInUser
- } catch (e) {
- // avoid errors when backend first runs
+ try {
+ this.loggedInUser_ = container.loggedInUser
+ } catch (e) {
+ // avoid errors when backend first runs
+ }
+ }
+
+ async create(
+ user: CreateUserInput,
+ password: string
+ ): Promise {
+ if (!user.store_id) {
+ const storeRepo = this.manager_.withRepository(
+ this.storeRepository_
+ )
+ let newStore = storeRepo.create()
+ newStore = await storeRepo.save(newStore)
+ user.store_id = newStore.id
+ }
+
+ return await super.create(user, password)
}
}
- async create(
- user: CreateUserInput,
- password: string
- ): Promise {
- if (!user.store_id) {
- const storeRepo = this.manager_.withRepository(
- this.storeRepository_
- )
- let newStore = storeRepo.create()
- newStore = await storeRepo.save(newStore)
- user.store_id = newStore.id
- }
+ export default UserService
+ ```
- return await super.create(user, password)
- }
-}
+ In the `create` method of this extended service, you create a new store if the user being created doesn't have a store associated with it.
-export default UserService
-```
+ You can then test out your customization by running the `build` command and starting the backend:
-In the `create` method of this extended service, you create a new store if the user being created doesn't have a store associated with it.
+ ```bash
+ npm run build
+ npx medusa develop
+ ```
-You can then test out your customization by running the `build` command and starting the backend:
-
-```bash
-npm run build
-npx medusa develop
-```
-
+
---
@@ -267,34 +268,35 @@ To listen to events, you need to create Subscribers that subscribe a handler met
}
}} />
-
-Example: Listen to Order Created Event
+
+ Example: Listen to Order Created Event
-To listen to the `order.placed` event, create the file `src/subscribers/orderNotifier.ts` with the following content:
+ To listen to the `order.placed` event, create the file `src/subscribers/orderNotifier.ts` with the following content:
-```ts title=src/subscribers/orderNotifier.ts
-class OrderNotifierSubscriber {
- constructor({ eventBusService }) {
- eventBusService.subscribe("order.placed", this.handleOrder)
+ ```ts title=src/subscribers/orderNotifier.ts
+ class OrderNotifierSubscriber {
+ constructor({ eventBusService }) {
+ eventBusService.subscribe("order.placed", this.handleOrder)
+ }
+
+ handleOrder = async (data) => {
+ // TODO perform functionality
+ }
}
- handleOrder = async (data) => {
- // TODO perform functionality
- }
-}
+ export default OrderNotifierSubscriber
+ ```
-export default OrderNotifierSubscriber
-```
+ This subscribes the `handleOrder` method to be executed whenever the `order.placed` event is emitted.
-This subscribes the `handleOrder` method to be executed whenever the `order.placed` event is emitted.
+ You can then test out your subscriber by running the `build` command and starting the backend:
-You can then test out your subscriber by running the `build` command and starting the backend:
+ ```bash
+ npm run build
+ npx medusa develop
+ ```
-```bash
-npm run build
-npx medusa develop
-```
-
+
---
diff --git a/www/apps/docs/content/recipes/pos.mdx b/www/apps/docs/content/recipes/pos.mdx
index 2fbae2a8fc..aeb6fe2563 100644
--- a/www/apps/docs/content/recipes/pos.mdx
+++ b/www/apps/docs/content/recipes/pos.mdx
@@ -94,50 +94,48 @@ To search through product variants by their barcode, you can create a custom API
},
]} />
-
-
-Example: Search Products By Barcode API Route
-
+
+ Example: Search Products By Barcode API Route
-Here’s an example of creating a custom API Route at `/store/pos/search-barcode` that searches product variants by a barcode:
+ Here’s an example of creating a custom API Route at `/store/pos/search-barcode` that searches product variants by a barcode:
-```ts title=src/api/store/pos/search-barcode/route.ts
-import type {
- MedusaRequest,
- MedusaResponse,
- ProductVariantService,
-} from "@medusajs/medusa"
-import { MedusaError } from "@medusajs/utils"
+ ```ts title=src/api/store/pos/search-barcode/route.ts
+ import type {
+ MedusaRequest,
+ MedusaResponse,
+ ProductVariantService,
+ } from "@medusajs/medusa"
+ import { MedusaError } from "@medusajs/utils"
-export const GET = async (
- req: MedusaRequest,
- res: MedusaResponse
-) => {
- const barcode = (req.query.barcode as string) || ""
- if (!barcode) {
- throw new MedusaError(
- MedusaError.Types.INVALID_DATA,
- "Barcode is required"
- )
- }
- // get product service
- const productVariantService = req.scope.resolve<
- ProductVariantService
- >("productVariantService")
+ export const GET = async (
+ req: MedusaRequest,
+ res: MedusaResponse
+ ) => {
+ const barcode = (req.query.barcode as string) || ""
+ if (!barcode) {
+ throw new MedusaError(
+ MedusaError.Types.INVALID_DATA,
+ "Barcode is required"
+ )
+ }
+ // get product service
+ const productVariantService = req.scope.resolve<
+ ProductVariantService
+ >("productVariantService")
- // retrieve product variants by barcode
- const productVariants = await productVariantService
- .list({
- barcode,
+ // retrieve product variants by barcode
+ const productVariants = await productVariantService
+ .list({
+ barcode,
+ })
+
+ res.json({
+ product_variants: productVariants,
})
+ }
+ ```
- res.json({
- product_variants: productVariants,
- })
-}
-```
-
-
+
---
diff --git a/www/apps/docs/content/references/entities/classes/Address.mdx b/www/apps/docs/content/references/entities/classes/Address.mdx
index 136a315690..e1ac01d7da 100644
--- a/www/apps/docs/content/references/entities/classes/Address.mdx
+++ b/www/apps/docs/content/references/entities/classes/Address.mdx
@@ -49,7 +49,7 @@ An address is used across the Medusa backend within other schemas and object typ
},
{
"name": "country",
- "type": "``null`` \\| [`Country`](Country.mdx)",
+ "type": "``null`` \\| [Country](Country.mdx)",
"description": "A country object.",
"optional": false,
"defaultValue": "",
@@ -76,7 +76,7 @@ An address is used across the Medusa backend within other schemas and object typ
},
{
"name": "customer",
- "type": "``null`` \\| [`Customer`](Customer.mdx)",
+ "type": "``null`` \\| [Customer](Customer.mdx)",
"description": "Available if the relation `customer` is expanded.",
"optional": false,
"defaultValue": "",
@@ -130,7 +130,7 @@ An address is used across the Medusa backend within other schemas and object typ
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/BatchJob.mdx b/www/apps/docs/content/references/entities/classes/BatchJob.mdx
index ea81f95595..193447cc31 100644
--- a/www/apps/docs/content/references/entities/classes/BatchJob.mdx
+++ b/www/apps/docs/content/references/entities/classes/BatchJob.mdx
@@ -40,7 +40,7 @@ A Batch Job indicates an asynchronus task stored in the Medusa backend. Its stat
},
{
"name": "context",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The context of the batch job, the type of the batch job determines what the context should contain.",
"optional": false,
"defaultValue": "",
@@ -67,7 +67,7 @@ A Batch Job indicates an asynchronus task stored in the Medusa backend. Its stat
},
{
"name": "created_by_user",
- "type": "[`User`](User.mdx)",
+ "type": "[User](User.mdx)",
"description": "The details of the user that created the batch job.",
"optional": false,
"defaultValue": "",
@@ -138,7 +138,7 @@ A Batch Job indicates an asynchronus task stored in the Medusa backend. Its stat
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -156,7 +156,7 @@ A Batch Job indicates an asynchronus task stored in the Medusa backend. Its stat
},
{
"name": "role",
- "type": "[`UserRoles`](../enums/UserRoles.mdx)",
+ "type": "[UserRoles](../enums/UserRoles.mdx)",
"description": "The user's role. These roles don't provide any different privileges.",
"optional": false,
"defaultValue": "member",
@@ -230,7 +230,7 @@ A Batch Job indicates an asynchronus task stored in the Medusa backend. Its stat
},
{
"name": "result",
- "type": "{ `advancement_count?`: `number` ; `count?`: `number` ; `errors?`: (`string` \\| [`BatchJobResultError`](../types/BatchJobResultError.mdx))[] ; `file_key?`: `string` ; `file_size?`: `number` ; `progress?`: `number` ; `stat_descriptors?`: [`BatchJobResultStatDescriptor`](../types/BatchJobResultStatDescriptor.mdx)[] } & Record<`string`, `unknown`\\>",
+ "type": "`{ advancement_count?: number ; count?: number ; errors?: (string \\| [BatchJobResultError](../types/BatchJobResultError.mdx))[] ; file_key?: string ; file_size?: number ; progress?: number ; stat_descriptors?: [BatchJobResultStatDescriptor](../types/BatchJobResultStatDescriptor.mdx)[] }` & `Record`",
"description": "The result of the batch job.",
"optional": false,
"defaultValue": "",
@@ -256,7 +256,7 @@ A Batch Job indicates an asynchronus task stored in the Medusa backend. Its stat
},
{
"name": "errors",
- "type": "(`string` \\| [`BatchJobResultError`](../types/BatchJobResultError.mdx))[]",
+ "type": "(`string` \\| [BatchJobResultError](../types/BatchJobResultError.mdx))[]",
"description": "",
"optional": true,
"defaultValue": "",
@@ -292,7 +292,7 @@ A Batch Job indicates an asynchronus task stored in the Medusa backend. Its stat
},
{
"name": "stat_descriptors",
- "type": "[`BatchJobResultStatDescriptor`](../types/BatchJobResultStatDescriptor.mdx)[]",
+ "type": "[BatchJobResultStatDescriptor](../types/BatchJobResultStatDescriptor.mdx)[]",
"description": "",
"optional": true,
"defaultValue": "",
@@ -303,7 +303,7 @@ A Batch Job indicates an asynchronus task stored in the Medusa backend. Its stat
},
{
"name": "status",
- "type": "[`BatchJobStatus`](../enums/BatchJobStatus.mdx)",
+ "type": "[BatchJobStatus](../enums/BatchJobStatus.mdx)",
"description": "The status of the batch job.",
"optional": false,
"defaultValue": "created",
diff --git a/www/apps/docs/content/references/entities/classes/Cart.mdx b/www/apps/docs/content/references/entities/classes/Cart.mdx
index 9d4d66d067..6bce374839 100644
--- a/www/apps/docs/content/references/entities/classes/Cart.mdx
+++ b/www/apps/docs/content/references/entities/classes/Cart.mdx
@@ -13,7 +13,7 @@ A cart represents a virtual shopping bag. It can be used to complete an order, a
",
+ "type": "`Record`",
"description": "The context of the cart which can include info like IP or user agent.",
"optional": false,
"defaultValue": "",
@@ -58,7 +58,7 @@ A cart represents a virtual shopping bag. It can be used to complete an order, a
},
{
"name": "customer",
- "type": "[`Customer`](Customer.mdx)",
+ "type": "[Customer](Customer.mdx)",
"description": "The details of the customer the cart belongs to.",
"optional": false,
"defaultValue": "",
@@ -94,7 +94,7 @@ A cart represents a virtual shopping bag. It can be used to complete an order, a
},
{
"name": "discounts",
- "type": "[`Discount`](Discount.mdx)[]",
+ "type": "[Discount](Discount.mdx)[]",
"description": "An array of details of all discounts applied to the cart.",
"optional": false,
"defaultValue": "",
@@ -130,7 +130,7 @@ A cart represents a virtual shopping bag. It can be used to complete an order, a
},
{
"name": "gift_cards",
- "type": "[`GiftCard`](GiftCard.mdx)[]",
+ "type": "[GiftCard](GiftCard.mdx)[]",
"description": "An array of details of all gift cards applied to the cart.",
"optional": false,
"defaultValue": "",
@@ -166,7 +166,7 @@ A cart represents a virtual shopping bag. It can be used to complete an order, a
},
{
"name": "items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The line items added to the cart.",
"optional": false,
"defaultValue": "",
@@ -175,7 +175,7 @@ A cart represents a virtual shopping bag. It can be used to complete an order, a
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -193,7 +193,7 @@ A cart represents a virtual shopping bag. It can be used to complete an order, a
},
{
"name": "payment",
- "type": "[`Payment`](Payment.mdx)",
+ "type": "[Payment](Payment.mdx)",
"description": "The details of the payment associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -220,7 +220,7 @@ A cart represents a virtual shopping bag. It can be used to complete an order, a
},
{
"name": "payment_session",
- "type": "``null`` \\| [`PaymentSession`](PaymentSession.mdx)",
+ "type": "``null`` \\| [PaymentSession](PaymentSession.mdx)",
"description": "The details of the selected payment session in the cart.",
"optional": false,
"defaultValue": "",
@@ -229,7 +229,7 @@ A cart represents a virtual shopping bag. It can be used to complete an order, a
},
{
"name": "payment_sessions",
- "type": "[`PaymentSession`](PaymentSession.mdx)[]",
+ "type": "[PaymentSession](PaymentSession.mdx)[]",
"description": "The details of all payment sessions created on the cart.",
"optional": false,
"defaultValue": "",
@@ -265,7 +265,7 @@ A cart represents a virtual shopping bag. It can be used to complete an order, a
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -283,7 +283,7 @@ A cart represents a virtual shopping bag. It can be used to complete an order, a
},
{
"name": "sales_channel",
- "type": "[`SalesChannel`](SalesChannel.mdx)",
+ "type": "[SalesChannel](SalesChannel.mdx)",
"description": "The details of the sales channel associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -301,7 +301,7 @@ A cart represents a virtual shopping bag. It can be used to complete an order, a
},
{
"name": "shipping_address",
- "type": "``null`` \\| [`Address`](Address.mdx)",
+ "type": "``null`` \\| [Address](Address.mdx)",
"description": "The details of the shipping address associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -319,7 +319,7 @@ A cart represents a virtual shopping bag. It can be used to complete an order, a
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods added to the cart.",
"optional": false,
"defaultValue": "",
@@ -373,7 +373,7 @@ A cart represents a virtual shopping bag. It can be used to complete an order, a
},
{
"name": "type",
- "type": "[`CartType`](../enums/CartType.mdx)",
+ "type": "[CartType](../enums/CartType.mdx)",
"description": "The cart's type.",
"optional": false,
"defaultValue": "default",
diff --git a/www/apps/docs/content/references/entities/classes/ClaimImage.mdx b/www/apps/docs/content/references/entities/classes/ClaimImage.mdx
index feebb6aaad..b6a646983e 100644
--- a/www/apps/docs/content/references/entities/classes/ClaimImage.mdx
+++ b/www/apps/docs/content/references/entities/classes/ClaimImage.mdx
@@ -13,7 +13,7 @@ The details of an image attached to a claim.
",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -120,7 +120,7 @@ The details of an image attached to a claim.
},
{
"name": "reason",
- "type": "[`ClaimReason`](../enums/ClaimReason.mdx)",
+ "type": "[ClaimReason](../enums/ClaimReason.mdx)",
"description": "The reason for the claim",
"optional": false,
"defaultValue": "",
@@ -129,7 +129,7 @@ The details of an image attached to a claim.
},
{
"name": "tags",
- "type": "[`ClaimTag`](ClaimTag.mdx)[]",
+ "type": "[ClaimTag](ClaimTag.mdx)[]",
"description": "User defined tags for easy filtering and grouping.",
"optional": false,
"defaultValue": "",
@@ -147,7 +147,7 @@ The details of an image attached to a claim.
},
{
"name": "variant",
- "type": "[`ProductVariant`](ProductVariant.mdx)",
+ "type": "[ProductVariant](ProductVariant.mdx)",
"description": "The details of the product variant to potentially replace the item in the original order.",
"optional": false,
"defaultValue": "",
@@ -203,7 +203,7 @@ The details of an image attached to a claim.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ClaimItem.mdx b/www/apps/docs/content/references/entities/classes/ClaimItem.mdx
index 9cefa9f2ff..2f08d87f94 100644
--- a/www/apps/docs/content/references/entities/classes/ClaimItem.mdx
+++ b/www/apps/docs/content/references/entities/classes/ClaimItem.mdx
@@ -13,7 +13,7 @@ A claim item is an item created as part of a claim. It references an item in the
",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -120,7 +120,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that this claim was created for.",
"optional": false,
"defaultValue": "",
@@ -138,7 +138,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "payment_status",
- "type": "[`ClaimPaymentStatus`](../enums/ClaimPaymentStatus.mdx)",
+ "type": "[ClaimPaymentStatus](../enums/ClaimPaymentStatus.mdx)",
"description": "The status of the claim's payment",
"optional": false,
"defaultValue": "na",
@@ -156,7 +156,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "return_order",
- "type": "[`Return`](Return.mdx)",
+ "type": "[Return](Return.mdx)",
"description": "The details of the return associated with the claim if the claim's type is `replace`.",
"optional": false,
"defaultValue": "",
@@ -165,7 +165,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the address that new items should be shipped to.",
"optional": false,
"defaultValue": "",
@@ -183,7 +183,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods that the claim order will be shipped with.",
"optional": false,
"defaultValue": "",
@@ -192,7 +192,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "type",
- "type": "[`ClaimType`](../enums/ClaimType.mdx)",
+ "type": "[ClaimType](../enums/ClaimType.mdx)",
"description": "The claim's type",
"optional": false,
"defaultValue": "",
@@ -248,7 +248,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "images",
- "type": "[`ClaimImage`](ClaimImage.mdx)[]",
+ "type": "[ClaimImage](ClaimImage.mdx)[]",
"description": "The claim images that are attached to the claim item.",
"optional": false,
"defaultValue": "",
@@ -256,7 +256,7 @@ A claim item is an item created as part of a claim. It references an item in the
"children": [
{
"name": "claim_item",
- "type": "[`ClaimItem`](ClaimItem.mdx)",
+ "type": "[ClaimItem](ClaimItem.mdx)",
"description": "The details of the claim item this image is associated with.",
"optional": false,
"defaultValue": "",
@@ -301,7 +301,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -330,7 +330,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "item",
- "type": "[`LineItem`](LineItem.mdx)",
+ "type": "[LineItem](LineItem.mdx)",
"description": "The details of the line item in the original order that this claim item refers to.",
"optional": false,
"defaultValue": "",
@@ -338,7 +338,7 @@ A claim item is an item created as part of a claim. It references an item in the
"children": [
{
"name": "adjustments",
- "type": "[`LineItemAdjustment`](LineItemAdjustment.mdx)[]",
+ "type": "[LineItemAdjustment](LineItemAdjustment.mdx)[]",
"description": "The details of the item's adjustments, which are available when a discount is applied on the item.",
"optional": false,
"defaultValue": "",
@@ -356,7 +356,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart that the line item may belongs to.",
"optional": false,
"defaultValue": "",
@@ -374,7 +374,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "claim_order",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)",
+ "type": "[ClaimOrder](ClaimOrder.mdx)",
"description": "The details of the claim that the line item may belong to.",
"optional": false,
"defaultValue": "",
@@ -456,7 +456,7 @@ A claim item is an item created as part of a claim. It references an item in the
{
"name": "includes_tax",
"type": "`boolean`",
- "description": "Indicates if the line item unit_price include tax",
+ "description": "Indicates if the line item unit\\_price include tax",
"optional": false,
"defaultValue": "false",
"expandable": false,
@@ -483,7 +483,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -492,7 +492,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the line item may belongs to.",
"optional": false,
"defaultValue": "",
@@ -501,7 +501,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "order_edit",
- "type": "``null`` \\| [`OrderEdit`](OrderEdit.mdx)",
+ "type": "``null`` \\| [OrderEdit](OrderEdit.mdx)",
"description": "The details of the order edit.",
"optional": true,
"defaultValue": "",
@@ -627,7 +627,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "swap",
- "type": "[`Swap`](Swap.mdx)",
+ "type": "[Swap](Swap.mdx)",
"description": "The details of the swap that the line item may belong to.",
"optional": false,
"defaultValue": "",
@@ -645,7 +645,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "tax_lines",
- "type": "[`LineItemTaxLine`](LineItemTaxLine.mdx)[]",
+ "type": "[LineItemTaxLine](LineItemTaxLine.mdx)[]",
"description": "The details of the item's tax lines.",
"optional": false,
"defaultValue": "",
@@ -708,7 +708,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "variant",
- "type": "[`ProductVariant`](ProductVariant.mdx)",
+ "type": "[ProductVariant](ProductVariant.mdx)",
"description": "The details of the product variant that this item was created from.",
"optional": false,
"defaultValue": "",
@@ -737,7 +737,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -764,7 +764,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "reason",
- "type": "[`ClaimReason`](../enums/ClaimReason.mdx)",
+ "type": "[ClaimReason](../enums/ClaimReason.mdx)",
"description": "The reason for the claim",
"optional": false,
"defaultValue": "",
@@ -810,7 +810,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "tags",
- "type": "[`ClaimTag`](ClaimTag.mdx)[]",
+ "type": "[ClaimTag](ClaimTag.mdx)[]",
"description": "User defined tags for easy filtering and grouping.",
"optional": false,
"defaultValue": "",
@@ -845,7 +845,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -883,7 +883,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "variant",
- "type": "[`ProductVariant`](ProductVariant.mdx)",
+ "type": "[ProductVariant](ProductVariant.mdx)",
"description": "The details of the product variant to potentially replace the item in the original order.",
"optional": false,
"defaultValue": "",
@@ -892,7 +892,7 @@ A claim item is an item created as part of a claim. It references an item in the
{
"name": "allow_backorder",
"type": "`boolean`",
- "description": "Whether the Product Variant should be purchasable when `inventory_quantity` is 0.",
+ "description": "Whether the Product Variant should be purchasable when `inventory\\_quantity` is 0.",
"optional": false,
"defaultValue": "false",
"expandable": false,
@@ -963,7 +963,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "inventory_items",
- "type": "[`ProductVariantInventoryItem`](ProductVariantInventoryItem.mdx)[]",
+ "type": "[ProductVariantInventoryItem](ProductVariantInventoryItem.mdx)[]",
"description": "The details inventory items of the product variant.",
"optional": false,
"defaultValue": "",
@@ -1008,7 +1008,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -1026,7 +1026,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "options",
- "type": "[`ProductOptionValue`](ProductOptionValue.mdx)[]",
+ "type": "[ProductOptionValue](ProductOptionValue.mdx)[]",
"description": "The details of the product options that this product variant defines values for.",
"optional": false,
"defaultValue": "",
@@ -1044,7 +1044,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "prices",
- "type": "[`MoneyAmount`](MoneyAmount.mdx)[]",
+ "type": "[MoneyAmount](MoneyAmount.mdx)[]",
"description": "The details of the prices of the Product Variant, each represented as a Money Amount. Each Money Amount represents a price in a given currency or a specific Region.",
"optional": false,
"defaultValue": "",
@@ -1053,7 +1053,7 @@ A claim item is an item created as part of a claim. It references an item in the
},
{
"name": "product",
- "type": "[`Product`](Product.mdx)",
+ "type": "[Product](Product.mdx)",
"description": "The details of the product that the product variant belongs to.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ClaimOrder.mdx b/www/apps/docs/content/references/entities/classes/ClaimOrder.mdx
index cd817c9382..92ef2561f7 100644
--- a/www/apps/docs/content/references/entities/classes/ClaimOrder.mdx
+++ b/www/apps/docs/content/references/entities/classes/ClaimOrder.mdx
@@ -13,7 +13,7 @@ A Claim represents a group of faulty or missing items. It consists of claim item
",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -112,7 +112,7 @@ A Claim represents a group of faulty or missing items. It consists of claim item
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that this claim was created for.",
"optional": false,
"defaultValue": "",
@@ -130,7 +130,7 @@ A Claim represents a group of faulty or missing items. It consists of claim item
},
{
"name": "payment_status",
- "type": "[`ClaimPaymentStatus`](../enums/ClaimPaymentStatus.mdx)",
+ "type": "[ClaimPaymentStatus](../enums/ClaimPaymentStatus.mdx)",
"description": "The status of the claim's payment",
"optional": false,
"defaultValue": "na",
@@ -148,7 +148,7 @@ A Claim represents a group of faulty or missing items. It consists of claim item
},
{
"name": "return_order",
- "type": "[`Return`](Return.mdx)",
+ "type": "[Return](Return.mdx)",
"description": "The details of the return associated with the claim if the claim's type is `replace`.",
"optional": false,
"defaultValue": "",
@@ -157,7 +157,7 @@ A Claim represents a group of faulty or missing items. It consists of claim item
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the address that new items should be shipped to.",
"optional": false,
"defaultValue": "",
@@ -175,7 +175,7 @@ A Claim represents a group of faulty or missing items. It consists of claim item
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods that the claim order will be shipped with.",
"optional": false,
"defaultValue": "",
@@ -184,7 +184,7 @@ A Claim represents a group of faulty or missing items. It consists of claim item
},
{
"name": "type",
- "type": "[`ClaimType`](../enums/ClaimType.mdx)",
+ "type": "[ClaimType](../enums/ClaimType.mdx)",
"description": "The claim's type",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ClaimTag.mdx b/www/apps/docs/content/references/entities/classes/ClaimTag.mdx
index 31d26fbb1c..c0cf8bb31d 100644
--- a/www/apps/docs/content/references/entities/classes/ClaimTag.mdx
+++ b/www/apps/docs/content/references/entities/classes/ClaimTag.mdx
@@ -40,7 +40,7 @@ Claim Tags are user defined tags that can be assigned to claim items for easy fi
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/Country.mdx b/www/apps/docs/content/references/entities/classes/Country.mdx
index 4a26cc7217..6f4555ba0a 100644
--- a/www/apps/docs/content/references/entities/classes/Country.mdx
+++ b/www/apps/docs/content/references/entities/classes/Country.mdx
@@ -67,7 +67,7 @@ Country details
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region the country is associated with.",
"optional": false,
"defaultValue": "",
@@ -84,7 +84,7 @@ Country details
},
{
"name": "countries",
- "type": "[`Country`](Country.mdx)[]",
+ "type": "[Country](Country.mdx)[]",
"description": "The details of the countries included in this region.",
"optional": false,
"defaultValue": "",
@@ -102,7 +102,7 @@ Country details
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency used in the region.",
"optional": false,
"defaultValue": "",
@@ -129,7 +129,7 @@ Country details
},
{
"name": "fulfillment_providers",
- "type": "[`FulfillmentProvider`](FulfillmentProvider.mdx)[]",
+ "type": "[FulfillmentProvider](FulfillmentProvider.mdx)[]",
"description": "The details of the fulfillment providers that can be used to fulfill items of orders and similar resources in the region.",
"optional": false,
"defaultValue": "",
@@ -166,7 +166,7 @@ Country details
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -184,7 +184,7 @@ Country details
},
{
"name": "payment_providers",
- "type": "[`PaymentProvider`](PaymentProvider.mdx)[]",
+ "type": "[PaymentProvider](PaymentProvider.mdx)[]",
"description": "The details of the payment providers that can be used to process payments in the region.",
"optional": false,
"defaultValue": "",
@@ -202,7 +202,7 @@ Country details
},
{
"name": "tax_provider",
- "type": "[`TaxProvider`](TaxProvider.mdx)",
+ "type": "[TaxProvider](TaxProvider.mdx)",
"description": "The details of the tax provider used in the region.",
"optional": false,
"defaultValue": "",
@@ -229,7 +229,7 @@ Country details
},
{
"name": "tax_rates",
- "type": "``null`` \\| [`TaxRate`](TaxRate.mdx)[]",
+ "type": "``null`` \\| [TaxRate](TaxRate.mdx)[]",
"description": "The details of the tax rates used in the region, aside from the default rate.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/CustomShippingOption.mdx b/www/apps/docs/content/references/entities/classes/CustomShippingOption.mdx
index 4bc6c956a1..007cb729d0 100644
--- a/www/apps/docs/content/references/entities/classes/CustomShippingOption.mdx
+++ b/www/apps/docs/content/references/entities/classes/CustomShippingOption.mdx
@@ -13,7 +13,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
",
+ "type": "`Record`",
"description": "The context of the cart which can include info like IP or user agent.",
"optional": false,
"defaultValue": "",
@@ -66,7 +66,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "customer",
- "type": "[`Customer`](Customer.mdx)",
+ "type": "[Customer](Customer.mdx)",
"description": "The details of the customer the cart belongs to.",
"optional": false,
"defaultValue": "",
@@ -102,7 +102,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "discounts",
- "type": "[`Discount`](Discount.mdx)[]",
+ "type": "[Discount](Discount.mdx)[]",
"description": "An array of details of all discounts applied to the cart.",
"optional": false,
"defaultValue": "",
@@ -138,7 +138,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "gift_cards",
- "type": "[`GiftCard`](GiftCard.mdx)[]",
+ "type": "[GiftCard](GiftCard.mdx)[]",
"description": "An array of details of all gift cards applied to the cart.",
"optional": false,
"defaultValue": "",
@@ -174,7 +174,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The line items added to the cart.",
"optional": false,
"defaultValue": "",
@@ -183,7 +183,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -201,7 +201,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "payment",
- "type": "[`Payment`](Payment.mdx)",
+ "type": "[Payment](Payment.mdx)",
"description": "The details of the payment associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -228,7 +228,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "payment_session",
- "type": "``null`` \\| [`PaymentSession`](PaymentSession.mdx)",
+ "type": "``null`` \\| [PaymentSession](PaymentSession.mdx)",
"description": "The details of the selected payment session in the cart.",
"optional": false,
"defaultValue": "",
@@ -237,7 +237,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "payment_sessions",
- "type": "[`PaymentSession`](PaymentSession.mdx)[]",
+ "type": "[PaymentSession](PaymentSession.mdx)[]",
"description": "The details of all payment sessions created on the cart.",
"optional": false,
"defaultValue": "",
@@ -273,7 +273,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -291,7 +291,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "sales_channel",
- "type": "[`SalesChannel`](SalesChannel.mdx)",
+ "type": "[SalesChannel](SalesChannel.mdx)",
"description": "The details of the sales channel associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -309,7 +309,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "shipping_address",
- "type": "``null`` \\| [`Address`](Address.mdx)",
+ "type": "``null`` \\| [Address](Address.mdx)",
"description": "The details of the shipping address associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -327,7 +327,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods added to the cart.",
"optional": false,
"defaultValue": "",
@@ -381,7 +381,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "type",
- "type": "[`CartType`](../enums/CartType.mdx)",
+ "type": "[CartType](../enums/CartType.mdx)",
"description": "The cart's type.",
"optional": false,
"defaultValue": "default",
@@ -437,7 +437,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -455,7 +455,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "shipping_option",
- "type": "[`ShippingOption`](ShippingOption.mdx)",
+ "type": "[ShippingOption](ShippingOption.mdx)",
"description": "The details of the overridden shipping options.",
"optional": false,
"defaultValue": "",
@@ -473,7 +473,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
{
"name": "amount",
"type": "``null`` \\| `number`",
- "description": "The amount to charge for shipping when the Shipping Option price type is `flat_rate`.",
+ "description": "The amount to charge for shipping when the Shipping Option price type is `flat\\_rate`.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -490,7 +490,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The data needed for the Fulfillment Provider to identify the Shipping Option.",
"optional": false,
"defaultValue": "",
@@ -536,7 +536,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -554,8 +554,8 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "price_type",
- "type": "[`ShippingOptionPriceType`](../enums/ShippingOptionPriceType.mdx)",
- "description": "The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations.",
+ "type": "[ShippingOptionPriceType](../enums/ShippingOptionPriceType.mdx)",
+ "description": "The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat\\_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -563,7 +563,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "profile",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)",
+ "type": "[ShippingProfile](ShippingProfile.mdx)",
"description": "The details of the shipping profile that the shipping option belongs to.",
"optional": false,
"defaultValue": "",
@@ -581,7 +581,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "provider",
- "type": "[`FulfillmentProvider`](FulfillmentProvider.mdx)",
+ "type": "[FulfillmentProvider](FulfillmentProvider.mdx)",
"description": "The details of the fulfillment provider that will be used to later to process the shipping method created from this shipping option and its fulfillments.",
"optional": false,
"defaultValue": "",
@@ -599,7 +599,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this shipping option can be used in.",
"optional": false,
"defaultValue": "",
@@ -617,7 +617,7 @@ Custom Shipping Options are overridden Shipping Options. Admins can attach a Cus
},
{
"name": "requirements",
- "type": "[`ShippingOptionRequirement`](ShippingOptionRequirement.mdx)[]",
+ "type": "[ShippingOptionRequirement](ShippingOptionRequirement.mdx)[]",
"description": "The details of the requirements that must be satisfied for the Shipping Option to be available for usage in a Cart.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/Customer.mdx b/www/apps/docs/content/references/entities/classes/Customer.mdx
index 0abd0f28e1..5a81426421 100644
--- a/www/apps/docs/content/references/entities/classes/Customer.mdx
+++ b/www/apps/docs/content/references/entities/classes/Customer.mdx
@@ -13,7 +13,7 @@ A customer can make purchases in your store and manage their profile.
",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -230,7 +230,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "groups",
- "type": "[`CustomerGroup`](CustomerGroup.mdx)[]",
+ "type": "[CustomerGroup](CustomerGroup.mdx)[]",
"description": "The customer groups the customer belongs to.",
"optional": false,
"defaultValue": "",
@@ -247,7 +247,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "customers",
- "type": "[`Customer`](Customer.mdx)[]",
+ "type": "[Customer](Customer.mdx)[]",
"description": "The details of the customers that belong to the customer group.",
"optional": false,
"defaultValue": "",
@@ -274,7 +274,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -292,7 +292,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "price_lists",
- "type": "[`PriceList`](PriceList.mdx)[]",
+ "type": "[PriceList](PriceList.mdx)[]",
"description": "The price lists that are associated with the customer group.",
"optional": false,
"defaultValue": "",
@@ -339,7 +339,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -348,7 +348,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "orders",
- "type": "[`Order`](Order.mdx)[]",
+ "type": "[Order](Order.mdx)[]",
"description": "The details of the orders this customer placed.",
"optional": false,
"defaultValue": "",
@@ -356,7 +356,7 @@ A customer can make purchases in your store and manage their profile.
"children": [
{
"name": "billing_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the billing address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -383,7 +383,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart associated with the order.",
"optional": false,
"defaultValue": "",
@@ -401,7 +401,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "claims",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)[]",
+ "type": "[ClaimOrder](ClaimOrder.mdx)[]",
"description": "The details of the claims created for the order.",
"optional": false,
"defaultValue": "",
@@ -419,7 +419,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency used in the order.",
"optional": false,
"defaultValue": "",
@@ -437,7 +437,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "customer",
- "type": "[`Customer`](Customer.mdx)",
+ "type": "[Customer](Customer.mdx)",
"description": "The details of the customer associated with the order.",
"optional": false,
"defaultValue": "",
@@ -464,7 +464,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "discounts",
- "type": "[`Discount`](Discount.mdx)[]",
+ "type": "[Discount](Discount.mdx)[]",
"description": "The details of the discounts applied on the order.",
"optional": false,
"defaultValue": "",
@@ -482,7 +482,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "draft_order",
- "type": "[`DraftOrder`](DraftOrder.mdx)",
+ "type": "[DraftOrder](DraftOrder.mdx)",
"description": "The details of the draft order this order was created from.",
"optional": false,
"defaultValue": "",
@@ -500,7 +500,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "edits",
- "type": "[`OrderEdit`](OrderEdit.mdx)[]",
+ "type": "[OrderEdit](OrderEdit.mdx)[]",
"description": "The details of the order edits done on the order.",
"optional": false,
"defaultValue": "",
@@ -527,7 +527,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "fulfillment_status",
- "type": "[`FulfillmentStatus`](../enums/FulfillmentStatus.mdx)",
+ "type": "[FulfillmentStatus](../enums/FulfillmentStatus.mdx)",
"description": "The order's fulfillment status",
"optional": false,
"defaultValue": "not_fulfilled",
@@ -536,7 +536,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "fulfillments",
- "type": "[`Fulfillment`](Fulfillment.mdx)[]",
+ "type": "[Fulfillment](Fulfillment.mdx)[]",
"description": "The details of the fulfillments created for the order.",
"optional": false,
"defaultValue": "",
@@ -563,7 +563,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "gift_card_transactions",
- "type": "[`GiftCardTransaction`](GiftCardTransaction.mdx)[]",
+ "type": "[GiftCardTransaction](GiftCardTransaction.mdx)[]",
"description": "The gift card transactions made in the order.",
"optional": false,
"defaultValue": "",
@@ -572,7 +572,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "gift_cards",
- "type": "[`GiftCard`](GiftCard.mdx)[]",
+ "type": "[GiftCard](GiftCard.mdx)[]",
"description": "The details of the gift card used in the order.",
"optional": false,
"defaultValue": "",
@@ -608,7 +608,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that belong to the order.",
"optional": false,
"defaultValue": "",
@@ -617,7 +617,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -653,7 +653,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "payment_status",
- "type": "[`PaymentStatus`](../enums/PaymentStatus.mdx)",
+ "type": "[PaymentStatus](../enums/PaymentStatus.mdx)",
"description": "The order's payment status",
"optional": false,
"defaultValue": "not_paid",
@@ -662,7 +662,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "payments",
- "type": "[`Payment`](Payment.mdx)[]",
+ "type": "[Payment](Payment.mdx)[]",
"description": "The details of the payments used in the order.",
"optional": false,
"defaultValue": "",
@@ -698,7 +698,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "refunds",
- "type": "[`Refund`](Refund.mdx)[]",
+ "type": "[Refund](Refund.mdx)[]",
"description": "The details of the refunds created for the order.",
"optional": false,
"defaultValue": "",
@@ -707,7 +707,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this order was created in.",
"optional": false,
"defaultValue": "",
@@ -725,7 +725,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "returnable_items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
"optional": true,
"defaultValue": "",
@@ -734,7 +734,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "returns",
- "type": "[`Return`](Return.mdx)[]",
+ "type": "[Return](Return.mdx)[]",
"description": "The details of the returns created for the order.",
"optional": false,
"defaultValue": "",
@@ -743,7 +743,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "sales_channel",
- "type": "[`SalesChannel`](SalesChannel.mdx)",
+ "type": "[SalesChannel](SalesChannel.mdx)",
"description": "The details of the sales channel this order belongs to.",
"optional": false,
"defaultValue": "",
@@ -761,7 +761,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the shipping address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -779,7 +779,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods used in the order.",
"optional": false,
"defaultValue": "",
@@ -806,7 +806,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "status",
- "type": "[`OrderStatus`](../enums/OrderStatus.mdx)",
+ "type": "[OrderStatus](../enums/OrderStatus.mdx)",
"description": "The order's status",
"optional": false,
"defaultValue": "pending",
@@ -824,7 +824,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "swaps",
- "type": "[`Swap`](Swap.mdx)[]",
+ "type": "[Swap](Swap.mdx)[]",
"description": "The details of the swaps created for the order.",
"optional": false,
"defaultValue": "",
@@ -889,7 +889,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "shipping_addresses",
- "type": "[`Address`](Address.mdx)[]",
+ "type": "[Address](Address.mdx)[]",
"description": "The details of the shipping addresses associated with the customer.",
"optional": false,
"defaultValue": "",
@@ -933,7 +933,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "country",
- "type": "``null`` \\| [`Country`](Country.mdx)",
+ "type": "``null`` \\| [Country](Country.mdx)",
"description": "A country object.",
"optional": false,
"defaultValue": "",
@@ -960,7 +960,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "customer",
- "type": "``null`` \\| [`Customer`](Customer.mdx)",
+ "type": "``null`` \\| [Customer](Customer.mdx)",
"description": "Available if the relation `customer` is expanded.",
"optional": false,
"defaultValue": "",
@@ -1014,7 +1014,7 @@ A customer can make purchases in your store and manage their profile.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/CustomerGroup.mdx b/www/apps/docs/content/references/entities/classes/CustomerGroup.mdx
index c7aaeae400..b2aaee5a67 100644
--- a/www/apps/docs/content/references/entities/classes/CustomerGroup.mdx
+++ b/www/apps/docs/content/references/entities/classes/CustomerGroup.mdx
@@ -22,7 +22,7 @@ A customer group that can be used to organize customers into groups of similar t
},
{
"name": "customers",
- "type": "[`Customer`](Customer.mdx)[]",
+ "type": "[Customer](Customer.mdx)[]",
"description": "The details of the customers that belong to the customer group.",
"optional": false,
"defaultValue": "",
@@ -30,7 +30,7 @@ A customer group that can be used to organize customers into groups of similar t
"children": [
{
"name": "billing_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the billing address associated with the customer.",
"optional": false,
"defaultValue": "",
@@ -84,7 +84,7 @@ A customer group that can be used to organize customers into groups of similar t
},
{
"name": "groups",
- "type": "[`CustomerGroup`](CustomerGroup.mdx)[]",
+ "type": "[CustomerGroup](CustomerGroup.mdx)[]",
"description": "The customer groups the customer belongs to.",
"optional": false,
"defaultValue": "",
@@ -120,7 +120,7 @@ A customer group that can be used to organize customers into groups of similar t
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -129,7 +129,7 @@ A customer group that can be used to organize customers into groups of similar t
},
{
"name": "orders",
- "type": "[`Order`](Order.mdx)[]",
+ "type": "[Order](Order.mdx)[]",
"description": "The details of the orders this customer placed.",
"optional": false,
"defaultValue": "",
@@ -156,7 +156,7 @@ A customer group that can be used to organize customers into groups of similar t
},
{
"name": "shipping_addresses",
- "type": "[`Address`](Address.mdx)[]",
+ "type": "[Address](Address.mdx)[]",
"description": "The details of the shipping addresses associated with the customer.",
"optional": false,
"defaultValue": "",
@@ -194,7 +194,7 @@ A customer group that can be used to organize customers into groups of similar t
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -212,7 +212,7 @@ A customer group that can be used to organize customers into groups of similar t
},
{
"name": "price_lists",
- "type": "[`PriceList`](PriceList.mdx)[]",
+ "type": "[PriceList](PriceList.mdx)[]",
"description": "The price lists that are associated with the customer group.",
"optional": false,
"defaultValue": "",
@@ -229,7 +229,7 @@ A customer group that can be used to organize customers into groups of similar t
},
{
"name": "customer_groups",
- "type": "[`CustomerGroup`](CustomerGroup.mdx)[]",
+ "type": "[CustomerGroup](CustomerGroup.mdx)[]",
"description": "The details of the customer groups that the Price List can apply to.",
"optional": false,
"defaultValue": "",
@@ -293,7 +293,7 @@ A customer group that can be used to organize customers into groups of similar t
},
{
"name": "prices",
- "type": "[`MoneyAmount`](MoneyAmount.mdx)[]",
+ "type": "[MoneyAmount](MoneyAmount.mdx)[]",
"description": "The prices that belong to the price list, represented as a Money Amount.",
"optional": false,
"defaultValue": "",
@@ -311,7 +311,7 @@ A customer group that can be used to organize customers into groups of similar t
},
{
"name": "status",
- "type": "[`PriceListStatus`](../enums/PriceListStatus.mdx)",
+ "type": "[PriceListStatus](../enums/PriceListStatus.mdx)",
"description": "The status of the Price List",
"optional": false,
"defaultValue": "draft",
@@ -320,7 +320,7 @@ A customer group that can be used to organize customers into groups of similar t
},
{
"name": "type",
- "type": "[`PriceListType`](../enums/PriceListType.mdx)",
+ "type": "[PriceListType](../enums/PriceListType.mdx)",
"description": "The type of Price List. This can be one of either `sale` or `override`.",
"optional": false,
"defaultValue": "sale",
diff --git a/www/apps/docs/content/references/entities/classes/Discount.mdx b/www/apps/docs/content/references/entities/classes/Discount.mdx
index d883f4992a..5d390d5bc2 100644
--- a/www/apps/docs/content/references/entities/classes/Discount.mdx
+++ b/www/apps/docs/content/references/entities/classes/Discount.mdx
@@ -76,7 +76,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -85,7 +85,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "parent_discount",
- "type": "[`Discount`](Discount.mdx)",
+ "type": "[Discount](Discount.mdx)",
"description": "The details of the parent discount that this discount was created from.",
"optional": false,
"defaultValue": "",
@@ -156,7 +156,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -165,7 +165,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "parent_discount",
- "type": "[`Discount`](Discount.mdx)",
+ "type": "[Discount](Discount.mdx)",
"description": "The details of the parent discount that this discount was created from.",
"optional": false,
"defaultValue": "",
@@ -183,7 +183,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "regions",
- "type": "[`Region`](Region.mdx)[]",
+ "type": "[Region](Region.mdx)[]",
"description": "The details of the regions in which the Discount can be used.",
"optional": false,
"defaultValue": "",
@@ -192,7 +192,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "rule",
- "type": "[`DiscountRule`](DiscountRule.mdx)",
+ "type": "[DiscountRule](DiscountRule.mdx)",
"description": "The details of the discount rule that defines how the discount will be applied to a cart..",
"optional": false,
"defaultValue": "",
@@ -266,7 +266,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "regions",
- "type": "[`Region`](Region.mdx)[]",
+ "type": "[Region](Region.mdx)[]",
"description": "The details of the regions in which the Discount can be used.",
"optional": false,
"defaultValue": "",
@@ -283,7 +283,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "countries",
- "type": "[`Country`](Country.mdx)[]",
+ "type": "[Country](Country.mdx)[]",
"description": "The details of the countries included in this region.",
"optional": false,
"defaultValue": "",
@@ -301,7 +301,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency used in the region.",
"optional": false,
"defaultValue": "",
@@ -328,7 +328,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "fulfillment_providers",
- "type": "[`FulfillmentProvider`](FulfillmentProvider.mdx)[]",
+ "type": "[FulfillmentProvider](FulfillmentProvider.mdx)[]",
"description": "The details of the fulfillment providers that can be used to fulfill items of orders and similar resources in the region.",
"optional": false,
"defaultValue": "",
@@ -365,7 +365,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -383,7 +383,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "payment_providers",
- "type": "[`PaymentProvider`](PaymentProvider.mdx)[]",
+ "type": "[PaymentProvider](PaymentProvider.mdx)[]",
"description": "The details of the payment providers that can be used to process payments in the region.",
"optional": false,
"defaultValue": "",
@@ -401,7 +401,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "tax_provider",
- "type": "[`TaxProvider`](TaxProvider.mdx)",
+ "type": "[TaxProvider](TaxProvider.mdx)",
"description": "The details of the tax provider used in the region.",
"optional": false,
"defaultValue": "",
@@ -428,7 +428,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "tax_rates",
- "type": "``null`` \\| [`TaxRate`](TaxRate.mdx)[]",
+ "type": "``null`` \\| [TaxRate](TaxRate.mdx)[]",
"description": "The details of the tax rates used in the region, aside from the default rate.",
"optional": false,
"defaultValue": "",
@@ -448,7 +448,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "rule",
- "type": "[`DiscountRule`](DiscountRule.mdx)",
+ "type": "[DiscountRule](DiscountRule.mdx)",
"description": "The details of the discount rule that defines how the discount will be applied to a cart..",
"optional": false,
"defaultValue": "",
@@ -456,7 +456,7 @@ A discount can be applied to a cart for promotional purposes.
"children": [
{
"name": "allocation",
- "type": "[`AllocationType`](../enums/AllocationType.mdx)",
+ "type": "[AllocationType](../enums/AllocationType.mdx)",
"description": "The scope that the discount should apply to.",
"optional": false,
"defaultValue": "",
@@ -465,7 +465,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "conditions",
- "type": "[`DiscountCondition`](DiscountCondition.mdx)[]",
+ "type": "[DiscountCondition](DiscountCondition.mdx)[]",
"description": "The details of the discount conditions associated with the rule. They can be used to limit when the discount can be used.",
"optional": false,
"defaultValue": "",
@@ -510,7 +510,7 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -519,8 +519,8 @@ A discount can be applied to a cart for promotional purposes.
},
{
"name": "type",
- "type": "[`DiscountRuleType`](../enums/DiscountRuleType.mdx)",
- "description": "The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers.",
+ "type": "[DiscountRuleType](../enums/DiscountRuleType.mdx)",
+ "description": "The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free\\_shipping` for shipping vouchers.",
"optional": false,
"defaultValue": "",
"expandable": false,
diff --git a/www/apps/docs/content/references/entities/classes/DiscountCondition.mdx b/www/apps/docs/content/references/entities/classes/DiscountCondition.mdx
index 8f87541d9a..d82528883d 100644
--- a/www/apps/docs/content/references/entities/classes/DiscountCondition.mdx
+++ b/www/apps/docs/content/references/entities/classes/DiscountCondition.mdx
@@ -22,8 +22,8 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "customer_groups",
- "type": "[`CustomerGroup`](CustomerGroup.mdx)[]",
- "description": "Customer groups associated with this condition if `type` is `customer_groups`.",
+ "type": "[CustomerGroup](CustomerGroup.mdx)[]",
+ "description": "Customer groups associated with this condition if `type` is `customer\\_groups`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -39,7 +39,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "customers",
- "type": "[`Customer`](Customer.mdx)[]",
+ "type": "[Customer](Customer.mdx)[]",
"description": "The details of the customers that belong to the customer group.",
"optional": false,
"defaultValue": "",
@@ -66,7 +66,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -84,7 +84,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "price_lists",
- "type": "[`PriceList`](PriceList.mdx)[]",
+ "type": "[PriceList](PriceList.mdx)[]",
"description": "The price lists that are associated with the customer group.",
"optional": false,
"defaultValue": "",
@@ -113,7 +113,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "discount_rule",
- "type": "[`DiscountRule`](DiscountRule.mdx)",
+ "type": "[DiscountRule](DiscountRule.mdx)",
"description": "The details of the discount rule associated with the condition.",
"optional": false,
"defaultValue": "",
@@ -121,7 +121,7 @@ Holds rule conditions for when a discount is applicable
"children": [
{
"name": "allocation",
- "type": "[`AllocationType`](../enums/AllocationType.mdx)",
+ "type": "[AllocationType](../enums/AllocationType.mdx)",
"description": "The scope that the discount should apply to.",
"optional": false,
"defaultValue": "",
@@ -130,7 +130,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "conditions",
- "type": "[`DiscountCondition`](DiscountCondition.mdx)[]",
+ "type": "[DiscountCondition](DiscountCondition.mdx)[]",
"description": "The details of the discount conditions associated with the rule. They can be used to limit when the discount can be used.",
"optional": false,
"defaultValue": "",
@@ -175,7 +175,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -184,8 +184,8 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "type",
- "type": "[`DiscountRuleType`](../enums/DiscountRuleType.mdx)",
- "description": "The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers.",
+ "type": "[DiscountRuleType](../enums/DiscountRuleType.mdx)",
+ "description": "The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free\\_shipping` for shipping vouchers.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -231,7 +231,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -240,8 +240,8 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "operator",
- "type": "[`DiscountConditionOperator`](../enums/DiscountConditionOperator.mdx)",
- "description": "The operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that discountable resources are everything but the specified resources.",
+ "type": "[DiscountConditionOperator](../enums/DiscountConditionOperator.mdx)",
+ "description": "The operator of the condition. `in` indicates that discountable resources are within the specified resources. `not\\_in` indicates that discountable resources are everything but the specified resources.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -268,8 +268,8 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "product_collections",
- "type": "[`ProductCollection`](ProductCollection.mdx)[]",
- "description": "Product collections associated with this condition if `type` is `product_collections`.",
+ "type": "[ProductCollection](ProductCollection.mdx)[]",
+ "description": "Product collections associated with this condition if `type` is `product\\_collections`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -312,7 +312,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -321,7 +321,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "The details of the products that belong to this product collection.",
"optional": false,
"defaultValue": "",
@@ -350,8 +350,8 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "product_tags",
- "type": "[`ProductTag`](ProductTag.mdx)[]",
- "description": "Product tags associated with this condition if `type` is `product_tags`.",
+ "type": "[ProductTag](ProductTag.mdx)[]",
+ "description": "Product tags associated with this condition if `type` is `product\\_tags`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -385,7 +385,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -414,8 +414,8 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "product_types",
- "type": "[`ProductType`](ProductType.mdx)[]",
- "description": "Product types associated with this condition if `type` is `product_types`.",
+ "type": "[ProductType](ProductType.mdx)[]",
+ "description": "Product types associated with this condition if `type` is `product\\_types`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -449,7 +449,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -478,7 +478,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "products associated with this condition if `type` is `products`.",
"optional": false,
"defaultValue": "",
@@ -486,7 +486,7 @@ Holds rule conditions for when a discount is applicable
"children": [
{
"name": "categories",
- "type": "[`ProductCategory`](ProductCategory.mdx)[]",
+ "type": "[ProductCategory](ProductCategory.mdx)[]",
"description": "The details of the product categories that this product belongs to.",
"optional": false,
"defaultValue": "",
@@ -496,7 +496,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "collection",
- "type": "[`ProductCollection`](ProductCollection.mdx)",
+ "type": "[ProductCollection](ProductCollection.mdx)",
"description": "The details of the product collection that the product belongs to.",
"optional": false,
"defaultValue": "",
@@ -595,7 +595,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "images",
- "type": "[`Image`](Image.mdx)[]",
+ "type": "[Image](Image.mdx)[]",
"description": "The details of the product's images.",
"optional": false,
"defaultValue": "",
@@ -631,7 +631,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -649,7 +649,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "options",
- "type": "[`ProductOption`](ProductOption.mdx)[]",
+ "type": "[ProductOption](ProductOption.mdx)[]",
"description": "The details of the Product Options that are defined for the Product. The product's variants will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
@@ -667,7 +667,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "profile",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)",
+ "type": "[ShippingProfile](ShippingProfile.mdx)",
"description": "The details of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
"optional": false,
"defaultValue": "",
@@ -685,7 +685,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "profiles",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)[]",
+ "type": "[ShippingProfile](ShippingProfile.mdx)[]",
"description": "Available if the relation `profiles` is expanded.",
"optional": false,
"defaultValue": "",
@@ -694,7 +694,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "sales_channels",
- "type": "[`SalesChannel`](SalesChannel.mdx)[]",
+ "type": "[SalesChannel](SalesChannel.mdx)[]",
"description": "The details of the sales channels this product is available in.",
"optional": false,
"defaultValue": "",
@@ -703,7 +703,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "status",
- "type": "[`ProductStatus`](../enums/ProductStatus.mdx)",
+ "type": "[ProductStatus](../enums/ProductStatus.mdx)",
"description": "The status of the product",
"optional": false,
"defaultValue": "draft",
@@ -721,7 +721,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "tags",
- "type": "[`ProductTag`](ProductTag.mdx)[]",
+ "type": "[ProductTag](ProductTag.mdx)[]",
"description": "The details of the product tags used in this product.",
"optional": false,
"defaultValue": "",
@@ -748,7 +748,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "type",
- "type": "[`ProductType`](ProductType.mdx)",
+ "type": "[ProductType](ProductType.mdx)",
"description": "The details of the product type that the product belongs to.",
"optional": false,
"defaultValue": "",
@@ -775,7 +775,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "variants",
- "type": "[`ProductVariant`](ProductVariant.mdx)[]",
+ "type": "[ProductVariant](ProductVariant.mdx)[]",
"description": "The details of the Product Variants that belong to the Product. Each will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
@@ -804,7 +804,7 @@ Holds rule conditions for when a discount is applicable
},
{
"name": "type",
- "type": "[`DiscountConditionType`](../enums/DiscountConditionType.mdx)",
+ "type": "[DiscountConditionType](../enums/DiscountConditionType.mdx)",
"description": "The type of the condition. The type affects the available resources associated with the condition. For example, if the type is `products`, that means the `products` relation will hold the products associated with this condition and other relations will be empty.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/DiscountConditionCustomerGroup.mdx b/www/apps/docs/content/references/entities/classes/DiscountConditionCustomerGroup.mdx
index d7786d8bf1..17e763a2ba 100644
--- a/www/apps/docs/content/references/entities/classes/DiscountConditionCustomerGroup.mdx
+++ b/www/apps/docs/content/references/entities/classes/DiscountConditionCustomerGroup.mdx
@@ -31,8 +31,8 @@ Associates a discount condition with a customer group
},
{
"name": "customer_group",
- "type": "[`CustomerGroup`](CustomerGroup.mdx)",
- "description": "Available if the relation `customer_group` is expanded.",
+ "type": "[CustomerGroup](CustomerGroup.mdx)",
+ "description": "Available if the relation `customer\\_group` is expanded.",
"optional": true,
"defaultValue": "",
"expandable": false,
@@ -48,7 +48,7 @@ Associates a discount condition with a customer group
},
{
"name": "customers",
- "type": "[`Customer`](Customer.mdx)[]",
+ "type": "[Customer](Customer.mdx)[]",
"description": "The details of the customers that belong to the customer group.",
"optional": false,
"defaultValue": "",
@@ -75,7 +75,7 @@ Associates a discount condition with a customer group
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -93,7 +93,7 @@ Associates a discount condition with a customer group
},
{
"name": "price_lists",
- "type": "[`PriceList`](PriceList.mdx)[]",
+ "type": "[PriceList](PriceList.mdx)[]",
"description": "The price lists that are associated with the customer group.",
"optional": false,
"defaultValue": "",
@@ -122,8 +122,8 @@ Associates a discount condition with a customer group
},
{
"name": "discount_condition",
- "type": "[`DiscountCondition`](DiscountCondition.mdx)",
- "description": "Available if the relation `discount_condition` is expanded.",
+ "type": "[DiscountCondition](DiscountCondition.mdx)",
+ "description": "Available if the relation `discount\\_condition` is expanded.",
"optional": true,
"defaultValue": "",
"expandable": false,
@@ -139,8 +139,8 @@ Associates a discount condition with a customer group
},
{
"name": "customer_groups",
- "type": "[`CustomerGroup`](CustomerGroup.mdx)[]",
- "description": "Customer groups associated with this condition if `type` is `customer_groups`.",
+ "type": "[CustomerGroup](CustomerGroup.mdx)[]",
+ "description": "Customer groups associated with this condition if `type` is `customer\\_groups`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -157,7 +157,7 @@ Associates a discount condition with a customer group
},
{
"name": "discount_rule",
- "type": "[`DiscountRule`](DiscountRule.mdx)",
+ "type": "[DiscountRule](DiscountRule.mdx)",
"description": "The details of the discount rule associated with the condition.",
"optional": false,
"defaultValue": "",
@@ -184,7 +184,7 @@ Associates a discount condition with a customer group
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -193,8 +193,8 @@ Associates a discount condition with a customer group
},
{
"name": "operator",
- "type": "[`DiscountConditionOperator`](../enums/DiscountConditionOperator.mdx)",
- "description": "The operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that discountable resources are everything but the specified resources.",
+ "type": "[DiscountConditionOperator](../enums/DiscountConditionOperator.mdx)",
+ "description": "The operator of the condition. `in` indicates that discountable resources are within the specified resources. `not\\_in` indicates that discountable resources are everything but the specified resources.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -202,8 +202,8 @@ Associates a discount condition with a customer group
},
{
"name": "product_collections",
- "type": "[`ProductCollection`](ProductCollection.mdx)[]",
- "description": "Product collections associated with this condition if `type` is `product_collections`.",
+ "type": "[ProductCollection](ProductCollection.mdx)[]",
+ "description": "Product collections associated with this condition if `type` is `product\\_collections`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -211,8 +211,8 @@ Associates a discount condition with a customer group
},
{
"name": "product_tags",
- "type": "[`ProductTag`](ProductTag.mdx)[]",
- "description": "Product tags associated with this condition if `type` is `product_tags`.",
+ "type": "[ProductTag](ProductTag.mdx)[]",
+ "description": "Product tags associated with this condition if `type` is `product\\_tags`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -220,8 +220,8 @@ Associates a discount condition with a customer group
},
{
"name": "product_types",
- "type": "[`ProductType`](ProductType.mdx)[]",
- "description": "Product types associated with this condition if `type` is `product_types`.",
+ "type": "[ProductType](ProductType.mdx)[]",
+ "description": "Product types associated with this condition if `type` is `product\\_types`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -229,7 +229,7 @@ Associates a discount condition with a customer group
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "products associated with this condition if `type` is `products`.",
"optional": false,
"defaultValue": "",
@@ -238,7 +238,7 @@ Associates a discount condition with a customer group
},
{
"name": "type",
- "type": "[`DiscountConditionType`](../enums/DiscountConditionType.mdx)",
+ "type": "[DiscountConditionType](../enums/DiscountConditionType.mdx)",
"description": "The type of the condition. The type affects the available resources associated with the condition. For example, if the type is `products`, that means the `products` relation will hold the products associated with this condition and other relations will be empty.",
"optional": false,
"defaultValue": "",
@@ -258,7 +258,7 @@ Associates a discount condition with a customer group
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/DiscountConditionProduct.mdx b/www/apps/docs/content/references/entities/classes/DiscountConditionProduct.mdx
index 19f64e32ec..b6107f921e 100644
--- a/www/apps/docs/content/references/entities/classes/DiscountConditionProduct.mdx
+++ b/www/apps/docs/content/references/entities/classes/DiscountConditionProduct.mdx
@@ -31,7 +31,7 @@ This represents the association between a discount condition and a product
},
{
"name": "discount_condition",
- "type": "[`DiscountCondition`](DiscountCondition.mdx)",
+ "type": "[DiscountCondition](DiscountCondition.mdx)",
"description": "The details of the discount condition.",
"optional": true,
"defaultValue": "",
@@ -48,8 +48,8 @@ This represents the association between a discount condition and a product
},
{
"name": "customer_groups",
- "type": "[`CustomerGroup`](CustomerGroup.mdx)[]",
- "description": "Customer groups associated with this condition if `type` is `customer_groups`.",
+ "type": "[CustomerGroup](CustomerGroup.mdx)[]",
+ "description": "Customer groups associated with this condition if `type` is `customer\\_groups`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -66,7 +66,7 @@ This represents the association between a discount condition and a product
},
{
"name": "discount_rule",
- "type": "[`DiscountRule`](DiscountRule.mdx)",
+ "type": "[DiscountRule](DiscountRule.mdx)",
"description": "The details of the discount rule associated with the condition.",
"optional": false,
"defaultValue": "",
@@ -93,7 +93,7 @@ This represents the association between a discount condition and a product
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -102,8 +102,8 @@ This represents the association between a discount condition and a product
},
{
"name": "operator",
- "type": "[`DiscountConditionOperator`](../enums/DiscountConditionOperator.mdx)",
- "description": "The operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that discountable resources are everything but the specified resources.",
+ "type": "[DiscountConditionOperator](../enums/DiscountConditionOperator.mdx)",
+ "description": "The operator of the condition. `in` indicates that discountable resources are within the specified resources. `not\\_in` indicates that discountable resources are everything but the specified resources.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -111,8 +111,8 @@ This represents the association between a discount condition and a product
},
{
"name": "product_collections",
- "type": "[`ProductCollection`](ProductCollection.mdx)[]",
- "description": "Product collections associated with this condition if `type` is `product_collections`.",
+ "type": "[ProductCollection](ProductCollection.mdx)[]",
+ "description": "Product collections associated with this condition if `type` is `product\\_collections`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -120,8 +120,8 @@ This represents the association between a discount condition and a product
},
{
"name": "product_tags",
- "type": "[`ProductTag`](ProductTag.mdx)[]",
- "description": "Product tags associated with this condition if `type` is `product_tags`.",
+ "type": "[ProductTag](ProductTag.mdx)[]",
+ "description": "Product tags associated with this condition if `type` is `product\\_tags`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -129,8 +129,8 @@ This represents the association between a discount condition and a product
},
{
"name": "product_types",
- "type": "[`ProductType`](ProductType.mdx)[]",
- "description": "Product types associated with this condition if `type` is `product_types`.",
+ "type": "[ProductType](ProductType.mdx)[]",
+ "description": "Product types associated with this condition if `type` is `product\\_types`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -138,7 +138,7 @@ This represents the association between a discount condition and a product
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "products associated with this condition if `type` is `products`.",
"optional": false,
"defaultValue": "",
@@ -147,7 +147,7 @@ This represents the association between a discount condition and a product
},
{
"name": "type",
- "type": "[`DiscountConditionType`](../enums/DiscountConditionType.mdx)",
+ "type": "[DiscountConditionType](../enums/DiscountConditionType.mdx)",
"description": "The type of the condition. The type affects the available resources associated with the condition. For example, if the type is `products`, that means the `products` relation will hold the products associated with this condition and other relations will be empty.",
"optional": false,
"defaultValue": "",
@@ -167,7 +167,7 @@ This represents the association between a discount condition and a product
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -176,7 +176,7 @@ This represents the association between a discount condition and a product
},
{
"name": "product",
- "type": "[`Product`](Product.mdx)",
+ "type": "[Product](Product.mdx)",
"description": "The details of the product.",
"optional": true,
"defaultValue": "",
@@ -184,7 +184,7 @@ This represents the association between a discount condition and a product
"children": [
{
"name": "categories",
- "type": "[`ProductCategory`](ProductCategory.mdx)[]",
+ "type": "[ProductCategory](ProductCategory.mdx)[]",
"description": "The details of the product categories that this product belongs to.",
"optional": false,
"defaultValue": "",
@@ -194,7 +194,7 @@ This represents the association between a discount condition and a product
},
{
"name": "collection",
- "type": "[`ProductCollection`](ProductCollection.mdx)",
+ "type": "[ProductCollection](ProductCollection.mdx)",
"description": "The details of the product collection that the product belongs to.",
"optional": false,
"defaultValue": "",
@@ -293,7 +293,7 @@ This represents the association between a discount condition and a product
},
{
"name": "images",
- "type": "[`Image`](Image.mdx)[]",
+ "type": "[Image](Image.mdx)[]",
"description": "The details of the product's images.",
"optional": false,
"defaultValue": "",
@@ -329,7 +329,7 @@ This represents the association between a discount condition and a product
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -347,7 +347,7 @@ This represents the association between a discount condition and a product
},
{
"name": "options",
- "type": "[`ProductOption`](ProductOption.mdx)[]",
+ "type": "[ProductOption](ProductOption.mdx)[]",
"description": "The details of the Product Options that are defined for the Product. The product's variants will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
@@ -365,7 +365,7 @@ This represents the association between a discount condition and a product
},
{
"name": "profile",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)",
+ "type": "[ShippingProfile](ShippingProfile.mdx)",
"description": "The details of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
"optional": false,
"defaultValue": "",
@@ -383,7 +383,7 @@ This represents the association between a discount condition and a product
},
{
"name": "profiles",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)[]",
+ "type": "[ShippingProfile](ShippingProfile.mdx)[]",
"description": "Available if the relation `profiles` is expanded.",
"optional": false,
"defaultValue": "",
@@ -392,7 +392,7 @@ This represents the association between a discount condition and a product
},
{
"name": "sales_channels",
- "type": "[`SalesChannel`](SalesChannel.mdx)[]",
+ "type": "[SalesChannel](SalesChannel.mdx)[]",
"description": "The details of the sales channels this product is available in.",
"optional": false,
"defaultValue": "",
@@ -401,7 +401,7 @@ This represents the association between a discount condition and a product
},
{
"name": "status",
- "type": "[`ProductStatus`](../enums/ProductStatus.mdx)",
+ "type": "[ProductStatus](../enums/ProductStatus.mdx)",
"description": "The status of the product",
"optional": false,
"defaultValue": "draft",
@@ -419,7 +419,7 @@ This represents the association between a discount condition and a product
},
{
"name": "tags",
- "type": "[`ProductTag`](ProductTag.mdx)[]",
+ "type": "[ProductTag](ProductTag.mdx)[]",
"description": "The details of the product tags used in this product.",
"optional": false,
"defaultValue": "",
@@ -446,7 +446,7 @@ This represents the association between a discount condition and a product
},
{
"name": "type",
- "type": "[`ProductType`](ProductType.mdx)",
+ "type": "[ProductType](ProductType.mdx)",
"description": "The details of the product type that the product belongs to.",
"optional": false,
"defaultValue": "",
@@ -473,7 +473,7 @@ This represents the association between a discount condition and a product
},
{
"name": "variants",
- "type": "[`ProductVariant`](ProductVariant.mdx)[]",
+ "type": "[ProductVariant](ProductVariant.mdx)[]",
"description": "The details of the Product Variants that belong to the Product. Each will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/DiscountConditionProductCollection.mdx b/www/apps/docs/content/references/entities/classes/DiscountConditionProductCollection.mdx
index 33d143c8a4..ed6ac0f3f5 100644
--- a/www/apps/docs/content/references/entities/classes/DiscountConditionProductCollection.mdx
+++ b/www/apps/docs/content/references/entities/classes/DiscountConditionProductCollection.mdx
@@ -31,7 +31,7 @@ This represents the association between a discount condition and a product colle
},
{
"name": "discount_condition",
- "type": "[`DiscountCondition`](DiscountCondition.mdx)",
+ "type": "[DiscountCondition](DiscountCondition.mdx)",
"description": "The details of the discount condition.",
"optional": true,
"defaultValue": "",
@@ -48,8 +48,8 @@ This represents the association between a discount condition and a product colle
},
{
"name": "customer_groups",
- "type": "[`CustomerGroup`](CustomerGroup.mdx)[]",
- "description": "Customer groups associated with this condition if `type` is `customer_groups`.",
+ "type": "[CustomerGroup](CustomerGroup.mdx)[]",
+ "description": "Customer groups associated with this condition if `type` is `customer\\_groups`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -66,7 +66,7 @@ This represents the association between a discount condition and a product colle
},
{
"name": "discount_rule",
- "type": "[`DiscountRule`](DiscountRule.mdx)",
+ "type": "[DiscountRule](DiscountRule.mdx)",
"description": "The details of the discount rule associated with the condition.",
"optional": false,
"defaultValue": "",
@@ -93,7 +93,7 @@ This represents the association between a discount condition and a product colle
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -102,8 +102,8 @@ This represents the association between a discount condition and a product colle
},
{
"name": "operator",
- "type": "[`DiscountConditionOperator`](../enums/DiscountConditionOperator.mdx)",
- "description": "The operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that discountable resources are everything but the specified resources.",
+ "type": "[DiscountConditionOperator](../enums/DiscountConditionOperator.mdx)",
+ "description": "The operator of the condition. `in` indicates that discountable resources are within the specified resources. `not\\_in` indicates that discountable resources are everything but the specified resources.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -111,8 +111,8 @@ This represents the association between a discount condition and a product colle
},
{
"name": "product_collections",
- "type": "[`ProductCollection`](ProductCollection.mdx)[]",
- "description": "Product collections associated with this condition if `type` is `product_collections`.",
+ "type": "[ProductCollection](ProductCollection.mdx)[]",
+ "description": "Product collections associated with this condition if `type` is `product\\_collections`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -120,8 +120,8 @@ This represents the association between a discount condition and a product colle
},
{
"name": "product_tags",
- "type": "[`ProductTag`](ProductTag.mdx)[]",
- "description": "Product tags associated with this condition if `type` is `product_tags`.",
+ "type": "[ProductTag](ProductTag.mdx)[]",
+ "description": "Product tags associated with this condition if `type` is `product\\_tags`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -129,8 +129,8 @@ This represents the association between a discount condition and a product colle
},
{
"name": "product_types",
- "type": "[`ProductType`](ProductType.mdx)[]",
- "description": "Product types associated with this condition if `type` is `product_types`.",
+ "type": "[ProductType](ProductType.mdx)[]",
+ "description": "Product types associated with this condition if `type` is `product\\_types`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -138,7 +138,7 @@ This represents the association between a discount condition and a product colle
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "products associated with this condition if `type` is `products`.",
"optional": false,
"defaultValue": "",
@@ -147,7 +147,7 @@ This represents the association between a discount condition and a product colle
},
{
"name": "type",
- "type": "[`DiscountConditionType`](../enums/DiscountConditionType.mdx)",
+ "type": "[DiscountConditionType](../enums/DiscountConditionType.mdx)",
"description": "The type of the condition. The type affects the available resources associated with the condition. For example, if the type is `products`, that means the `products` relation will hold the products associated with this condition and other relations will be empty.",
"optional": false,
"defaultValue": "",
@@ -167,7 +167,7 @@ This represents the association between a discount condition and a product colle
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -176,7 +176,7 @@ This represents the association between a discount condition and a product colle
},
{
"name": "product_collection",
- "type": "[`ProductCollection`](ProductCollection.mdx)",
+ "type": "[ProductCollection](ProductCollection.mdx)",
"description": "The details of the product collection.",
"optional": true,
"defaultValue": "",
@@ -220,7 +220,7 @@ This represents the association between a discount condition and a product colle
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -229,7 +229,7 @@ This represents the association between a discount condition and a product colle
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "The details of the products that belong to this product collection.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/DiscountConditionProductTag.mdx b/www/apps/docs/content/references/entities/classes/DiscountConditionProductTag.mdx
index 5bf6d9b2b7..6534b84057 100644
--- a/www/apps/docs/content/references/entities/classes/DiscountConditionProductTag.mdx
+++ b/www/apps/docs/content/references/entities/classes/DiscountConditionProductTag.mdx
@@ -31,7 +31,7 @@ This represents the association between a discount condition and a product tag
},
{
"name": "discount_condition",
- "type": "[`DiscountCondition`](DiscountCondition.mdx)",
+ "type": "[DiscountCondition](DiscountCondition.mdx)",
"description": "The details of the discount condition.",
"optional": true,
"defaultValue": "",
@@ -48,8 +48,8 @@ This represents the association between a discount condition and a product tag
},
{
"name": "customer_groups",
- "type": "[`CustomerGroup`](CustomerGroup.mdx)[]",
- "description": "Customer groups associated with this condition if `type` is `customer_groups`.",
+ "type": "[CustomerGroup](CustomerGroup.mdx)[]",
+ "description": "Customer groups associated with this condition if `type` is `customer\\_groups`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -66,7 +66,7 @@ This represents the association between a discount condition and a product tag
},
{
"name": "discount_rule",
- "type": "[`DiscountRule`](DiscountRule.mdx)",
+ "type": "[DiscountRule](DiscountRule.mdx)",
"description": "The details of the discount rule associated with the condition.",
"optional": false,
"defaultValue": "",
@@ -93,7 +93,7 @@ This represents the association between a discount condition and a product tag
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -102,8 +102,8 @@ This represents the association between a discount condition and a product tag
},
{
"name": "operator",
- "type": "[`DiscountConditionOperator`](../enums/DiscountConditionOperator.mdx)",
- "description": "The operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that discountable resources are everything but the specified resources.",
+ "type": "[DiscountConditionOperator](../enums/DiscountConditionOperator.mdx)",
+ "description": "The operator of the condition. `in` indicates that discountable resources are within the specified resources. `not\\_in` indicates that discountable resources are everything but the specified resources.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -111,8 +111,8 @@ This represents the association between a discount condition and a product tag
},
{
"name": "product_collections",
- "type": "[`ProductCollection`](ProductCollection.mdx)[]",
- "description": "Product collections associated with this condition if `type` is `product_collections`.",
+ "type": "[ProductCollection](ProductCollection.mdx)[]",
+ "description": "Product collections associated with this condition if `type` is `product\\_collections`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -120,8 +120,8 @@ This represents the association between a discount condition and a product tag
},
{
"name": "product_tags",
- "type": "[`ProductTag`](ProductTag.mdx)[]",
- "description": "Product tags associated with this condition if `type` is `product_tags`.",
+ "type": "[ProductTag](ProductTag.mdx)[]",
+ "description": "Product tags associated with this condition if `type` is `product\\_tags`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -129,8 +129,8 @@ This represents the association between a discount condition and a product tag
},
{
"name": "product_types",
- "type": "[`ProductType`](ProductType.mdx)[]",
- "description": "Product types associated with this condition if `type` is `product_types`.",
+ "type": "[ProductType](ProductType.mdx)[]",
+ "description": "Product types associated with this condition if `type` is `product\\_types`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -138,7 +138,7 @@ This represents the association between a discount condition and a product tag
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "products associated with this condition if `type` is `products`.",
"optional": false,
"defaultValue": "",
@@ -147,7 +147,7 @@ This represents the association between a discount condition and a product tag
},
{
"name": "type",
- "type": "[`DiscountConditionType`](../enums/DiscountConditionType.mdx)",
+ "type": "[DiscountConditionType](../enums/DiscountConditionType.mdx)",
"description": "The type of the condition. The type affects the available resources associated with the condition. For example, if the type is `products`, that means the `products` relation will hold the products associated with this condition and other relations will be empty.",
"optional": false,
"defaultValue": "",
@@ -167,7 +167,7 @@ This represents the association between a discount condition and a product tag
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -176,7 +176,7 @@ This represents the association between a discount condition and a product tag
},
{
"name": "product_tag",
- "type": "[`ProductTag`](ProductTag.mdx)",
+ "type": "[ProductTag](ProductTag.mdx)",
"description": "The details of the product tag.",
"optional": true,
"defaultValue": "",
@@ -211,7 +211,7 @@ This represents the association between a discount condition and a product tag
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/DiscountConditionProductType.mdx b/www/apps/docs/content/references/entities/classes/DiscountConditionProductType.mdx
index a44ded9096..e6309294a9 100644
--- a/www/apps/docs/content/references/entities/classes/DiscountConditionProductType.mdx
+++ b/www/apps/docs/content/references/entities/classes/DiscountConditionProductType.mdx
@@ -31,7 +31,7 @@ This represents the association between a discount condition and a product type
},
{
"name": "discount_condition",
- "type": "[`DiscountCondition`](DiscountCondition.mdx)",
+ "type": "[DiscountCondition](DiscountCondition.mdx)",
"description": "The details of the discount condition.",
"optional": true,
"defaultValue": "",
@@ -48,8 +48,8 @@ This represents the association between a discount condition and a product type
},
{
"name": "customer_groups",
- "type": "[`CustomerGroup`](CustomerGroup.mdx)[]",
- "description": "Customer groups associated with this condition if `type` is `customer_groups`.",
+ "type": "[CustomerGroup](CustomerGroup.mdx)[]",
+ "description": "Customer groups associated with this condition if `type` is `customer\\_groups`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -66,7 +66,7 @@ This represents the association between a discount condition and a product type
},
{
"name": "discount_rule",
- "type": "[`DiscountRule`](DiscountRule.mdx)",
+ "type": "[DiscountRule](DiscountRule.mdx)",
"description": "The details of the discount rule associated with the condition.",
"optional": false,
"defaultValue": "",
@@ -93,7 +93,7 @@ This represents the association between a discount condition and a product type
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -102,8 +102,8 @@ This represents the association between a discount condition and a product type
},
{
"name": "operator",
- "type": "[`DiscountConditionOperator`](../enums/DiscountConditionOperator.mdx)",
- "description": "The operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that discountable resources are everything but the specified resources.",
+ "type": "[DiscountConditionOperator](../enums/DiscountConditionOperator.mdx)",
+ "description": "The operator of the condition. `in` indicates that discountable resources are within the specified resources. `not\\_in` indicates that discountable resources are everything but the specified resources.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -111,8 +111,8 @@ This represents the association between a discount condition and a product type
},
{
"name": "product_collections",
- "type": "[`ProductCollection`](ProductCollection.mdx)[]",
- "description": "Product collections associated with this condition if `type` is `product_collections`.",
+ "type": "[ProductCollection](ProductCollection.mdx)[]",
+ "description": "Product collections associated with this condition if `type` is `product\\_collections`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -120,8 +120,8 @@ This represents the association between a discount condition and a product type
},
{
"name": "product_tags",
- "type": "[`ProductTag`](ProductTag.mdx)[]",
- "description": "Product tags associated with this condition if `type` is `product_tags`.",
+ "type": "[ProductTag](ProductTag.mdx)[]",
+ "description": "Product tags associated with this condition if `type` is `product\\_tags`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -129,8 +129,8 @@ This represents the association between a discount condition and a product type
},
{
"name": "product_types",
- "type": "[`ProductType`](ProductType.mdx)[]",
- "description": "Product types associated with this condition if `type` is `product_types`.",
+ "type": "[ProductType](ProductType.mdx)[]",
+ "description": "Product types associated with this condition if `type` is `product\\_types`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -138,7 +138,7 @@ This represents the association between a discount condition and a product type
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "products associated with this condition if `type` is `products`.",
"optional": false,
"defaultValue": "",
@@ -147,7 +147,7 @@ This represents the association between a discount condition and a product type
},
{
"name": "type",
- "type": "[`DiscountConditionType`](../enums/DiscountConditionType.mdx)",
+ "type": "[DiscountConditionType](../enums/DiscountConditionType.mdx)",
"description": "The type of the condition. The type affects the available resources associated with the condition. For example, if the type is `products`, that means the `products` relation will hold the products associated with this condition and other relations will be empty.",
"optional": false,
"defaultValue": "",
@@ -167,7 +167,7 @@ This represents the association between a discount condition and a product type
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -176,7 +176,7 @@ This represents the association between a discount condition and a product type
},
{
"name": "product_type",
- "type": "[`ProductType`](ProductType.mdx)",
+ "type": "[ProductType](ProductType.mdx)",
"description": "The details of the product type.",
"optional": true,
"defaultValue": "",
@@ -211,7 +211,7 @@ This represents the association between a discount condition and a product type
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/DiscountRule.mdx b/www/apps/docs/content/references/entities/classes/DiscountRule.mdx
index 63ec989eee..c179fcba7b 100644
--- a/www/apps/docs/content/references/entities/classes/DiscountRule.mdx
+++ b/www/apps/docs/content/references/entities/classes/DiscountRule.mdx
@@ -13,7 +13,7 @@ A discount rule defines how a Discount is calculated when applied to a Cart.
",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -112,8 +112,8 @@ A discount rule defines how a Discount is calculated when applied to a Cart.
},
{
"name": "operator",
- "type": "[`DiscountConditionOperator`](../enums/DiscountConditionOperator.mdx)",
- "description": "The operator of the condition. `in` indicates that discountable resources are within the specified resources. `not_in` indicates that discountable resources are everything but the specified resources.",
+ "type": "[DiscountConditionOperator](../enums/DiscountConditionOperator.mdx)",
+ "description": "The operator of the condition. `in` indicates that discountable resources are within the specified resources. `not\\_in` indicates that discountable resources are everything but the specified resources.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -121,8 +121,8 @@ A discount rule defines how a Discount is calculated when applied to a Cart.
},
{
"name": "product_collections",
- "type": "[`ProductCollection`](ProductCollection.mdx)[]",
- "description": "Product collections associated with this condition if `type` is `product_collections`.",
+ "type": "[ProductCollection](ProductCollection.mdx)[]",
+ "description": "Product collections associated with this condition if `type` is `product\\_collections`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -130,8 +130,8 @@ A discount rule defines how a Discount is calculated when applied to a Cart.
},
{
"name": "product_tags",
- "type": "[`ProductTag`](ProductTag.mdx)[]",
- "description": "Product tags associated with this condition if `type` is `product_tags`.",
+ "type": "[ProductTag](ProductTag.mdx)[]",
+ "description": "Product tags associated with this condition if `type` is `product\\_tags`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -139,8 +139,8 @@ A discount rule defines how a Discount is calculated when applied to a Cart.
},
{
"name": "product_types",
- "type": "[`ProductType`](ProductType.mdx)[]",
- "description": "Product types associated with this condition if `type` is `product_types`.",
+ "type": "[ProductType](ProductType.mdx)[]",
+ "description": "Product types associated with this condition if `type` is `product\\_types`.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -148,7 +148,7 @@ A discount rule defines how a Discount is calculated when applied to a Cart.
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "products associated with this condition if `type` is `products`.",
"optional": false,
"defaultValue": "",
@@ -157,7 +157,7 @@ A discount rule defines how a Discount is calculated when applied to a Cart.
},
{
"name": "type",
- "type": "[`DiscountConditionType`](../enums/DiscountConditionType.mdx)",
+ "type": "[DiscountConditionType](../enums/DiscountConditionType.mdx)",
"description": "The type of the condition. The type affects the available resources associated with the condition. For example, if the type is `products`, that means the `products` relation will hold the products associated with this condition and other relations will be empty.",
"optional": false,
"defaultValue": "",
@@ -213,7 +213,7 @@ A discount rule defines how a Discount is calculated when applied to a Cart.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -222,8 +222,8 @@ A discount rule defines how a Discount is calculated when applied to a Cart.
},
{
"name": "type",
- "type": "[`DiscountRuleType`](../enums/DiscountRuleType.mdx)",
- "description": "The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers.",
+ "type": "[DiscountRuleType](../enums/DiscountRuleType.mdx)",
+ "description": "The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free\\_shipping` for shipping vouchers.",
"optional": false,
"defaultValue": "",
"expandable": false,
diff --git a/www/apps/docs/content/references/entities/classes/DraftOrder.mdx b/www/apps/docs/content/references/entities/classes/DraftOrder.mdx
index 87554dedc7..b43170d7dd 100644
--- a/www/apps/docs/content/references/entities/classes/DraftOrder.mdx
+++ b/www/apps/docs/content/references/entities/classes/DraftOrder.mdx
@@ -22,7 +22,7 @@ A draft order is created by an admin without direct involvement of the customer.
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart associated with the draft order.",
"optional": false,
"defaultValue": "",
@@ -85,7 +85,7 @@ A draft order is created by an admin without direct involvement of the customer.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -103,7 +103,7 @@ A draft order is created by an admin without direct involvement of the customer.
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order created from the draft order when its payment is captured.",
"optional": false,
"defaultValue": "",
@@ -121,7 +121,7 @@ A draft order is created by an admin without direct involvement of the customer.
},
{
"name": "status",
- "type": "[`DraftOrderStatus`](../enums/DraftOrderStatus.mdx)",
+ "type": "[DraftOrderStatus](../enums/DraftOrderStatus.mdx)",
"description": "The status of the draft order. It's changed to `completed` when it's transformed to an order.",
"optional": false,
"defaultValue": "open",
diff --git a/www/apps/docs/content/references/entities/classes/Fulfillment.mdx b/www/apps/docs/content/references/entities/classes/Fulfillment.mdx
index d244c64c44..18ebba490b 100644
--- a/www/apps/docs/content/references/entities/classes/Fulfillment.mdx
+++ b/www/apps/docs/content/references/entities/classes/Fulfillment.mdx
@@ -22,7 +22,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "claim_order",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)",
+ "type": "[ClaimOrder](ClaimOrder.mdx)",
"description": "The details of the claim that the fulfillment may belong to.",
"optional": false,
"defaultValue": "",
@@ -30,7 +30,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
"children": [
{
"name": "additional_items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the new items to be shipped when the claim's type is `replace`",
"optional": false,
"defaultValue": "",
@@ -48,7 +48,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "claim_items",
- "type": "[`ClaimItem`](ClaimItem.mdx)[]",
+ "type": "[ClaimItem](ClaimItem.mdx)[]",
"description": "The details of the items that should be replaced or refunded.",
"optional": false,
"defaultValue": "",
@@ -75,7 +75,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "fulfillment_status",
- "type": "[`ClaimFulfillmentStatus`](../enums/ClaimFulfillmentStatus.mdx)",
+ "type": "[ClaimFulfillmentStatus](../enums/ClaimFulfillmentStatus.mdx)",
"description": "The claim's fulfillment status",
"optional": false,
"defaultValue": "not_fulfilled",
@@ -84,7 +84,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "fulfillments",
- "type": "[`Fulfillment`](Fulfillment.mdx)[]",
+ "type": "[Fulfillment](Fulfillment.mdx)[]",
"description": "The fulfillments of the new items to be shipped",
"optional": false,
"defaultValue": "",
@@ -111,7 +111,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -129,7 +129,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that this claim was created for.",
"optional": false,
"defaultValue": "",
@@ -147,7 +147,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "payment_status",
- "type": "[`ClaimPaymentStatus`](../enums/ClaimPaymentStatus.mdx)",
+ "type": "[ClaimPaymentStatus](../enums/ClaimPaymentStatus.mdx)",
"description": "The status of the claim's payment",
"optional": false,
"defaultValue": "na",
@@ -165,7 +165,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "return_order",
- "type": "[`Return`](Return.mdx)",
+ "type": "[Return](Return.mdx)",
"description": "The details of the return associated with the claim if the claim's type is `replace`.",
"optional": false,
"defaultValue": "",
@@ -174,7 +174,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the address that new items should be shipped to.",
"optional": false,
"defaultValue": "",
@@ -192,7 +192,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods that the claim order will be shipped with.",
"optional": false,
"defaultValue": "",
@@ -201,7 +201,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "type",
- "type": "[`ClaimType`](../enums/ClaimType.mdx)",
+ "type": "[ClaimType](../enums/ClaimType.mdx)",
"description": "The claim's type",
"optional": false,
"defaultValue": "",
@@ -239,7 +239,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "This contains all the data necessary for the Fulfillment provider to handle the fulfillment.",
"optional": false,
"defaultValue": "",
@@ -266,7 +266,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "items",
- "type": "[`FulfillmentItem`](FulfillmentItem.mdx)[]",
+ "type": "[FulfillmentItem](FulfillmentItem.mdx)[]",
"description": "The Fulfillment Items in the Fulfillment. These hold information about how many of each Line Item has been fulfilled.",
"optional": false,
"defaultValue": "",
@@ -274,7 +274,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
"children": [
{
"name": "fulfillment",
- "type": "[`Fulfillment`](Fulfillment.mdx)",
+ "type": "[Fulfillment](Fulfillment.mdx)",
"description": "The details of the fulfillment.",
"optional": false,
"defaultValue": "",
@@ -292,7 +292,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "item",
- "type": "[`LineItem`](LineItem.mdx)",
+ "type": "[LineItem](LineItem.mdx)",
"description": "The details of the line item.",
"optional": false,
"defaultValue": "",
@@ -330,7 +330,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -348,7 +348,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the fulfillment may belong to.",
"optional": false,
"defaultValue": "",
@@ -356,7 +356,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
"children": [
{
"name": "billing_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the billing address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -383,7 +383,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart associated with the order.",
"optional": false,
"defaultValue": "",
@@ -401,7 +401,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "claims",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)[]",
+ "type": "[ClaimOrder](ClaimOrder.mdx)[]",
"description": "The details of the claims created for the order.",
"optional": false,
"defaultValue": "",
@@ -419,7 +419,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency used in the order.",
"optional": false,
"defaultValue": "",
@@ -437,7 +437,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "customer",
- "type": "[`Customer`](Customer.mdx)",
+ "type": "[Customer](Customer.mdx)",
"description": "The details of the customer associated with the order.",
"optional": false,
"defaultValue": "",
@@ -464,7 +464,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "discounts",
- "type": "[`Discount`](Discount.mdx)[]",
+ "type": "[Discount](Discount.mdx)[]",
"description": "The details of the discounts applied on the order.",
"optional": false,
"defaultValue": "",
@@ -482,7 +482,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "draft_order",
- "type": "[`DraftOrder`](DraftOrder.mdx)",
+ "type": "[DraftOrder](DraftOrder.mdx)",
"description": "The details of the draft order this order was created from.",
"optional": false,
"defaultValue": "",
@@ -500,7 +500,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "edits",
- "type": "[`OrderEdit`](OrderEdit.mdx)[]",
+ "type": "[OrderEdit](OrderEdit.mdx)[]",
"description": "The details of the order edits done on the order.",
"optional": false,
"defaultValue": "",
@@ -527,7 +527,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "fulfillment_status",
- "type": "[`FulfillmentStatus`](../enums/FulfillmentStatus.mdx)",
+ "type": "[FulfillmentStatus](../enums/FulfillmentStatus.mdx)",
"description": "The order's fulfillment status",
"optional": false,
"defaultValue": "not_fulfilled",
@@ -536,7 +536,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "fulfillments",
- "type": "[`Fulfillment`](Fulfillment.mdx)[]",
+ "type": "[Fulfillment](Fulfillment.mdx)[]",
"description": "The details of the fulfillments created for the order.",
"optional": false,
"defaultValue": "",
@@ -563,7 +563,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "gift_card_transactions",
- "type": "[`GiftCardTransaction`](GiftCardTransaction.mdx)[]",
+ "type": "[GiftCardTransaction](GiftCardTransaction.mdx)[]",
"description": "The gift card transactions made in the order.",
"optional": false,
"defaultValue": "",
@@ -572,7 +572,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "gift_cards",
- "type": "[`GiftCard`](GiftCard.mdx)[]",
+ "type": "[GiftCard](GiftCard.mdx)[]",
"description": "The details of the gift card used in the order.",
"optional": false,
"defaultValue": "",
@@ -608,7 +608,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that belong to the order.",
"optional": false,
"defaultValue": "",
@@ -617,7 +617,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -653,7 +653,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "payment_status",
- "type": "[`PaymentStatus`](../enums/PaymentStatus.mdx)",
+ "type": "[PaymentStatus](../enums/PaymentStatus.mdx)",
"description": "The order's payment status",
"optional": false,
"defaultValue": "not_paid",
@@ -662,7 +662,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "payments",
- "type": "[`Payment`](Payment.mdx)[]",
+ "type": "[Payment](Payment.mdx)[]",
"description": "The details of the payments used in the order.",
"optional": false,
"defaultValue": "",
@@ -698,7 +698,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "refunds",
- "type": "[`Refund`](Refund.mdx)[]",
+ "type": "[Refund](Refund.mdx)[]",
"description": "The details of the refunds created for the order.",
"optional": false,
"defaultValue": "",
@@ -707,7 +707,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this order was created in.",
"optional": false,
"defaultValue": "",
@@ -725,7 +725,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "returnable_items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
"optional": true,
"defaultValue": "",
@@ -734,7 +734,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "returns",
- "type": "[`Return`](Return.mdx)[]",
+ "type": "[Return](Return.mdx)[]",
"description": "The details of the returns created for the order.",
"optional": false,
"defaultValue": "",
@@ -743,7 +743,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "sales_channel",
- "type": "[`SalesChannel`](SalesChannel.mdx)",
+ "type": "[SalesChannel](SalesChannel.mdx)",
"description": "The details of the sales channel this order belongs to.",
"optional": false,
"defaultValue": "",
@@ -761,7 +761,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the shipping address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -779,7 +779,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods used in the order.",
"optional": false,
"defaultValue": "",
@@ -806,7 +806,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "status",
- "type": "[`OrderStatus`](../enums/OrderStatus.mdx)",
+ "type": "[OrderStatus](../enums/OrderStatus.mdx)",
"description": "The order's status",
"optional": false,
"defaultValue": "pending",
@@ -824,7 +824,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "swaps",
- "type": "[`Swap`](Swap.mdx)[]",
+ "type": "[Swap](Swap.mdx)[]",
"description": "The details of the swaps created for the order.",
"optional": false,
"defaultValue": "",
@@ -880,7 +880,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "provider",
- "type": "[`FulfillmentProvider`](FulfillmentProvider.mdx)",
+ "type": "[FulfillmentProvider](FulfillmentProvider.mdx)",
"description": "The details of the fulfillment provider responsible for handling the fulfillment.",
"optional": false,
"defaultValue": "",
@@ -898,7 +898,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
{
"name": "is_installed",
"type": "`boolean`",
- "description": "Whether the fulfillment service is installed in the current version. If a fulfillment service is no longer installed, the `is_installed` attribute is set to `false`.",
+ "description": "Whether the fulfillment service is installed in the current version. If a fulfillment service is no longer installed, the `is\\_installed` attribute is set to `false`.",
"optional": false,
"defaultValue": "true",
"expandable": false,
@@ -926,7 +926,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "swap",
- "type": "[`Swap`](Swap.mdx)",
+ "type": "[Swap](Swap.mdx)",
"description": "The details of the swap that the fulfillment may belong to.",
"optional": false,
"defaultValue": "",
@@ -934,7 +934,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
"children": [
{
"name": "additional_items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the new products to send to the customer, represented as line items.",
"optional": false,
"defaultValue": "",
@@ -961,7 +961,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart that the customer uses to complete the swap.",
"optional": false,
"defaultValue": "",
@@ -1015,7 +1015,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "fulfillment_status",
- "type": "[`SwapFulfillmentStatus`](../enums/SwapFulfillmentStatus.mdx)",
+ "type": "[SwapFulfillmentStatus](../enums/SwapFulfillmentStatus.mdx)",
"description": "The status of the Fulfillment of the Swap.",
"optional": false,
"defaultValue": "",
@@ -1024,7 +1024,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "fulfillments",
- "type": "[`Fulfillment`](Fulfillment.mdx)[]",
+ "type": "[Fulfillment](Fulfillment.mdx)[]",
"description": "The details of the fulfillments that are used to send the new items to the customer.",
"optional": false,
"defaultValue": "",
@@ -1051,7 +1051,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -1069,7 +1069,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the swap belongs to.",
"optional": false,
"defaultValue": "",
@@ -1087,8 +1087,8 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "payment",
- "type": "[`Payment`](Payment.mdx)",
- "description": "The details of the additional payment authorized by the customer when `difference_due` is positive.",
+ "type": "[Payment](Payment.mdx)",
+ "description": "The details of the additional payment authorized by the customer when `difference\\_due` is positive.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -1096,7 +1096,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "payment_status",
- "type": "[`SwapPaymentStatus`](../enums/SwapPaymentStatus.mdx)",
+ "type": "[SwapPaymentStatus](../enums/SwapPaymentStatus.mdx)",
"description": "The status of the Payment of the Swap. The payment may either refer to the refund of an amount or the authorization of a new amount.",
"optional": false,
"defaultValue": "",
@@ -1105,7 +1105,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "return_order",
- "type": "[`Return`](Return.mdx)",
+ "type": "[Return](Return.mdx)",
"description": "The details of the return that belongs to the swap, which holds the details on the items being returned.",
"optional": false,
"defaultValue": "",
@@ -1114,7 +1114,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the shipping address that the new items should be sent to.",
"optional": false,
"defaultValue": "",
@@ -1132,7 +1132,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods used to fulfill the additional items purchased.",
"optional": false,
"defaultValue": "",
@@ -1161,7 +1161,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "tracking_links",
- "type": "[`TrackingLink`](TrackingLink.mdx)[]",
+ "type": "[TrackingLink](TrackingLink.mdx)[]",
"description": "The Tracking Links that can be used to track the status of the Fulfillment. These will usually be provided by the Fulfillment Provider.",
"optional": false,
"defaultValue": "",
@@ -1187,7 +1187,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "fulfillment",
- "type": "[`Fulfillment`](Fulfillment.mdx)",
+ "type": "[Fulfillment](Fulfillment.mdx)",
"description": "The details of the fulfillment that the tracking link belongs to.",
"optional": false,
"defaultValue": "",
@@ -1223,7 +1223,7 @@ A Fulfillment is created once an admin can prepare the purchased goods. Fulfillm
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/FulfillmentItem.mdx b/www/apps/docs/content/references/entities/classes/FulfillmentItem.mdx
index 85f2bca2b3..0a06777c66 100644
--- a/www/apps/docs/content/references/entities/classes/FulfillmentItem.mdx
+++ b/www/apps/docs/content/references/entities/classes/FulfillmentItem.mdx
@@ -13,7 +13,7 @@ This represents the association between a Line Item and a Fulfillment.
",
+ "type": "`Record`",
"description": "This contains all the data necessary for the Fulfillment provider to handle the fulfillment.",
"optional": false,
"defaultValue": "",
@@ -84,7 +84,7 @@ This represents the association between a Line Item and a Fulfillment.
},
{
"name": "items",
- "type": "[`FulfillmentItem`](FulfillmentItem.mdx)[]",
+ "type": "[FulfillmentItem](FulfillmentItem.mdx)[]",
"description": "The Fulfillment Items in the Fulfillment. These hold information about how many of each Line Item has been fulfilled.",
"optional": false,
"defaultValue": "",
@@ -102,7 +102,7 @@ This represents the association between a Line Item and a Fulfillment.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -120,7 +120,7 @@ This represents the association between a Line Item and a Fulfillment.
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the fulfillment may belong to.",
"optional": false,
"defaultValue": "",
@@ -138,7 +138,7 @@ This represents the association between a Line Item and a Fulfillment.
},
{
"name": "provider",
- "type": "[`FulfillmentProvider`](FulfillmentProvider.mdx)",
+ "type": "[FulfillmentProvider](FulfillmentProvider.mdx)",
"description": "The details of the fulfillment provider responsible for handling the fulfillment.",
"optional": false,
"defaultValue": "",
@@ -165,7 +165,7 @@ This represents the association between a Line Item and a Fulfillment.
},
{
"name": "swap",
- "type": "[`Swap`](Swap.mdx)",
+ "type": "[Swap](Swap.mdx)",
"description": "The details of the swap that the fulfillment may belong to.",
"optional": false,
"defaultValue": "",
@@ -183,7 +183,7 @@ This represents the association between a Line Item and a Fulfillment.
},
{
"name": "tracking_links",
- "type": "[`TrackingLink`](TrackingLink.mdx)[]",
+ "type": "[TrackingLink](TrackingLink.mdx)[]",
"description": "The Tracking Links that can be used to track the status of the Fulfillment. These will usually be provided by the Fulfillment Provider.",
"optional": false,
"defaultValue": "",
@@ -221,7 +221,7 @@ This represents the association between a Line Item and a Fulfillment.
},
{
"name": "item",
- "type": "[`LineItem`](LineItem.mdx)",
+ "type": "[LineItem](LineItem.mdx)",
"description": "The details of the line item.",
"optional": false,
"defaultValue": "",
@@ -229,7 +229,7 @@ This represents the association between a Line Item and a Fulfillment.
"children": [
{
"name": "adjustments",
- "type": "[`LineItemAdjustment`](LineItemAdjustment.mdx)[]",
+ "type": "[LineItemAdjustment](LineItemAdjustment.mdx)[]",
"description": "The details of the item's adjustments, which are available when a discount is applied on the item.",
"optional": false,
"defaultValue": "",
@@ -247,7 +247,7 @@ This represents the association between a Line Item and a Fulfillment.
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart that the line item may belongs to.",
"optional": false,
"defaultValue": "",
@@ -265,7 +265,7 @@ This represents the association between a Line Item and a Fulfillment.
},
{
"name": "claim_order",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)",
+ "type": "[ClaimOrder](ClaimOrder.mdx)",
"description": "The details of the claim that the line item may belong to.",
"optional": false,
"defaultValue": "",
@@ -347,7 +347,7 @@ This represents the association between a Line Item and a Fulfillment.
{
"name": "includes_tax",
"type": "`boolean`",
- "description": "Indicates if the line item unit_price include tax",
+ "description": "Indicates if the line item unit\\_price include tax",
"optional": false,
"defaultValue": "false",
"expandable": false,
@@ -374,7 +374,7 @@ This represents the association between a Line Item and a Fulfillment.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -383,7 +383,7 @@ This represents the association between a Line Item and a Fulfillment.
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the line item may belongs to.",
"optional": false,
"defaultValue": "",
@@ -392,7 +392,7 @@ This represents the association between a Line Item and a Fulfillment.
},
{
"name": "order_edit",
- "type": "``null`` \\| [`OrderEdit`](OrderEdit.mdx)",
+ "type": "``null`` \\| [OrderEdit](OrderEdit.mdx)",
"description": "The details of the order edit.",
"optional": true,
"defaultValue": "",
@@ -518,7 +518,7 @@ This represents the association between a Line Item and a Fulfillment.
},
{
"name": "swap",
- "type": "[`Swap`](Swap.mdx)",
+ "type": "[Swap](Swap.mdx)",
"description": "The details of the swap that the line item may belong to.",
"optional": false,
"defaultValue": "",
@@ -536,7 +536,7 @@ This represents the association between a Line Item and a Fulfillment.
},
{
"name": "tax_lines",
- "type": "[`LineItemTaxLine`](LineItemTaxLine.mdx)[]",
+ "type": "[LineItemTaxLine](LineItemTaxLine.mdx)[]",
"description": "The details of the item's tax lines.",
"optional": false,
"defaultValue": "",
@@ -599,7 +599,7 @@ This represents the association between a Line Item and a Fulfillment.
},
{
"name": "variant",
- "type": "[`ProductVariant`](ProductVariant.mdx)",
+ "type": "[ProductVariant](ProductVariant.mdx)",
"description": "The details of the product variant that this item was created from.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/FulfillmentProvider.mdx b/www/apps/docs/content/references/entities/classes/FulfillmentProvider.mdx
index c8d8a2baee..55bf7006c9 100644
--- a/www/apps/docs/content/references/entities/classes/FulfillmentProvider.mdx
+++ b/www/apps/docs/content/references/entities/classes/FulfillmentProvider.mdx
@@ -23,7 +23,7 @@ A fulfillment provider represents a fulfillment service installed in the Medusa
{
"name": "is_installed",
"type": "`boolean`",
- "description": "Whether the fulfillment service is installed in the current version. If a fulfillment service is no longer installed, the `is_installed` attribute is set to `false`.",
+ "description": "Whether the fulfillment service is installed in the current version. If a fulfillment service is no longer installed, the `is\\_installed` attribute is set to `false`.",
"optional": false,
"defaultValue": "true",
"expandable": false,
diff --git a/www/apps/docs/content/references/entities/classes/GiftCard.mdx b/www/apps/docs/content/references/entities/classes/GiftCard.mdx
index db48bcb7a6..110f58f62c 100644
--- a/www/apps/docs/content/references/entities/classes/GiftCard.mdx
+++ b/www/apps/docs/content/references/entities/classes/GiftCard.mdx
@@ -76,7 +76,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -85,7 +85,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the gift card was purchased in.",
"optional": false,
"defaultValue": "",
@@ -93,7 +93,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
"children": [
{
"name": "billing_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the billing address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -120,7 +120,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart associated with the order.",
"optional": false,
"defaultValue": "",
@@ -138,7 +138,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "claims",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)[]",
+ "type": "[ClaimOrder](ClaimOrder.mdx)[]",
"description": "The details of the claims created for the order.",
"optional": false,
"defaultValue": "",
@@ -156,7 +156,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency used in the order.",
"optional": false,
"defaultValue": "",
@@ -174,7 +174,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "customer",
- "type": "[`Customer`](Customer.mdx)",
+ "type": "[Customer](Customer.mdx)",
"description": "The details of the customer associated with the order.",
"optional": false,
"defaultValue": "",
@@ -201,7 +201,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "discounts",
- "type": "[`Discount`](Discount.mdx)[]",
+ "type": "[Discount](Discount.mdx)[]",
"description": "The details of the discounts applied on the order.",
"optional": false,
"defaultValue": "",
@@ -219,7 +219,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "draft_order",
- "type": "[`DraftOrder`](DraftOrder.mdx)",
+ "type": "[DraftOrder](DraftOrder.mdx)",
"description": "The details of the draft order this order was created from.",
"optional": false,
"defaultValue": "",
@@ -237,7 +237,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "edits",
- "type": "[`OrderEdit`](OrderEdit.mdx)[]",
+ "type": "[OrderEdit](OrderEdit.mdx)[]",
"description": "The details of the order edits done on the order.",
"optional": false,
"defaultValue": "",
@@ -264,7 +264,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "fulfillment_status",
- "type": "[`FulfillmentStatus`](../enums/FulfillmentStatus.mdx)",
+ "type": "[FulfillmentStatus](../enums/FulfillmentStatus.mdx)",
"description": "The order's fulfillment status",
"optional": false,
"defaultValue": "not_fulfilled",
@@ -273,7 +273,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "fulfillments",
- "type": "[`Fulfillment`](Fulfillment.mdx)[]",
+ "type": "[Fulfillment](Fulfillment.mdx)[]",
"description": "The details of the fulfillments created for the order.",
"optional": false,
"defaultValue": "",
@@ -300,7 +300,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "gift_card_transactions",
- "type": "[`GiftCardTransaction`](GiftCardTransaction.mdx)[]",
+ "type": "[GiftCardTransaction](GiftCardTransaction.mdx)[]",
"description": "The gift card transactions made in the order.",
"optional": false,
"defaultValue": "",
@@ -309,7 +309,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "gift_cards",
- "type": "[`GiftCard`](GiftCard.mdx)[]",
+ "type": "[GiftCard](GiftCard.mdx)[]",
"description": "The details of the gift card used in the order.",
"optional": false,
"defaultValue": "",
@@ -345,7 +345,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that belong to the order.",
"optional": false,
"defaultValue": "",
@@ -354,7 +354,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -390,7 +390,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "payment_status",
- "type": "[`PaymentStatus`](../enums/PaymentStatus.mdx)",
+ "type": "[PaymentStatus](../enums/PaymentStatus.mdx)",
"description": "The order's payment status",
"optional": false,
"defaultValue": "not_paid",
@@ -399,7 +399,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "payments",
- "type": "[`Payment`](Payment.mdx)[]",
+ "type": "[Payment](Payment.mdx)[]",
"description": "The details of the payments used in the order.",
"optional": false,
"defaultValue": "",
@@ -435,7 +435,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "refunds",
- "type": "[`Refund`](Refund.mdx)[]",
+ "type": "[Refund](Refund.mdx)[]",
"description": "The details of the refunds created for the order.",
"optional": false,
"defaultValue": "",
@@ -444,7 +444,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this order was created in.",
"optional": false,
"defaultValue": "",
@@ -462,7 +462,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "returnable_items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
"optional": true,
"defaultValue": "",
@@ -471,7 +471,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "returns",
- "type": "[`Return`](Return.mdx)[]",
+ "type": "[Return](Return.mdx)[]",
"description": "The details of the returns created for the order.",
"optional": false,
"defaultValue": "",
@@ -480,7 +480,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "sales_channel",
- "type": "[`SalesChannel`](SalesChannel.mdx)",
+ "type": "[SalesChannel](SalesChannel.mdx)",
"description": "The details of the sales channel this order belongs to.",
"optional": false,
"defaultValue": "",
@@ -498,7 +498,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the shipping address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -516,7 +516,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods used in the order.",
"optional": false,
"defaultValue": "",
@@ -543,7 +543,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "status",
- "type": "[`OrderStatus`](../enums/OrderStatus.mdx)",
+ "type": "[OrderStatus](../enums/OrderStatus.mdx)",
"description": "The order's status",
"optional": false,
"defaultValue": "pending",
@@ -561,7 +561,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "swaps",
- "type": "[`Swap`](Swap.mdx)[]",
+ "type": "[Swap](Swap.mdx)[]",
"description": "The details of the swaps created for the order.",
"optional": false,
"defaultValue": "",
@@ -617,7 +617,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this gift card is available in.",
"optional": false,
"defaultValue": "",
@@ -634,7 +634,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "countries",
- "type": "[`Country`](Country.mdx)[]",
+ "type": "[Country](Country.mdx)[]",
"description": "The details of the countries included in this region.",
"optional": false,
"defaultValue": "",
@@ -652,7 +652,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency used in the region.",
"optional": false,
"defaultValue": "",
@@ -679,7 +679,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "fulfillment_providers",
- "type": "[`FulfillmentProvider`](FulfillmentProvider.mdx)[]",
+ "type": "[FulfillmentProvider](FulfillmentProvider.mdx)[]",
"description": "The details of the fulfillment providers that can be used to fulfill items of orders and similar resources in the region.",
"optional": false,
"defaultValue": "",
@@ -716,7 +716,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -734,7 +734,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "payment_providers",
- "type": "[`PaymentProvider`](PaymentProvider.mdx)[]",
+ "type": "[PaymentProvider](PaymentProvider.mdx)[]",
"description": "The details of the payment providers that can be used to process payments in the region.",
"optional": false,
"defaultValue": "",
@@ -752,7 +752,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "tax_provider",
- "type": "[`TaxProvider`](TaxProvider.mdx)",
+ "type": "[TaxProvider](TaxProvider.mdx)",
"description": "The details of the tax provider used in the region.",
"optional": false,
"defaultValue": "",
@@ -779,7 +779,7 @@ Gift Cards are redeemable and represent a value that can be used towards the pay
},
{
"name": "tax_rates",
- "type": "``null`` \\| [`TaxRate`](TaxRate.mdx)[]",
+ "type": "``null`` \\| [TaxRate](TaxRate.mdx)[]",
"description": "The details of the tax rates used in the region, aside from the default rate.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/GiftCardTransaction.mdx b/www/apps/docs/content/references/entities/classes/GiftCardTransaction.mdx
index 7e82ae4aaf..1736183ede 100644
--- a/www/apps/docs/content/references/entities/classes/GiftCardTransaction.mdx
+++ b/www/apps/docs/content/references/entities/classes/GiftCardTransaction.mdx
@@ -31,7 +31,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "gift_card",
- "type": "[`GiftCard`](GiftCard.mdx)",
+ "type": "[GiftCard](GiftCard.mdx)",
"description": "The details of the gift card associated used in this transaction.",
"optional": false,
"defaultValue": "",
@@ -102,7 +102,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -111,7 +111,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the gift card was purchased in.",
"optional": false,
"defaultValue": "",
@@ -129,7 +129,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this gift card is available in.",
"optional": false,
"defaultValue": "",
@@ -203,7 +203,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the gift card was used for payment.",
"optional": false,
"defaultValue": "",
@@ -211,7 +211,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
"children": [
{
"name": "billing_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the billing address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -238,7 +238,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart associated with the order.",
"optional": false,
"defaultValue": "",
@@ -256,7 +256,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "claims",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)[]",
+ "type": "[ClaimOrder](ClaimOrder.mdx)[]",
"description": "The details of the claims created for the order.",
"optional": false,
"defaultValue": "",
@@ -274,7 +274,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency used in the order.",
"optional": false,
"defaultValue": "",
@@ -292,7 +292,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "customer",
- "type": "[`Customer`](Customer.mdx)",
+ "type": "[Customer](Customer.mdx)",
"description": "The details of the customer associated with the order.",
"optional": false,
"defaultValue": "",
@@ -319,7 +319,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "discounts",
- "type": "[`Discount`](Discount.mdx)[]",
+ "type": "[Discount](Discount.mdx)[]",
"description": "The details of the discounts applied on the order.",
"optional": false,
"defaultValue": "",
@@ -337,7 +337,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "draft_order",
- "type": "[`DraftOrder`](DraftOrder.mdx)",
+ "type": "[DraftOrder](DraftOrder.mdx)",
"description": "The details of the draft order this order was created from.",
"optional": false,
"defaultValue": "",
@@ -355,7 +355,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "edits",
- "type": "[`OrderEdit`](OrderEdit.mdx)[]",
+ "type": "[OrderEdit](OrderEdit.mdx)[]",
"description": "The details of the order edits done on the order.",
"optional": false,
"defaultValue": "",
@@ -382,7 +382,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "fulfillment_status",
- "type": "[`FulfillmentStatus`](../enums/FulfillmentStatus.mdx)",
+ "type": "[FulfillmentStatus](../enums/FulfillmentStatus.mdx)",
"description": "The order's fulfillment status",
"optional": false,
"defaultValue": "not_fulfilled",
@@ -391,7 +391,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "fulfillments",
- "type": "[`Fulfillment`](Fulfillment.mdx)[]",
+ "type": "[Fulfillment](Fulfillment.mdx)[]",
"description": "The details of the fulfillments created for the order.",
"optional": false,
"defaultValue": "",
@@ -418,7 +418,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "gift_card_transactions",
- "type": "[`GiftCardTransaction`](GiftCardTransaction.mdx)[]",
+ "type": "[GiftCardTransaction](GiftCardTransaction.mdx)[]",
"description": "The gift card transactions made in the order.",
"optional": false,
"defaultValue": "",
@@ -427,7 +427,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "gift_cards",
- "type": "[`GiftCard`](GiftCard.mdx)[]",
+ "type": "[GiftCard](GiftCard.mdx)[]",
"description": "The details of the gift card used in the order.",
"optional": false,
"defaultValue": "",
@@ -463,7 +463,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that belong to the order.",
"optional": false,
"defaultValue": "",
@@ -472,7 +472,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -508,7 +508,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "payment_status",
- "type": "[`PaymentStatus`](../enums/PaymentStatus.mdx)",
+ "type": "[PaymentStatus](../enums/PaymentStatus.mdx)",
"description": "The order's payment status",
"optional": false,
"defaultValue": "not_paid",
@@ -517,7 +517,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "payments",
- "type": "[`Payment`](Payment.mdx)[]",
+ "type": "[Payment](Payment.mdx)[]",
"description": "The details of the payments used in the order.",
"optional": false,
"defaultValue": "",
@@ -553,7 +553,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "refunds",
- "type": "[`Refund`](Refund.mdx)[]",
+ "type": "[Refund](Refund.mdx)[]",
"description": "The details of the refunds created for the order.",
"optional": false,
"defaultValue": "",
@@ -562,7 +562,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this order was created in.",
"optional": false,
"defaultValue": "",
@@ -580,7 +580,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "returnable_items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
"optional": true,
"defaultValue": "",
@@ -589,7 +589,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "returns",
- "type": "[`Return`](Return.mdx)[]",
+ "type": "[Return](Return.mdx)[]",
"description": "The details of the returns created for the order.",
"optional": false,
"defaultValue": "",
@@ -598,7 +598,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "sales_channel",
- "type": "[`SalesChannel`](SalesChannel.mdx)",
+ "type": "[SalesChannel](SalesChannel.mdx)",
"description": "The details of the sales channel this order belongs to.",
"optional": false,
"defaultValue": "",
@@ -616,7 +616,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the shipping address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -634,7 +634,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods used in the order.",
"optional": false,
"defaultValue": "",
@@ -661,7 +661,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "status",
- "type": "[`OrderStatus`](../enums/OrderStatus.mdx)",
+ "type": "[OrderStatus](../enums/OrderStatus.mdx)",
"description": "The order's status",
"optional": false,
"defaultValue": "pending",
@@ -679,7 +679,7 @@ Gift Card Transactions are created once a Customer uses a Gift Card to pay for t
},
{
"name": "swaps",
- "type": "[`Swap`](Swap.mdx)[]",
+ "type": "[Swap](Swap.mdx)[]",
"description": "The details of the swaps created for the order.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/IdempotencyKey.mdx b/www/apps/docs/content/references/entities/classes/IdempotencyKey.mdx
index 0803bc97af..b889e467c9 100644
--- a/www/apps/docs/content/references/entities/classes/IdempotencyKey.mdx
+++ b/www/apps/docs/content/references/entities/classes/IdempotencyKey.mdx
@@ -67,7 +67,7 @@ Idempotency Key is used to continue a process in case of any failure that might
},
{
"name": "request_params",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The parameters passed to the request",
"optional": false,
"defaultValue": "",
@@ -85,7 +85,7 @@ Idempotency Key is used to continue a process in case of any failure that might
},
{
"name": "response_body",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The response's body",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/Image.mdx b/www/apps/docs/content/references/entities/classes/Image.mdx
index 7746677398..b4b27fd280 100644
--- a/www/apps/docs/content/references/entities/classes/Image.mdx
+++ b/www/apps/docs/content/references/entities/classes/Image.mdx
@@ -40,7 +40,7 @@ An Image is used to store details about uploaded images. Images are uploaded by
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/Invite.mdx b/www/apps/docs/content/references/entities/classes/Invite.mdx
index 483a131db2..d92dc49a9e 100644
--- a/www/apps/docs/content/references/entities/classes/Invite.mdx
+++ b/www/apps/docs/content/references/entities/classes/Invite.mdx
@@ -58,7 +58,7 @@ An invite is created when an admin user invites a new user to join the store's t
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -67,7 +67,7 @@ An invite is created when an admin user invites a new user to join the store's t
},
{
"name": "role",
- "type": "[`UserRoles`](../enums/UserRoles.mdx)",
+ "type": "[UserRoles](../enums/UserRoles.mdx)",
"description": "The user's role. These roles don't change the privileges of the user.",
"optional": false,
"defaultValue": "member",
diff --git a/www/apps/docs/content/references/entities/classes/LineItem.mdx b/www/apps/docs/content/references/entities/classes/LineItem.mdx
index e09d9b361f..dfad6369f2 100644
--- a/www/apps/docs/content/references/entities/classes/LineItem.mdx
+++ b/www/apps/docs/content/references/entities/classes/LineItem.mdx
@@ -13,7 +13,7 @@ Line Items are created when a product is added to a Cart. When Line Items are pu
",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -167,7 +167,7 @@ Line Items are created when a product is added to a Cart. When Line Items are pu
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the line item may belongs to.",
"optional": false,
"defaultValue": "",
@@ -176,7 +176,7 @@ Line Items are created when a product is added to a Cart. When Line Items are pu
},
{
"name": "order_edit",
- "type": "``null`` \\| [`OrderEdit`](OrderEdit.mdx)",
+ "type": "``null`` \\| [OrderEdit](OrderEdit.mdx)",
"description": "The details of the order edit.",
"optional": true,
"defaultValue": "",
@@ -302,7 +302,7 @@ Line Items are created when a product is added to a Cart. When Line Items are pu
},
{
"name": "swap",
- "type": "[`Swap`](Swap.mdx)",
+ "type": "[Swap](Swap.mdx)",
"description": "The details of the swap that the line item may belong to.",
"optional": false,
"defaultValue": "",
@@ -320,7 +320,7 @@ Line Items are created when a product is added to a Cart. When Line Items are pu
},
{
"name": "tax_lines",
- "type": "[`LineItemTaxLine`](LineItemTaxLine.mdx)[]",
+ "type": "[LineItemTaxLine](LineItemTaxLine.mdx)[]",
"description": "The details of the item's tax lines.",
"optional": false,
"defaultValue": "",
@@ -383,7 +383,7 @@ Line Items are created when a product is added to a Cart. When Line Items are pu
},
{
"name": "variant",
- "type": "[`ProductVariant`](ProductVariant.mdx)",
+ "type": "[ProductVariant](ProductVariant.mdx)",
"description": "The details of the product variant that this item was created from.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/LineItemAdjustment.mdx b/www/apps/docs/content/references/entities/classes/LineItemAdjustment.mdx
index 5f58fab75d..95b0d027c5 100644
--- a/www/apps/docs/content/references/entities/classes/LineItemAdjustment.mdx
+++ b/www/apps/docs/content/references/entities/classes/LineItemAdjustment.mdx
@@ -31,7 +31,7 @@ A Line Item Adjustment includes details on discounts applied on a line item.
},
{
"name": "discount",
- "type": "[`Discount`](Discount.mdx)",
+ "type": "[Discount](Discount.mdx)",
"description": "The details of the discount associated with the adjustment.",
"optional": false,
"defaultValue": "",
@@ -58,7 +58,7 @@ A Line Item Adjustment includes details on discounts applied on a line item.
},
{
"name": "item",
- "type": "[`LineItem`](LineItem.mdx)",
+ "type": "[LineItem](LineItem.mdx)",
"description": "The details of the line item.",
"optional": false,
"defaultValue": "",
@@ -76,7 +76,7 @@ A Line Item Adjustment includes details on discounts applied on a line item.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/LineItemTaxLine.mdx b/www/apps/docs/content/references/entities/classes/LineItemTaxLine.mdx
index af4673c09c..f055d4c171 100644
--- a/www/apps/docs/content/references/entities/classes/LineItemTaxLine.mdx
+++ b/www/apps/docs/content/references/entities/classes/LineItemTaxLine.mdx
@@ -40,7 +40,7 @@ A Line Item Tax Line represents the taxes applied on a line item.
},
{
"name": "item",
- "type": "[`LineItem`](LineItem.mdx)",
+ "type": "[LineItem](LineItem.mdx)",
"description": "The details of the line item.",
"optional": false,
"defaultValue": "",
@@ -58,7 +58,7 @@ A Line Item Tax Line represents the taxes applied on a line item.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/MoneyAmount.mdx b/www/apps/docs/content/references/entities/classes/MoneyAmount.mdx
index 7cee56a567..7e69e4f825 100644
--- a/www/apps/docs/content/references/entities/classes/MoneyAmount.mdx
+++ b/www/apps/docs/content/references/entities/classes/MoneyAmount.mdx
@@ -31,7 +31,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency that the money amount may belong to.",
"optional": true,
"defaultValue": "",
@@ -132,7 +132,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "price_list",
- "type": "``null`` \\| [`PriceList`](PriceList.mdx)",
+ "type": "``null`` \\| [PriceList](PriceList.mdx)",
"description": "The details of the price list that the money amount may belong to.",
"optional": false,
"defaultValue": "",
@@ -150,7 +150,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region that the money amount may belong to.",
"optional": true,
"defaultValue": "",
@@ -167,7 +167,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "countries",
- "type": "[`Country`](Country.mdx)[]",
+ "type": "[Country](Country.mdx)[]",
"description": "The details of the countries included in this region.",
"optional": false,
"defaultValue": "",
@@ -185,7 +185,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency used in the region.",
"optional": false,
"defaultValue": "",
@@ -212,7 +212,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "fulfillment_providers",
- "type": "[`FulfillmentProvider`](FulfillmentProvider.mdx)[]",
+ "type": "[FulfillmentProvider](FulfillmentProvider.mdx)[]",
"description": "The details of the fulfillment providers that can be used to fulfill items of orders and similar resources in the region.",
"optional": false,
"defaultValue": "",
@@ -249,7 +249,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -267,7 +267,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "payment_providers",
- "type": "[`PaymentProvider`](PaymentProvider.mdx)[]",
+ "type": "[PaymentProvider](PaymentProvider.mdx)[]",
"description": "The details of the payment providers that can be used to process payments in the region.",
"optional": false,
"defaultValue": "",
@@ -285,7 +285,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "tax_provider",
- "type": "[`TaxProvider`](TaxProvider.mdx)",
+ "type": "[TaxProvider](TaxProvider.mdx)",
"description": "The details of the tax provider used in the region.",
"optional": false,
"defaultValue": "",
@@ -312,7 +312,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "tax_rates",
- "type": "``null`` \\| [`TaxRate`](TaxRate.mdx)[]",
+ "type": "``null`` \\| [TaxRate](TaxRate.mdx)[]",
"description": "The details of the tax rates used in the region, aside from the default rate.",
"optional": false,
"defaultValue": "",
@@ -350,7 +350,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "variant",
- "type": "[`ProductVariant`](ProductVariant.mdx)",
+ "type": "[ProductVariant](ProductVariant.mdx)",
"description": "The details of the product variant that the money amount may belong to.",
"optional": false,
"defaultValue": "",
@@ -359,7 +359,7 @@ A Money Amount represent a price amount, for example, a product variant's price
{
"name": "allow_backorder",
"type": "`boolean`",
- "description": "Whether the Product Variant should be purchasable when `inventory_quantity` is 0.",
+ "description": "Whether the Product Variant should be purchasable when `inventory\\_quantity` is 0.",
"optional": false,
"defaultValue": "false",
"expandable": false,
@@ -430,7 +430,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "inventory_items",
- "type": "[`ProductVariantInventoryItem`](ProductVariantInventoryItem.mdx)[]",
+ "type": "[ProductVariantInventoryItem](ProductVariantInventoryItem.mdx)[]",
"description": "The details inventory items of the product variant.",
"optional": false,
"defaultValue": "",
@@ -475,7 +475,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -493,7 +493,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "options",
- "type": "[`ProductOptionValue`](ProductOptionValue.mdx)[]",
+ "type": "[ProductOptionValue](ProductOptionValue.mdx)[]",
"description": "The details of the product options that this product variant defines values for.",
"optional": false,
"defaultValue": "",
@@ -511,7 +511,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "prices",
- "type": "[`MoneyAmount`](MoneyAmount.mdx)[]",
+ "type": "[MoneyAmount](MoneyAmount.mdx)[]",
"description": "The details of the prices of the Product Variant, each represented as a Money Amount. Each Money Amount represents a price in a given currency or a specific Region.",
"optional": false,
"defaultValue": "",
@@ -520,7 +520,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "product",
- "type": "[`Product`](Product.mdx)",
+ "type": "[Product](Product.mdx)",
"description": "The details of the product that the product variant belongs to.",
"optional": false,
"defaultValue": "",
@@ -621,7 +621,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "variants",
- "type": "[`ProductVariant`](ProductVariant.mdx)[]",
+ "type": "[ProductVariant](ProductVariant.mdx)[]",
"description": "",
"optional": false,
"defaultValue": "",
@@ -630,7 +630,7 @@ A Money Amount represent a price amount, for example, a product variant's price
{
"name": "allow_backorder",
"type": "`boolean`",
- "description": "Whether the Product Variant should be purchasable when `inventory_quantity` is 0.",
+ "description": "Whether the Product Variant should be purchasable when `inventory\\_quantity` is 0.",
"optional": false,
"defaultValue": "false",
"expandable": false,
@@ -701,7 +701,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "inventory_items",
- "type": "[`ProductVariantInventoryItem`](ProductVariantInventoryItem.mdx)[]",
+ "type": "[ProductVariantInventoryItem](ProductVariantInventoryItem.mdx)[]",
"description": "The details inventory items of the product variant.",
"optional": false,
"defaultValue": "",
@@ -746,7 +746,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -764,7 +764,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "options",
- "type": "[`ProductOptionValue`](ProductOptionValue.mdx)[]",
+ "type": "[ProductOptionValue](ProductOptionValue.mdx)[]",
"description": "The details of the product options that this product variant defines values for.",
"optional": false,
"defaultValue": "",
@@ -782,7 +782,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "prices",
- "type": "[`MoneyAmount`](MoneyAmount.mdx)[]",
+ "type": "[MoneyAmount](MoneyAmount.mdx)[]",
"description": "The details of the prices of the Product Variant, each represented as a Money Amount. Each Money Amount represents a price in a given currency or a specific Region.",
"optional": false,
"defaultValue": "",
@@ -791,7 +791,7 @@ A Money Amount represent a price amount, for example, a product variant's price
},
{
"name": "product",
- "type": "[`Product`](Product.mdx)",
+ "type": "[Product](Product.mdx)",
"description": "The details of the product that the product variant belongs to.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/Note.mdx b/www/apps/docs/content/references/entities/classes/Note.mdx
index c22fd24e9d..edd7640be6 100644
--- a/www/apps/docs/content/references/entities/classes/Note.mdx
+++ b/www/apps/docs/content/references/entities/classes/Note.mdx
@@ -13,7 +13,7 @@ A Note is an element that can be used in association with different resources to
",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -102,7 +102,7 @@ A Note is an element that can be used in association with different resources to
},
{
"name": "role",
- "type": "[`UserRoles`](../enums/UserRoles.mdx)",
+ "type": "[UserRoles](../enums/UserRoles.mdx)",
"description": "The user's role. These roles don't provide any different privileges.",
"optional": false,
"defaultValue": "member",
@@ -158,7 +158,7 @@ A Note is an element that can be used in association with different resources to
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/Notification.mdx b/www/apps/docs/content/references/entities/classes/Notification.mdx
index cbb30f1e0e..be59026cea 100644
--- a/www/apps/docs/content/references/entities/classes/Notification.mdx
+++ b/www/apps/docs/content/references/entities/classes/Notification.mdx
@@ -22,7 +22,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "customer",
- "type": "[`Customer`](Customer.mdx)",
+ "type": "[Customer](Customer.mdx)",
"description": "The details of the customer that this notification was sent to.",
"optional": false,
"defaultValue": "",
@@ -30,7 +30,7 @@ A notification is an alert sent, typically to customers, using the installed Not
"children": [
{
"name": "billing_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the billing address associated with the customer.",
"optional": false,
"defaultValue": "",
@@ -84,7 +84,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "groups",
- "type": "[`CustomerGroup`](CustomerGroup.mdx)[]",
+ "type": "[CustomerGroup](CustomerGroup.mdx)[]",
"description": "The customer groups the customer belongs to.",
"optional": false,
"defaultValue": "",
@@ -120,7 +120,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -129,7 +129,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "orders",
- "type": "[`Order`](Order.mdx)[]",
+ "type": "[Order](Order.mdx)[]",
"description": "The details of the orders this customer placed.",
"optional": false,
"defaultValue": "",
@@ -156,7 +156,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "shipping_addresses",
- "type": "[`Address`](Address.mdx)[]",
+ "type": "[Address](Address.mdx)[]",
"description": "The details of the shipping addresses associated with the customer.",
"optional": false,
"defaultValue": "",
@@ -185,7 +185,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend.",
"optional": false,
"defaultValue": "",
@@ -221,7 +221,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "parent_notification",
- "type": "[`Notification`](Notification.mdx)",
+ "type": "[Notification](Notification.mdx)",
"description": "The details of the parent notification.",
"optional": false,
"defaultValue": "",
@@ -238,7 +238,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "customer",
- "type": "[`Customer`](Customer.mdx)",
+ "type": "[Customer](Customer.mdx)",
"description": "The details of the customer that this notification was sent to.",
"optional": false,
"defaultValue": "",
@@ -256,7 +256,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend.",
"optional": false,
"defaultValue": "",
@@ -292,7 +292,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "parent_notification",
- "type": "[`Notification`](Notification.mdx)",
+ "type": "[Notification](Notification.mdx)",
"description": "The details of the parent notification.",
"optional": false,
"defaultValue": "",
@@ -301,7 +301,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "provider",
- "type": "[`NotificationProvider`](NotificationProvider.mdx)",
+ "type": "[NotificationProvider](NotificationProvider.mdx)",
"description": "The notification provider used to send the notification.",
"optional": false,
"defaultValue": "",
@@ -319,7 +319,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "resends",
- "type": "[`Notification`](Notification.mdx)[]",
+ "type": "[Notification](Notification.mdx)[]",
"description": "The details of all resends of the notification.",
"optional": false,
"defaultValue": "",
@@ -366,7 +366,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "provider",
- "type": "[`NotificationProvider`](NotificationProvider.mdx)",
+ "type": "[NotificationProvider](NotificationProvider.mdx)",
"description": "The notification provider used to send the notification.",
"optional": false,
"defaultValue": "",
@@ -384,7 +384,7 @@ A notification is an alert sent, typically to customers, using the installed Not
{
"name": "is_installed",
"type": "`boolean`",
- "description": "Whether the notification service is installed in the current version. If a notification service is no longer installed, the `is_installed` attribute is set to `false`.",
+ "description": "Whether the notification service is installed in the current version. If a notification service is no longer installed, the `is\\_installed` attribute is set to `false`.",
"optional": false,
"defaultValue": "true",
"expandable": false,
@@ -403,7 +403,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "resends",
- "type": "[`Notification`](Notification.mdx)[]",
+ "type": "[Notification](Notification.mdx)[]",
"description": "The details of all resends of the notification.",
"optional": false,
"defaultValue": "",
@@ -420,7 +420,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "customer",
- "type": "[`Customer`](Customer.mdx)",
+ "type": "[Customer](Customer.mdx)",
"description": "The details of the customer that this notification was sent to.",
"optional": false,
"defaultValue": "",
@@ -438,7 +438,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend.",
"optional": false,
"defaultValue": "",
@@ -474,7 +474,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "parent_notification",
- "type": "[`Notification`](Notification.mdx)",
+ "type": "[Notification](Notification.mdx)",
"description": "The details of the parent notification.",
"optional": false,
"defaultValue": "",
@@ -483,7 +483,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "provider",
- "type": "[`NotificationProvider`](NotificationProvider.mdx)",
+ "type": "[NotificationProvider](NotificationProvider.mdx)",
"description": "The notification provider used to send the notification.",
"optional": false,
"defaultValue": "",
@@ -501,7 +501,7 @@ A notification is an alert sent, typically to customers, using the installed Not
},
{
"name": "resends",
- "type": "[`Notification`](Notification.mdx)[]",
+ "type": "[Notification](Notification.mdx)[]",
"description": "The details of all resends of the notification.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/NotificationProvider.mdx b/www/apps/docs/content/references/entities/classes/NotificationProvider.mdx
index de44f91b35..de9d359265 100644
--- a/www/apps/docs/content/references/entities/classes/NotificationProvider.mdx
+++ b/www/apps/docs/content/references/entities/classes/NotificationProvider.mdx
@@ -23,7 +23,7 @@ A notification provider represents a notification service installed in the Medus
{
"name": "is_installed",
"type": "`boolean`",
- "description": "Whether the notification service is installed in the current version. If a notification service is no longer installed, the `is_installed` attribute is set to `false`.",
+ "description": "Whether the notification service is installed in the current version. If a notification service is no longer installed, the `is\\_installed` attribute is set to `false`.",
"optional": false,
"defaultValue": "true",
"expandable": false,
diff --git a/www/apps/docs/content/references/entities/classes/Oauth.mdx b/www/apps/docs/content/references/entities/classes/Oauth.mdx
index 7ce99a6fad..343e3cff04 100644
--- a/www/apps/docs/content/references/entities/classes/Oauth.mdx
+++ b/www/apps/docs/content/references/entities/classes/Oauth.mdx
@@ -20,7 +20,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/Order.mdx b/www/apps/docs/content/references/entities/classes/Order.mdx
index da523dd070..8bc66a31bb 100644
--- a/www/apps/docs/content/references/entities/classes/Order.mdx
+++ b/www/apps/docs/content/references/entities/classes/Order.mdx
@@ -13,7 +13,7 @@ An order is a purchase made by a customer. It holds details about payment and fu
",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -310,7 +310,7 @@ An order is a purchase made by a customer. It holds details about payment and fu
},
{
"name": "payment_status",
- "type": "[`PaymentStatus`](../enums/PaymentStatus.mdx)",
+ "type": "[PaymentStatus](../enums/PaymentStatus.mdx)",
"description": "The order's payment status",
"optional": false,
"defaultValue": "not_paid",
@@ -319,7 +319,7 @@ An order is a purchase made by a customer. It holds details about payment and fu
},
{
"name": "payments",
- "type": "[`Payment`](Payment.mdx)[]",
+ "type": "[Payment](Payment.mdx)[]",
"description": "The details of the payments used in the order.",
"optional": false,
"defaultValue": "",
@@ -355,7 +355,7 @@ An order is a purchase made by a customer. It holds details about payment and fu
},
{
"name": "refunds",
- "type": "[`Refund`](Refund.mdx)[]",
+ "type": "[Refund](Refund.mdx)[]",
"description": "The details of the refunds created for the order.",
"optional": false,
"defaultValue": "",
@@ -364,7 +364,7 @@ An order is a purchase made by a customer. It holds details about payment and fu
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this order was created in.",
"optional": false,
"defaultValue": "",
@@ -382,7 +382,7 @@ An order is a purchase made by a customer. It holds details about payment and fu
},
{
"name": "returnable_items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
"optional": true,
"defaultValue": "",
@@ -391,7 +391,7 @@ An order is a purchase made by a customer. It holds details about payment and fu
},
{
"name": "returns",
- "type": "[`Return`](Return.mdx)[]",
+ "type": "[Return](Return.mdx)[]",
"description": "The details of the returns created for the order.",
"optional": false,
"defaultValue": "",
@@ -400,7 +400,7 @@ An order is a purchase made by a customer. It holds details about payment and fu
},
{
"name": "sales_channel",
- "type": "[`SalesChannel`](SalesChannel.mdx)",
+ "type": "[SalesChannel](SalesChannel.mdx)",
"description": "The details of the sales channel this order belongs to.",
"optional": false,
"defaultValue": "",
@@ -418,7 +418,7 @@ An order is a purchase made by a customer. It holds details about payment and fu
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the shipping address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -436,7 +436,7 @@ An order is a purchase made by a customer. It holds details about payment and fu
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods used in the order.",
"optional": false,
"defaultValue": "",
@@ -463,7 +463,7 @@ An order is a purchase made by a customer. It holds details about payment and fu
},
{
"name": "status",
- "type": "[`OrderStatus`](../enums/OrderStatus.mdx)",
+ "type": "[OrderStatus](../enums/OrderStatus.mdx)",
"description": "The order's status",
"optional": false,
"defaultValue": "pending",
@@ -481,7 +481,7 @@ An order is a purchase made by a customer. It holds details about payment and fu
},
{
"name": "swaps",
- "type": "[`Swap`](Swap.mdx)[]",
+ "type": "[Swap](Swap.mdx)[]",
"description": "The details of the swaps created for the order.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/OrderEdit.mdx b/www/apps/docs/content/references/entities/classes/OrderEdit.mdx
index 97a15459b3..4d7d416ca2 100644
--- a/www/apps/docs/content/references/entities/classes/OrderEdit.mdx
+++ b/www/apps/docs/content/references/entities/classes/OrderEdit.mdx
@@ -31,7 +31,7 @@ Order edit allows modifying items in an order, such as adding, updating, or dele
},
{
"name": "changes",
- "type": "[`OrderItemChange`](OrderItemChange.mdx)[]",
+ "type": "[OrderItemChange](OrderItemChange.mdx)[]",
"description": "The details of all the changes on the original order's line items.",
"optional": false,
"defaultValue": "",
@@ -157,7 +157,7 @@ Order edit allows modifying items in an order, such as adding, updating, or dele
},
{
"name": "items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the cloned items from the original order with the new changes. Once the order edit is confirmed, these line items are associated with the original order.",
"optional": false,
"defaultValue": "",
@@ -166,7 +166,7 @@ Order edit allows modifying items in an order, such as adding, updating, or dele
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that this order edit was created for.",
"optional": false,
"defaultValue": "",
@@ -184,7 +184,7 @@ Order edit allows modifying items in an order, such as adding, updating, or dele
},
{
"name": "payment_collection",
- "type": "[`PaymentCollection`](PaymentCollection.mdx)",
+ "type": "[PaymentCollection](PaymentCollection.mdx)",
"description": "The details of the payment collection used to authorize additional payment if necessary.",
"optional": false,
"defaultValue": "",
@@ -229,7 +229,7 @@ Order edit allows modifying items in an order, such as adding, updating, or dele
},
{
"name": "status",
- "type": "[`OrderEditStatus`](../enums/OrderEditStatus.mdx)",
+ "type": "[OrderEditStatus](../enums/OrderEditStatus.mdx)",
"description": "The status of the order edit.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/OrderItemChange.mdx b/www/apps/docs/content/references/entities/classes/OrderItemChange.mdx
index d86737c1e4..a103f2fdb2 100644
--- a/www/apps/docs/content/references/entities/classes/OrderItemChange.mdx
+++ b/www/apps/docs/content/references/entities/classes/OrderItemChange.mdx
@@ -40,7 +40,7 @@ An order item change is a change made within an order edit to an order's items.
},
{
"name": "line_item",
- "type": "[`LineItem`](LineItem.mdx)",
+ "type": "[LineItem](LineItem.mdx)",
"description": "The details of the resulting line item after the item change. This line item is then used in the original order once the order edit is confirmed.",
"optional": true,
"defaultValue": "",
@@ -58,7 +58,7 @@ An order item change is a change made within an order edit to an order's items.
},
{
"name": "order_edit",
- "type": "[`OrderEdit`](OrderEdit.mdx)",
+ "type": "[OrderEdit](OrderEdit.mdx)",
"description": "The details of the order edit the item change is associated with.",
"optional": false,
"defaultValue": "",
@@ -76,7 +76,7 @@ An order item change is a change made within an order edit to an order's items.
},
{
"name": "original_line_item",
- "type": "[`LineItem`](LineItem.mdx)",
+ "type": "[LineItem](LineItem.mdx)",
"description": "The details of the original line item this item change references. This is used if the item change updates or deletes the original item.",
"optional": true,
"defaultValue": "",
@@ -94,7 +94,7 @@ An order item change is a change made within an order edit to an order's items.
},
{
"name": "type",
- "type": "[`OrderEditItemChangeType`](../enums/OrderEditItemChangeType.mdx)",
+ "type": "[OrderEditItemChangeType](../enums/OrderEditItemChangeType.mdx)",
"description": "The order item change's status",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/Payment.mdx b/www/apps/docs/content/references/entities/classes/Payment.mdx
index 9738ca80b3..cffa4d2988 100644
--- a/www/apps/docs/content/references/entities/classes/Payment.mdx
+++ b/www/apps/docs/content/references/entities/classes/Payment.mdx
@@ -49,7 +49,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart that the payment session was potentially created for.",
"optional": false,
"defaultValue": "",
@@ -57,7 +57,7 @@ A payment is originally created from a payment session. Once a payment session i
"children": [
{
"name": "billing_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the billing address associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -84,7 +84,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "context",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The context of the cart which can include info like IP or user agent.",
"optional": false,
"defaultValue": "",
@@ -102,7 +102,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "customer",
- "type": "[`Customer`](Customer.mdx)",
+ "type": "[Customer](Customer.mdx)",
"description": "The details of the customer the cart belongs to.",
"optional": false,
"defaultValue": "",
@@ -138,7 +138,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "discounts",
- "type": "[`Discount`](Discount.mdx)[]",
+ "type": "[Discount](Discount.mdx)[]",
"description": "An array of details of all discounts applied to the cart.",
"optional": false,
"defaultValue": "",
@@ -174,7 +174,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "gift_cards",
- "type": "[`GiftCard`](GiftCard.mdx)[]",
+ "type": "[GiftCard](GiftCard.mdx)[]",
"description": "An array of details of all gift cards applied to the cart.",
"optional": false,
"defaultValue": "",
@@ -210,7 +210,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The line items added to the cart.",
"optional": false,
"defaultValue": "",
@@ -219,7 +219,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -237,7 +237,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "payment",
- "type": "[`Payment`](Payment.mdx)",
+ "type": "[Payment](Payment.mdx)",
"description": "The details of the payment associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -264,7 +264,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "payment_session",
- "type": "``null`` \\| [`PaymentSession`](PaymentSession.mdx)",
+ "type": "``null`` \\| [PaymentSession](PaymentSession.mdx)",
"description": "The details of the selected payment session in the cart.",
"optional": false,
"defaultValue": "",
@@ -273,7 +273,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "payment_sessions",
- "type": "[`PaymentSession`](PaymentSession.mdx)[]",
+ "type": "[PaymentSession](PaymentSession.mdx)[]",
"description": "The details of all payment sessions created on the cart.",
"optional": false,
"defaultValue": "",
@@ -309,7 +309,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -327,7 +327,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "sales_channel",
- "type": "[`SalesChannel`](SalesChannel.mdx)",
+ "type": "[SalesChannel](SalesChannel.mdx)",
"description": "The details of the sales channel associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -345,7 +345,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "shipping_address",
- "type": "``null`` \\| [`Address`](Address.mdx)",
+ "type": "``null`` \\| [Address](Address.mdx)",
"description": "The details of the shipping address associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -363,7 +363,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods added to the cart.",
"optional": false,
"defaultValue": "",
@@ -417,7 +417,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "type",
- "type": "[`CartType`](../enums/CartType.mdx)",
+ "type": "[CartType](../enums/CartType.mdx)",
"description": "The cart's type.",
"optional": false,
"defaultValue": "default",
@@ -455,7 +455,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency of the payment.",
"optional": false,
"defaultValue": "",
@@ -520,7 +520,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The data required for the Payment Provider to identify, modify and process the Payment. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state.",
"optional": false,
"defaultValue": "",
@@ -547,7 +547,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -556,7 +556,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the payment session was potentially created for.",
"optional": false,
"defaultValue": "",
@@ -564,7 +564,7 @@ A payment is originally created from a payment session. Once a payment session i
"children": [
{
"name": "billing_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the billing address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -591,7 +591,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart associated with the order.",
"optional": false,
"defaultValue": "",
@@ -609,7 +609,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "claims",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)[]",
+ "type": "[ClaimOrder](ClaimOrder.mdx)[]",
"description": "The details of the claims created for the order.",
"optional": false,
"defaultValue": "",
@@ -627,7 +627,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency used in the order.",
"optional": false,
"defaultValue": "",
@@ -645,7 +645,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "customer",
- "type": "[`Customer`](Customer.mdx)",
+ "type": "[Customer](Customer.mdx)",
"description": "The details of the customer associated with the order.",
"optional": false,
"defaultValue": "",
@@ -672,7 +672,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "discounts",
- "type": "[`Discount`](Discount.mdx)[]",
+ "type": "[Discount](Discount.mdx)[]",
"description": "The details of the discounts applied on the order.",
"optional": false,
"defaultValue": "",
@@ -690,7 +690,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "draft_order",
- "type": "[`DraftOrder`](DraftOrder.mdx)",
+ "type": "[DraftOrder](DraftOrder.mdx)",
"description": "The details of the draft order this order was created from.",
"optional": false,
"defaultValue": "",
@@ -708,7 +708,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "edits",
- "type": "[`OrderEdit`](OrderEdit.mdx)[]",
+ "type": "[OrderEdit](OrderEdit.mdx)[]",
"description": "The details of the order edits done on the order.",
"optional": false,
"defaultValue": "",
@@ -735,7 +735,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "fulfillment_status",
- "type": "[`FulfillmentStatus`](../enums/FulfillmentStatus.mdx)",
+ "type": "[FulfillmentStatus](../enums/FulfillmentStatus.mdx)",
"description": "The order's fulfillment status",
"optional": false,
"defaultValue": "not_fulfilled",
@@ -744,7 +744,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "fulfillments",
- "type": "[`Fulfillment`](Fulfillment.mdx)[]",
+ "type": "[Fulfillment](Fulfillment.mdx)[]",
"description": "The details of the fulfillments created for the order.",
"optional": false,
"defaultValue": "",
@@ -771,7 +771,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "gift_card_transactions",
- "type": "[`GiftCardTransaction`](GiftCardTransaction.mdx)[]",
+ "type": "[GiftCardTransaction](GiftCardTransaction.mdx)[]",
"description": "The gift card transactions made in the order.",
"optional": false,
"defaultValue": "",
@@ -780,7 +780,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "gift_cards",
- "type": "[`GiftCard`](GiftCard.mdx)[]",
+ "type": "[GiftCard](GiftCard.mdx)[]",
"description": "The details of the gift card used in the order.",
"optional": false,
"defaultValue": "",
@@ -816,7 +816,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that belong to the order.",
"optional": false,
"defaultValue": "",
@@ -825,7 +825,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -861,7 +861,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "payment_status",
- "type": "[`PaymentStatus`](../enums/PaymentStatus.mdx)",
+ "type": "[PaymentStatus](../enums/PaymentStatus.mdx)",
"description": "The order's payment status",
"optional": false,
"defaultValue": "not_paid",
@@ -870,7 +870,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "payments",
- "type": "[`Payment`](Payment.mdx)[]",
+ "type": "[Payment](Payment.mdx)[]",
"description": "The details of the payments used in the order.",
"optional": false,
"defaultValue": "",
@@ -906,7 +906,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "refunds",
- "type": "[`Refund`](Refund.mdx)[]",
+ "type": "[Refund](Refund.mdx)[]",
"description": "The details of the refunds created for the order.",
"optional": false,
"defaultValue": "",
@@ -915,7 +915,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this order was created in.",
"optional": false,
"defaultValue": "",
@@ -933,7 +933,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "returnable_items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
"optional": true,
"defaultValue": "",
@@ -942,7 +942,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "returns",
- "type": "[`Return`](Return.mdx)[]",
+ "type": "[Return](Return.mdx)[]",
"description": "The details of the returns created for the order.",
"optional": false,
"defaultValue": "",
@@ -951,7 +951,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "sales_channel",
- "type": "[`SalesChannel`](SalesChannel.mdx)",
+ "type": "[SalesChannel](SalesChannel.mdx)",
"description": "The details of the sales channel this order belongs to.",
"optional": false,
"defaultValue": "",
@@ -969,7 +969,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the shipping address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -987,7 +987,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods used in the order.",
"optional": false,
"defaultValue": "",
@@ -1014,7 +1014,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "status",
- "type": "[`OrderStatus`](../enums/OrderStatus.mdx)",
+ "type": "[OrderStatus](../enums/OrderStatus.mdx)",
"description": "The order's status",
"optional": false,
"defaultValue": "pending",
@@ -1032,7 +1032,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "swaps",
- "type": "[`Swap`](Swap.mdx)[]",
+ "type": "[Swap](Swap.mdx)[]",
"description": "The details of the swaps created for the order.",
"optional": false,
"defaultValue": "",
@@ -1097,7 +1097,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "swap",
- "type": "[`Swap`](Swap.mdx)",
+ "type": "[Swap](Swap.mdx)",
"description": "The details of the swap that this payment was potentially created for.",
"optional": false,
"defaultValue": "",
@@ -1105,7 +1105,7 @@ A payment is originally created from a payment session. Once a payment session i
"children": [
{
"name": "additional_items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the new products to send to the customer, represented as line items.",
"optional": false,
"defaultValue": "",
@@ -1132,7 +1132,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart that the customer uses to complete the swap.",
"optional": false,
"defaultValue": "",
@@ -1186,7 +1186,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "fulfillment_status",
- "type": "[`SwapFulfillmentStatus`](../enums/SwapFulfillmentStatus.mdx)",
+ "type": "[SwapFulfillmentStatus](../enums/SwapFulfillmentStatus.mdx)",
"description": "The status of the Fulfillment of the Swap.",
"optional": false,
"defaultValue": "",
@@ -1195,7 +1195,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "fulfillments",
- "type": "[`Fulfillment`](Fulfillment.mdx)[]",
+ "type": "[Fulfillment](Fulfillment.mdx)[]",
"description": "The details of the fulfillments that are used to send the new items to the customer.",
"optional": false,
"defaultValue": "",
@@ -1222,7 +1222,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -1240,7 +1240,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the swap belongs to.",
"optional": false,
"defaultValue": "",
@@ -1258,8 +1258,8 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "payment",
- "type": "[`Payment`](Payment.mdx)",
- "description": "The details of the additional payment authorized by the customer when `difference_due` is positive.",
+ "type": "[Payment](Payment.mdx)",
+ "description": "The details of the additional payment authorized by the customer when `difference\\_due` is positive.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -1267,7 +1267,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "payment_status",
- "type": "[`SwapPaymentStatus`](../enums/SwapPaymentStatus.mdx)",
+ "type": "[SwapPaymentStatus](../enums/SwapPaymentStatus.mdx)",
"description": "The status of the Payment of the Swap. The payment may either refer to the refund of an amount or the authorization of a new amount.",
"optional": false,
"defaultValue": "",
@@ -1276,7 +1276,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "return_order",
- "type": "[`Return`](Return.mdx)",
+ "type": "[Return](Return.mdx)",
"description": "The details of the return that belongs to the swap, which holds the details on the items being returned.",
"optional": false,
"defaultValue": "",
@@ -1285,7 +1285,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the shipping address that the new items should be sent to.",
"optional": false,
"defaultValue": "",
@@ -1303,7 +1303,7 @@ A payment is originally created from a payment session. Once a payment session i
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods used to fulfill the additional items purchased.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/PaymentCollection.mdx b/www/apps/docs/content/references/entities/classes/PaymentCollection.mdx
index 7f922efd58..47b13fa15b 100644
--- a/www/apps/docs/content/references/entities/classes/PaymentCollection.mdx
+++ b/www/apps/docs/content/references/entities/classes/PaymentCollection.mdx
@@ -49,7 +49,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency this payment collection is associated with.",
"optional": false,
"defaultValue": "",
@@ -141,7 +141,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -150,7 +150,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "payment_sessions",
- "type": "[`PaymentSession`](PaymentSession.mdx)[]",
+ "type": "[PaymentSession](PaymentSession.mdx)[]",
"description": "The details of the payment sessions created as part of the payment collection.",
"optional": false,
"defaultValue": "",
@@ -167,7 +167,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart that the payment session was created for.",
"optional": false,
"defaultValue": "",
@@ -194,7 +194,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The data required for the Payment Provider to identify, modify and process the Payment Session. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state.",
"optional": false,
"defaultValue": "",
@@ -258,7 +258,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
{
"name": "status",
"type": "`string`",
- "description": "Indicates the status of the Payment Session. Will default to `pending`, and will eventually become `authorized`. Payment Sessions may have the status of `requires_more` to indicate that further actions are to be completed by the Customer.",
+ "description": "Indicates the status of the Payment Session. Will default to `pending`, and will eventually become `authorized`. Payment Sessions may have the status of `requires\\_more` to indicate that further actions are to be completed by the Customer.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -277,7 +277,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "payments",
- "type": "[`Payment`](Payment.mdx)[]",
+ "type": "[Payment](Payment.mdx)[]",
"description": "The details of the payments created as part of the payment collection.",
"optional": false,
"defaultValue": "",
@@ -321,7 +321,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart that the payment session was potentially created for.",
"optional": false,
"defaultValue": "",
@@ -348,7 +348,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency of the payment.",
"optional": false,
"defaultValue": "",
@@ -366,7 +366,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The data required for the Payment Provider to identify, modify and process the Payment. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state.",
"optional": false,
"defaultValue": "",
@@ -393,7 +393,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -402,7 +402,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the payment session was potentially created for.",
"optional": false,
"defaultValue": "",
@@ -429,7 +429,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "swap",
- "type": "[`Swap`](Swap.mdx)",
+ "type": "[Swap](Swap.mdx)",
"description": "The details of the swap that this payment was potentially created for.",
"optional": false,
"defaultValue": "",
@@ -458,7 +458,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this payment collection is associated with.",
"optional": false,
"defaultValue": "",
@@ -475,7 +475,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "countries",
- "type": "[`Country`](Country.mdx)[]",
+ "type": "[Country](Country.mdx)[]",
"description": "The details of the countries included in this region.",
"optional": false,
"defaultValue": "",
@@ -493,7 +493,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency used in the region.",
"optional": false,
"defaultValue": "",
@@ -520,7 +520,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "fulfillment_providers",
- "type": "[`FulfillmentProvider`](FulfillmentProvider.mdx)[]",
+ "type": "[FulfillmentProvider](FulfillmentProvider.mdx)[]",
"description": "The details of the fulfillment providers that can be used to fulfill items of orders and similar resources in the region.",
"optional": false,
"defaultValue": "",
@@ -557,7 +557,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -575,7 +575,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "payment_providers",
- "type": "[`PaymentProvider`](PaymentProvider.mdx)[]",
+ "type": "[PaymentProvider](PaymentProvider.mdx)[]",
"description": "The details of the payment providers that can be used to process payments in the region.",
"optional": false,
"defaultValue": "",
@@ -593,7 +593,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "tax_provider",
- "type": "[`TaxProvider`](TaxProvider.mdx)",
+ "type": "[TaxProvider](TaxProvider.mdx)",
"description": "The details of the tax provider used in the region.",
"optional": false,
"defaultValue": "",
@@ -620,7 +620,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "tax_rates",
- "type": "``null`` \\| [`TaxRate`](TaxRate.mdx)[]",
+ "type": "``null`` \\| [TaxRate](TaxRate.mdx)[]",
"description": "The details of the tax rates used in the region, aside from the default rate.",
"optional": false,
"defaultValue": "",
@@ -649,7 +649,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "status",
- "type": "[`PaymentCollectionStatus`](../enums/PaymentCollectionStatus.mdx)",
+ "type": "[PaymentCollectionStatus](../enums/PaymentCollectionStatus.mdx)",
"description": "The type of the payment collection",
"optional": false,
"defaultValue": "",
@@ -704,7 +704,7 @@ A payment collection allows grouping and managing a list of payments at one. Thi
},
{
"name": "type",
- "type": "[`ORDER_EDIT`](../enums/PaymentCollectionType.mdx#order_edit)",
+ "type": "[ORDER_EDIT](../enums/PaymentCollectionType.mdx#order_edit)",
"description": "The type of the payment collection",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/PaymentProvider.mdx b/www/apps/docs/content/references/entities/classes/PaymentProvider.mdx
index 972c749d70..11e8a83456 100644
--- a/www/apps/docs/content/references/entities/classes/PaymentProvider.mdx
+++ b/www/apps/docs/content/references/entities/classes/PaymentProvider.mdx
@@ -23,7 +23,7 @@ A payment provider represents a payment service installed in the Medusa backend,
{
"name": "is_installed",
"type": "`boolean`",
- "description": "Whether the payment service is installed in the current version. If a payment service is no longer installed, the `is_installed` attribute is set to `false`.",
+ "description": "Whether the payment service is installed in the current version. If a payment service is no longer installed, the `is\\_installed` attribute is set to `false`.",
"optional": false,
"defaultValue": "true",
"expandable": false,
diff --git a/www/apps/docs/content/references/entities/classes/PaymentSession.mdx b/www/apps/docs/content/references/entities/classes/PaymentSession.mdx
index 9e9d0d158b..a84827834b 100644
--- a/www/apps/docs/content/references/entities/classes/PaymentSession.mdx
+++ b/www/apps/docs/content/references/entities/classes/PaymentSession.mdx
@@ -22,7 +22,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart that the payment session was created for.",
"optional": false,
"defaultValue": "",
@@ -30,7 +30,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
"children": [
{
"name": "billing_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the billing address associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -57,7 +57,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
},
{
"name": "context",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The context of the cart which can include info like IP or user agent.",
"optional": false,
"defaultValue": "",
@@ -75,7 +75,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
},
{
"name": "customer",
- "type": "[`Customer`](Customer.mdx)",
+ "type": "[Customer](Customer.mdx)",
"description": "The details of the customer the cart belongs to.",
"optional": false,
"defaultValue": "",
@@ -111,7 +111,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
},
{
"name": "discounts",
- "type": "[`Discount`](Discount.mdx)[]",
+ "type": "[Discount](Discount.mdx)[]",
"description": "An array of details of all discounts applied to the cart.",
"optional": false,
"defaultValue": "",
@@ -147,7 +147,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
},
{
"name": "gift_cards",
- "type": "[`GiftCard`](GiftCard.mdx)[]",
+ "type": "[GiftCard](GiftCard.mdx)[]",
"description": "An array of details of all gift cards applied to the cart.",
"optional": false,
"defaultValue": "",
@@ -183,7 +183,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
},
{
"name": "items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The line items added to the cart.",
"optional": false,
"defaultValue": "",
@@ -192,7 +192,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -210,7 +210,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
},
{
"name": "payment",
- "type": "[`Payment`](Payment.mdx)",
+ "type": "[Payment](Payment.mdx)",
"description": "The details of the payment associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -237,7 +237,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
},
{
"name": "payment_session",
- "type": "``null`` \\| [`PaymentSession`](PaymentSession.mdx)",
+ "type": "``null`` \\| [PaymentSession](PaymentSession.mdx)",
"description": "The details of the selected payment session in the cart.",
"optional": false,
"defaultValue": "",
@@ -246,7 +246,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
},
{
"name": "payment_sessions",
- "type": "[`PaymentSession`](PaymentSession.mdx)[]",
+ "type": "[PaymentSession](PaymentSession.mdx)[]",
"description": "The details of all payment sessions created on the cart.",
"optional": false,
"defaultValue": "",
@@ -282,7 +282,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -300,7 +300,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
},
{
"name": "sales_channel",
- "type": "[`SalesChannel`](SalesChannel.mdx)",
+ "type": "[SalesChannel](SalesChannel.mdx)",
"description": "The details of the sales channel associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -318,7 +318,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
},
{
"name": "shipping_address",
- "type": "``null`` \\| [`Address`](Address.mdx)",
+ "type": "``null`` \\| [Address](Address.mdx)",
"description": "The details of the shipping address associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -336,7 +336,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods added to the cart.",
"optional": false,
"defaultValue": "",
@@ -390,7 +390,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
},
{
"name": "type",
- "type": "[`CartType`](../enums/CartType.mdx)",
+ "type": "[CartType](../enums/CartType.mdx)",
"description": "The cart's type.",
"optional": false,
"defaultValue": "default",
@@ -428,7 +428,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The data required for the Payment Provider to identify, modify and process the Payment Session. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state.",
"optional": false,
"defaultValue": "",
@@ -492,7 +492,7 @@ A Payment Session is created when a Customer initilizes the checkout flow, and c
{
"name": "status",
"type": "`string`",
- "description": "Indicates the status of the Payment Session. Will default to `pending`, and will eventually become `authorized`. Payment Sessions may have the status of `requires_more` to indicate that further actions are to be completed by the Customer.",
+ "description": "Indicates the status of the Payment Session. Will default to `pending`, and will eventually become `authorized`. Payment Sessions may have the status of `requires\\_more` to indicate that further actions are to be completed by the Customer.",
"optional": false,
"defaultValue": "",
"expandable": false,
diff --git a/www/apps/docs/content/references/entities/classes/PriceList.mdx b/www/apps/docs/content/references/entities/classes/PriceList.mdx
index 38ce5f74dd..b17803c0b0 100644
--- a/www/apps/docs/content/references/entities/classes/PriceList.mdx
+++ b/www/apps/docs/content/references/entities/classes/PriceList.mdx
@@ -22,7 +22,7 @@ A Price List represents a set of prices that override the default price for one
},
{
"name": "customer_groups",
- "type": "[`CustomerGroup`](CustomerGroup.mdx)[]",
+ "type": "[CustomerGroup](CustomerGroup.mdx)[]",
"description": "The details of the customer groups that the Price List can apply to.",
"optional": false,
"defaultValue": "",
@@ -39,7 +39,7 @@ A Price List represents a set of prices that override the default price for one
},
{
"name": "customers",
- "type": "[`Customer`](Customer.mdx)[]",
+ "type": "[Customer](Customer.mdx)[]",
"description": "The details of the customers that belong to the customer group.",
"optional": false,
"defaultValue": "",
@@ -66,7 +66,7 @@ A Price List represents a set of prices that override the default price for one
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -84,7 +84,7 @@ A Price List represents a set of prices that override the default price for one
},
{
"name": "price_lists",
- "type": "[`PriceList`](PriceList.mdx)[]",
+ "type": "[PriceList](PriceList.mdx)[]",
"description": "The price lists that are associated with the customer group.",
"optional": false,
"defaultValue": "",
@@ -159,7 +159,7 @@ A Price List represents a set of prices that override the default price for one
},
{
"name": "prices",
- "type": "[`MoneyAmount`](MoneyAmount.mdx)[]",
+ "type": "[MoneyAmount](MoneyAmount.mdx)[]",
"description": "The prices that belong to the price list, represented as a Money Amount.",
"optional": false,
"defaultValue": "",
@@ -185,7 +185,7 @@ A Price List represents a set of prices that override the default price for one
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency that the money amount may belong to.",
"optional": true,
"defaultValue": "",
@@ -239,7 +239,7 @@ A Price List represents a set of prices that override the default price for one
},
{
"name": "price_list",
- "type": "``null`` \\| [`PriceList`](PriceList.mdx)",
+ "type": "``null`` \\| [PriceList](PriceList.mdx)",
"description": "The details of the price list that the money amount may belong to.",
"optional": false,
"defaultValue": "",
@@ -257,7 +257,7 @@ A Price List represents a set of prices that override the default price for one
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region that the money amount may belong to.",
"optional": true,
"defaultValue": "",
@@ -284,7 +284,7 @@ A Price List represents a set of prices that override the default price for one
},
{
"name": "variant",
- "type": "[`ProductVariant`](ProductVariant.mdx)",
+ "type": "[ProductVariant](ProductVariant.mdx)",
"description": "The details of the product variant that the money amount may belong to.",
"optional": false,
"defaultValue": "",
@@ -302,7 +302,7 @@ A Price List represents a set of prices that override the default price for one
},
{
"name": "variants",
- "type": "[`ProductVariant`](ProductVariant.mdx)[]",
+ "type": "[ProductVariant](ProductVariant.mdx)[]",
"description": "",
"optional": false,
"defaultValue": "",
@@ -322,7 +322,7 @@ A Price List represents a set of prices that override the default price for one
},
{
"name": "status",
- "type": "[`PriceListStatus`](../enums/PriceListStatus.mdx)",
+ "type": "[PriceListStatus](../enums/PriceListStatus.mdx)",
"description": "The status of the Price List",
"optional": false,
"defaultValue": "draft",
@@ -350,7 +350,7 @@ A Price List represents a set of prices that override the default price for one
},
{
"name": "type",
- "type": "[`PriceListType`](../enums/PriceListType.mdx)",
+ "type": "[PriceListType](../enums/PriceListType.mdx)",
"description": "The type of Price List. This can be one of either `sale` or `override`.",
"optional": false,
"defaultValue": "sale",
diff --git a/www/apps/docs/content/references/entities/classes/Product.mdx b/www/apps/docs/content/references/entities/classes/Product.mdx
index fe005540ea..241a804d48 100644
--- a/www/apps/docs/content/references/entities/classes/Product.mdx
+++ b/www/apps/docs/content/references/entities/classes/Product.mdx
@@ -13,7 +13,7 @@ A product is a saleable item that holds general information such as name or desc
",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -212,7 +212,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "The details of the products that belong to this product collection.",
"optional": false,
"defaultValue": "",
@@ -331,7 +331,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "images",
- "type": "[`Image`](Image.mdx)[]",
+ "type": "[Image](Image.mdx)[]",
"description": "The details of the product's images.",
"optional": false,
"defaultValue": "",
@@ -366,7 +366,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -422,7 +422,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -440,7 +440,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "options",
- "type": "[`ProductOption`](ProductOption.mdx)[]",
+ "type": "[ProductOption](ProductOption.mdx)[]",
"description": "The details of the Product Options that are defined for the Product. The product's variants will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
@@ -475,7 +475,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -484,7 +484,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "product",
- "type": "[`Product`](Product.mdx)",
+ "type": "[Product](Product.mdx)",
"description": "The details of the product that this product option belongs to.",
"optional": false,
"defaultValue": "",
@@ -520,7 +520,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "values",
- "type": "[`ProductOptionValue`](ProductOptionValue.mdx)[]",
+ "type": "[ProductOptionValue](ProductOptionValue.mdx)[]",
"description": "The details of the values of the product option.",
"optional": false,
"defaultValue": "",
@@ -540,7 +540,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "profile",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)",
+ "type": "[ShippingProfile](ShippingProfile.mdx)",
"description": "The details of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
"optional": false,
"defaultValue": "",
@@ -575,7 +575,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -593,7 +593,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "The details of the products that the Shipping Profile defines Shipping Options for. Available if the relation `products` is expanded.",
"optional": false,
"defaultValue": "",
@@ -602,7 +602,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "shipping_options",
- "type": "[`ShippingOption`](ShippingOption.mdx)[]",
+ "type": "[ShippingOption](ShippingOption.mdx)[]",
"description": "The details of the shipping options that can be used to create shipping methods for the Products in the Shipping Profile.",
"optional": false,
"defaultValue": "",
@@ -611,8 +611,8 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "type",
- "type": "[`ShippingProfileType`](../enums/ShippingProfileType.mdx)",
- "description": "The type of the Shipping Profile, may be `default`, `gift_card` or `custom`.",
+ "type": "[ShippingProfileType](../enums/ShippingProfileType.mdx)",
+ "description": "The type of the Shipping Profile, may be `default`, `gift\\_card` or `custom`.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -640,7 +640,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "profiles",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)[]",
+ "type": "[ShippingProfile](ShippingProfile.mdx)[]",
"description": "Available if the relation `profiles` is expanded.",
"optional": false,
"defaultValue": "",
@@ -675,7 +675,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -693,7 +693,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "The details of the products that the Shipping Profile defines Shipping Options for. Available if the relation `products` is expanded.",
"optional": false,
"defaultValue": "",
@@ -702,7 +702,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "shipping_options",
- "type": "[`ShippingOption`](ShippingOption.mdx)[]",
+ "type": "[ShippingOption](ShippingOption.mdx)[]",
"description": "The details of the shipping options that can be used to create shipping methods for the Products in the Shipping Profile.",
"optional": false,
"defaultValue": "",
@@ -711,8 +711,8 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "type",
- "type": "[`ShippingProfileType`](../enums/ShippingProfileType.mdx)",
- "description": "The type of the Shipping Profile, may be `default`, `gift_card` or `custom`.",
+ "type": "[ShippingProfileType](../enums/ShippingProfileType.mdx)",
+ "description": "The type of the Shipping Profile, may be `default`, `gift\\_card` or `custom`.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -731,7 +731,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "sales_channels",
- "type": "[`SalesChannel`](SalesChannel.mdx)[]",
+ "type": "[SalesChannel](SalesChannel.mdx)[]",
"description": "The details of the sales channels this product is available in.",
"optional": false,
"defaultValue": "",
@@ -784,7 +784,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "locations",
- "type": "[`SalesChannelLocation`](SalesChannelLocation.mdx)[]",
+ "type": "[SalesChannelLocation](SalesChannelLocation.mdx)[]",
"description": "The details of the stock locations related to the sales channel.",
"optional": false,
"defaultValue": "",
@@ -793,7 +793,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -822,7 +822,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "status",
- "type": "[`ProductStatus`](../enums/ProductStatus.mdx)",
+ "type": "[ProductStatus](../enums/ProductStatus.mdx)",
"description": "The status of the product",
"optional": false,
"defaultValue": "draft",
@@ -877,7 +877,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "tags",
- "type": "[`ProductTag`](ProductTag.mdx)[]",
+ "type": "[ProductTag](ProductTag.mdx)[]",
"description": "The details of the product tags used in this product.",
"optional": false,
"defaultValue": "",
@@ -912,7 +912,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -959,7 +959,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "type",
- "type": "[`ProductType`](ProductType.mdx)",
+ "type": "[ProductType](ProductType.mdx)",
"description": "The details of the product type that the product belongs to.",
"optional": false,
"defaultValue": "",
@@ -994,7 +994,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -1041,7 +1041,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "variants",
- "type": "[`ProductVariant`](ProductVariant.mdx)[]",
+ "type": "[ProductVariant](ProductVariant.mdx)[]",
"description": "The details of the Product Variants that belong to the Product. Each will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
@@ -1050,7 +1050,7 @@ A product is a saleable item that holds general information such as name or desc
{
"name": "allow_backorder",
"type": "`boolean`",
- "description": "Whether the Product Variant should be purchasable when `inventory_quantity` is 0.",
+ "description": "Whether the Product Variant should be purchasable when `inventory\\_quantity` is 0.",
"optional": false,
"defaultValue": "false",
"expandable": false,
@@ -1121,7 +1121,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "inventory_items",
- "type": "[`ProductVariantInventoryItem`](ProductVariantInventoryItem.mdx)[]",
+ "type": "[ProductVariantInventoryItem](ProductVariantInventoryItem.mdx)[]",
"description": "The details inventory items of the product variant.",
"optional": false,
"defaultValue": "",
@@ -1166,7 +1166,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -1184,7 +1184,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "options",
- "type": "[`ProductOptionValue`](ProductOptionValue.mdx)[]",
+ "type": "[ProductOptionValue](ProductOptionValue.mdx)[]",
"description": "The details of the product options that this product variant defines values for.",
"optional": false,
"defaultValue": "",
@@ -1202,7 +1202,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "prices",
- "type": "[`MoneyAmount`](MoneyAmount.mdx)[]",
+ "type": "[MoneyAmount](MoneyAmount.mdx)[]",
"description": "The details of the prices of the Product Variant, each represented as a Money Amount. Each Money Amount represents a price in a given currency or a specific Region.",
"optional": false,
"defaultValue": "",
@@ -1211,7 +1211,7 @@ A product is a saleable item that holds general information such as name or desc
},
{
"name": "product",
- "type": "[`Product`](Product.mdx)",
+ "type": "[Product](Product.mdx)",
"description": "The details of the product that the product variant belongs to.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ProductCategory.mdx b/www/apps/docs/content/references/entities/classes/ProductCategory.mdx
index 9e2a2a0890..50cc1f40a7 100644
--- a/www/apps/docs/content/references/entities/classes/ProductCategory.mdx
+++ b/www/apps/docs/content/references/entities/classes/ProductCategory.mdx
@@ -13,7 +13,7 @@ A product category can be used to categorize products into a hierarchy of catego
",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -410,7 +410,7 @@ A product category can be used to categorize products into a hierarchy of catego
},
{
"name": "options",
- "type": "[`ProductOption`](ProductOption.mdx)[]",
+ "type": "[ProductOption](ProductOption.mdx)[]",
"description": "The details of the Product Options that are defined for the Product. The product's variants will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
@@ -428,7 +428,7 @@ A product category can be used to categorize products into a hierarchy of catego
},
{
"name": "profile",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)",
+ "type": "[ShippingProfile](ShippingProfile.mdx)",
"description": "The details of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
"optional": false,
"defaultValue": "",
@@ -446,7 +446,7 @@ A product category can be used to categorize products into a hierarchy of catego
},
{
"name": "profiles",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)[]",
+ "type": "[ShippingProfile](ShippingProfile.mdx)[]",
"description": "Available if the relation `profiles` is expanded.",
"optional": false,
"defaultValue": "",
@@ -455,7 +455,7 @@ A product category can be used to categorize products into a hierarchy of catego
},
{
"name": "sales_channels",
- "type": "[`SalesChannel`](SalesChannel.mdx)[]",
+ "type": "[SalesChannel](SalesChannel.mdx)[]",
"description": "The details of the sales channels this product is available in.",
"optional": false,
"defaultValue": "",
@@ -464,7 +464,7 @@ A product category can be used to categorize products into a hierarchy of catego
},
{
"name": "status",
- "type": "[`ProductStatus`](../enums/ProductStatus.mdx)",
+ "type": "[ProductStatus](../enums/ProductStatus.mdx)",
"description": "The status of the product",
"optional": false,
"defaultValue": "draft",
@@ -482,7 +482,7 @@ A product category can be used to categorize products into a hierarchy of catego
},
{
"name": "tags",
- "type": "[`ProductTag`](ProductTag.mdx)[]",
+ "type": "[ProductTag](ProductTag.mdx)[]",
"description": "The details of the product tags used in this product.",
"optional": false,
"defaultValue": "",
@@ -509,7 +509,7 @@ A product category can be used to categorize products into a hierarchy of catego
},
{
"name": "type",
- "type": "[`ProductType`](ProductType.mdx)",
+ "type": "[ProductType](ProductType.mdx)",
"description": "The details of the product type that the product belongs to.",
"optional": false,
"defaultValue": "",
@@ -536,7 +536,7 @@ A product category can be used to categorize products into a hierarchy of catego
},
{
"name": "variants",
- "type": "[`ProductVariant`](ProductVariant.mdx)[]",
+ "type": "[ProductVariant](ProductVariant.mdx)[]",
"description": "The details of the Product Variants that belong to the Product. Each will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ProductCollection.mdx b/www/apps/docs/content/references/entities/classes/ProductCollection.mdx
index e5feec6ac4..c6cace393d 100644
--- a/www/apps/docs/content/references/entities/classes/ProductCollection.mdx
+++ b/www/apps/docs/content/references/entities/classes/ProductCollection.mdx
@@ -49,7 +49,7 @@ A Product Collection allows grouping together products for promotional purposes.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -58,7 +58,7 @@ A Product Collection allows grouping together products for promotional purposes.
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "The details of the products that belong to this product collection.",
"optional": false,
"defaultValue": "",
@@ -66,7 +66,7 @@ A Product Collection allows grouping together products for promotional purposes.
"children": [
{
"name": "categories",
- "type": "[`ProductCategory`](ProductCategory.mdx)[]",
+ "type": "[ProductCategory](ProductCategory.mdx)[]",
"description": "The details of the product categories that this product belongs to.",
"optional": false,
"defaultValue": "",
@@ -76,7 +76,7 @@ A Product Collection allows grouping together products for promotional purposes.
},
{
"name": "collection",
- "type": "[`ProductCollection`](ProductCollection.mdx)",
+ "type": "[ProductCollection](ProductCollection.mdx)",
"description": "The details of the product collection that the product belongs to.",
"optional": false,
"defaultValue": "",
@@ -175,7 +175,7 @@ A Product Collection allows grouping together products for promotional purposes.
},
{
"name": "images",
- "type": "[`Image`](Image.mdx)[]",
+ "type": "[Image](Image.mdx)[]",
"description": "The details of the product's images.",
"optional": false,
"defaultValue": "",
@@ -211,7 +211,7 @@ A Product Collection allows grouping together products for promotional purposes.
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -229,7 +229,7 @@ A Product Collection allows grouping together products for promotional purposes.
},
{
"name": "options",
- "type": "[`ProductOption`](ProductOption.mdx)[]",
+ "type": "[ProductOption](ProductOption.mdx)[]",
"description": "The details of the Product Options that are defined for the Product. The product's variants will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
@@ -247,7 +247,7 @@ A Product Collection allows grouping together products for promotional purposes.
},
{
"name": "profile",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)",
+ "type": "[ShippingProfile](ShippingProfile.mdx)",
"description": "The details of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
"optional": false,
"defaultValue": "",
@@ -265,7 +265,7 @@ A Product Collection allows grouping together products for promotional purposes.
},
{
"name": "profiles",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)[]",
+ "type": "[ShippingProfile](ShippingProfile.mdx)[]",
"description": "Available if the relation `profiles` is expanded.",
"optional": false,
"defaultValue": "",
@@ -274,7 +274,7 @@ A Product Collection allows grouping together products for promotional purposes.
},
{
"name": "sales_channels",
- "type": "[`SalesChannel`](SalesChannel.mdx)[]",
+ "type": "[SalesChannel](SalesChannel.mdx)[]",
"description": "The details of the sales channels this product is available in.",
"optional": false,
"defaultValue": "",
@@ -283,7 +283,7 @@ A Product Collection allows grouping together products for promotional purposes.
},
{
"name": "status",
- "type": "[`ProductStatus`](../enums/ProductStatus.mdx)",
+ "type": "[ProductStatus](../enums/ProductStatus.mdx)",
"description": "The status of the product",
"optional": false,
"defaultValue": "draft",
@@ -301,7 +301,7 @@ A Product Collection allows grouping together products for promotional purposes.
},
{
"name": "tags",
- "type": "[`ProductTag`](ProductTag.mdx)[]",
+ "type": "[ProductTag](ProductTag.mdx)[]",
"description": "The details of the product tags used in this product.",
"optional": false,
"defaultValue": "",
@@ -328,7 +328,7 @@ A Product Collection allows grouping together products for promotional purposes.
},
{
"name": "type",
- "type": "[`ProductType`](ProductType.mdx)",
+ "type": "[ProductType](ProductType.mdx)",
"description": "The details of the product type that the product belongs to.",
"optional": false,
"defaultValue": "",
@@ -355,7 +355,7 @@ A Product Collection allows grouping together products for promotional purposes.
},
{
"name": "variants",
- "type": "[`ProductVariant`](ProductVariant.mdx)[]",
+ "type": "[ProductVariant](ProductVariant.mdx)[]",
"description": "The details of the Product Variants that belong to the Product. Each will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ProductOption.mdx b/www/apps/docs/content/references/entities/classes/ProductOption.mdx
index 289966e6be..85d2766c92 100644
--- a/www/apps/docs/content/references/entities/classes/ProductOption.mdx
+++ b/www/apps/docs/content/references/entities/classes/ProductOption.mdx
@@ -40,7 +40,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -49,7 +49,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "product",
- "type": "[`Product`](Product.mdx)",
+ "type": "[Product](Product.mdx)",
"description": "The details of the product that this product option belongs to.",
"optional": false,
"defaultValue": "",
@@ -57,7 +57,7 @@ A Product Option defines properties that may vary between different variants of
"children": [
{
"name": "categories",
- "type": "[`ProductCategory`](ProductCategory.mdx)[]",
+ "type": "[ProductCategory](ProductCategory.mdx)[]",
"description": "The details of the product categories that this product belongs to.",
"optional": false,
"defaultValue": "",
@@ -67,7 +67,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "collection",
- "type": "[`ProductCollection`](ProductCollection.mdx)",
+ "type": "[ProductCollection](ProductCollection.mdx)",
"description": "The details of the product collection that the product belongs to.",
"optional": false,
"defaultValue": "",
@@ -166,7 +166,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "images",
- "type": "[`Image`](Image.mdx)[]",
+ "type": "[Image](Image.mdx)[]",
"description": "The details of the product's images.",
"optional": false,
"defaultValue": "",
@@ -202,7 +202,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -220,7 +220,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "options",
- "type": "[`ProductOption`](ProductOption.mdx)[]",
+ "type": "[ProductOption](ProductOption.mdx)[]",
"description": "The details of the Product Options that are defined for the Product. The product's variants will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
@@ -238,7 +238,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "profile",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)",
+ "type": "[ShippingProfile](ShippingProfile.mdx)",
"description": "The details of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
"optional": false,
"defaultValue": "",
@@ -256,7 +256,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "profiles",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)[]",
+ "type": "[ShippingProfile](ShippingProfile.mdx)[]",
"description": "Available if the relation `profiles` is expanded.",
"optional": false,
"defaultValue": "",
@@ -265,7 +265,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "sales_channels",
- "type": "[`SalesChannel`](SalesChannel.mdx)[]",
+ "type": "[SalesChannel](SalesChannel.mdx)[]",
"description": "The details of the sales channels this product is available in.",
"optional": false,
"defaultValue": "",
@@ -274,7 +274,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "status",
- "type": "[`ProductStatus`](../enums/ProductStatus.mdx)",
+ "type": "[ProductStatus](../enums/ProductStatus.mdx)",
"description": "The status of the product",
"optional": false,
"defaultValue": "draft",
@@ -292,7 +292,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "tags",
- "type": "[`ProductTag`](ProductTag.mdx)[]",
+ "type": "[ProductTag](ProductTag.mdx)[]",
"description": "The details of the product tags used in this product.",
"optional": false,
"defaultValue": "",
@@ -319,7 +319,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "type",
- "type": "[`ProductType`](ProductType.mdx)",
+ "type": "[ProductType](ProductType.mdx)",
"description": "The details of the product type that the product belongs to.",
"optional": false,
"defaultValue": "",
@@ -346,7 +346,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "variants",
- "type": "[`ProductVariant`](ProductVariant.mdx)[]",
+ "type": "[ProductVariant](ProductVariant.mdx)[]",
"description": "The details of the Product Variants that belong to the Product. Each will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
@@ -402,7 +402,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "values",
- "type": "[`ProductOptionValue`](ProductOptionValue.mdx)[]",
+ "type": "[ProductOptionValue](ProductOptionValue.mdx)[]",
"description": "The details of the values of the product option.",
"optional": false,
"defaultValue": "",
@@ -437,7 +437,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -446,7 +446,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "option",
- "type": "[`ProductOption`](ProductOption.mdx)",
+ "type": "[ProductOption](ProductOption.mdx)",
"description": "The details of the product option that the Product Option Value belongs to.",
"optional": false,
"defaultValue": "",
@@ -482,7 +482,7 @@ A Product Option defines properties that may vary between different variants of
},
{
"name": "variant",
- "type": "[`ProductVariant`](ProductVariant.mdx)",
+ "type": "[ProductVariant](ProductVariant.mdx)",
"description": "The details of the product variant that uses this product option value.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ProductOptionValue.mdx b/www/apps/docs/content/references/entities/classes/ProductOptionValue.mdx
index 581e3c995f..530b8797ae 100644
--- a/www/apps/docs/content/references/entities/classes/ProductOptionValue.mdx
+++ b/www/apps/docs/content/references/entities/classes/ProductOptionValue.mdx
@@ -40,7 +40,7 @@ An option value is one of the possible values of a Product Option. Product Varia
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -49,7 +49,7 @@ An option value is one of the possible values of a Product Option. Product Varia
},
{
"name": "option",
- "type": "[`ProductOption`](ProductOption.mdx)",
+ "type": "[ProductOption](ProductOption.mdx)",
"description": "The details of the product option that the Product Option Value belongs to.",
"optional": false,
"defaultValue": "",
@@ -84,7 +84,7 @@ An option value is one of the possible values of a Product Option. Product Varia
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -93,7 +93,7 @@ An option value is one of the possible values of a Product Option. Product Varia
},
{
"name": "product",
- "type": "[`Product`](Product.mdx)",
+ "type": "[Product](Product.mdx)",
"description": "The details of the product that this product option belongs to.",
"optional": false,
"defaultValue": "",
@@ -129,7 +129,7 @@ An option value is one of the possible values of a Product Option. Product Varia
},
{
"name": "values",
- "type": "[`ProductOptionValue`](ProductOptionValue.mdx)[]",
+ "type": "[ProductOptionValue](ProductOptionValue.mdx)[]",
"description": "The details of the values of the product option.",
"optional": false,
"defaultValue": "",
@@ -167,7 +167,7 @@ An option value is one of the possible values of a Product Option. Product Varia
},
{
"name": "variant",
- "type": "[`ProductVariant`](ProductVariant.mdx)",
+ "type": "[ProductVariant](ProductVariant.mdx)",
"description": "The details of the product variant that uses this product option value.",
"optional": false,
"defaultValue": "",
@@ -176,7 +176,7 @@ An option value is one of the possible values of a Product Option. Product Varia
{
"name": "allow_backorder",
"type": "`boolean`",
- "description": "Whether the Product Variant should be purchasable when `inventory_quantity` is 0.",
+ "description": "Whether the Product Variant should be purchasable when `inventory\\_quantity` is 0.",
"optional": false,
"defaultValue": "false",
"expandable": false,
@@ -247,7 +247,7 @@ An option value is one of the possible values of a Product Option. Product Varia
},
{
"name": "inventory_items",
- "type": "[`ProductVariantInventoryItem`](ProductVariantInventoryItem.mdx)[]",
+ "type": "[ProductVariantInventoryItem](ProductVariantInventoryItem.mdx)[]",
"description": "The details inventory items of the product variant.",
"optional": false,
"defaultValue": "",
@@ -292,7 +292,7 @@ An option value is one of the possible values of a Product Option. Product Varia
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -310,7 +310,7 @@ An option value is one of the possible values of a Product Option. Product Varia
},
{
"name": "options",
- "type": "[`ProductOptionValue`](ProductOptionValue.mdx)[]",
+ "type": "[ProductOptionValue](ProductOptionValue.mdx)[]",
"description": "The details of the product options that this product variant defines values for.",
"optional": false,
"defaultValue": "",
@@ -328,7 +328,7 @@ An option value is one of the possible values of a Product Option. Product Varia
},
{
"name": "prices",
- "type": "[`MoneyAmount`](MoneyAmount.mdx)[]",
+ "type": "[MoneyAmount](MoneyAmount.mdx)[]",
"description": "The details of the prices of the Product Variant, each represented as a Money Amount. Each Money Amount represents a price in a given currency or a specific Region.",
"optional": false,
"defaultValue": "",
@@ -337,7 +337,7 @@ An option value is one of the possible values of a Product Option. Product Varia
},
{
"name": "product",
- "type": "[`Product`](Product.mdx)",
+ "type": "[Product](Product.mdx)",
"description": "The details of the product that the product variant belongs to.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ProductTag.mdx b/www/apps/docs/content/references/entities/classes/ProductTag.mdx
index f1cd9e1f72..12336654b5 100644
--- a/www/apps/docs/content/references/entities/classes/ProductTag.mdx
+++ b/www/apps/docs/content/references/entities/classes/ProductTag.mdx
@@ -40,7 +40,7 @@ A Product Tag can be added to Products for easy filtering and grouping.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ProductTaxRate.mdx b/www/apps/docs/content/references/entities/classes/ProductTaxRate.mdx
index b0e31f3236..7be5ba1bec 100644
--- a/www/apps/docs/content/references/entities/classes/ProductTaxRate.mdx
+++ b/www/apps/docs/content/references/entities/classes/ProductTaxRate.mdx
@@ -22,7 +22,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -31,7 +31,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "product",
- "type": "[`Product`](Product.mdx)",
+ "type": "[Product](Product.mdx)",
"description": "The details of the product.",
"optional": true,
"defaultValue": "",
@@ -39,7 +39,7 @@ This represents the association between a tax rate and a product to indicate tha
"children": [
{
"name": "categories",
- "type": "[`ProductCategory`](ProductCategory.mdx)[]",
+ "type": "[ProductCategory](ProductCategory.mdx)[]",
"description": "The details of the product categories that this product belongs to.",
"optional": false,
"defaultValue": "",
@@ -49,7 +49,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "collection",
- "type": "[`ProductCollection`](ProductCollection.mdx)",
+ "type": "[ProductCollection](ProductCollection.mdx)",
"description": "The details of the product collection that the product belongs to.",
"optional": false,
"defaultValue": "",
@@ -148,7 +148,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "images",
- "type": "[`Image`](Image.mdx)[]",
+ "type": "[Image](Image.mdx)[]",
"description": "The details of the product's images.",
"optional": false,
"defaultValue": "",
@@ -184,7 +184,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -202,7 +202,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "options",
- "type": "[`ProductOption`](ProductOption.mdx)[]",
+ "type": "[ProductOption](ProductOption.mdx)[]",
"description": "The details of the Product Options that are defined for the Product. The product's variants will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
@@ -220,7 +220,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "profile",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)",
+ "type": "[ShippingProfile](ShippingProfile.mdx)",
"description": "The details of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
"optional": false,
"defaultValue": "",
@@ -238,7 +238,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "profiles",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)[]",
+ "type": "[ShippingProfile](ShippingProfile.mdx)[]",
"description": "Available if the relation `profiles` is expanded.",
"optional": false,
"defaultValue": "",
@@ -247,7 +247,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "sales_channels",
- "type": "[`SalesChannel`](SalesChannel.mdx)[]",
+ "type": "[SalesChannel](SalesChannel.mdx)[]",
"description": "The details of the sales channels this product is available in.",
"optional": false,
"defaultValue": "",
@@ -256,7 +256,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "status",
- "type": "[`ProductStatus`](../enums/ProductStatus.mdx)",
+ "type": "[ProductStatus](../enums/ProductStatus.mdx)",
"description": "The status of the product",
"optional": false,
"defaultValue": "draft",
@@ -274,7 +274,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "tags",
- "type": "[`ProductTag`](ProductTag.mdx)[]",
+ "type": "[ProductTag](ProductTag.mdx)[]",
"description": "The details of the product tags used in this product.",
"optional": false,
"defaultValue": "",
@@ -301,7 +301,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "type",
- "type": "[`ProductType`](ProductType.mdx)",
+ "type": "[ProductType](ProductType.mdx)",
"description": "The details of the product type that the product belongs to.",
"optional": false,
"defaultValue": "",
@@ -328,7 +328,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "variants",
- "type": "[`ProductVariant`](ProductVariant.mdx)[]",
+ "type": "[ProductVariant](ProductVariant.mdx)[]",
"description": "The details of the Product Variants that belong to the Product. Each will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
@@ -375,7 +375,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "tax_rate",
- "type": "[`TaxRate`](TaxRate.mdx)",
+ "type": "[TaxRate](TaxRate.mdx)",
"description": "The details of the tax rate.",
"optional": true,
"defaultValue": "",
@@ -410,7 +410,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -446,7 +446,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "product_types",
- "type": "[`ProductType`](ProductType.mdx)[]",
+ "type": "[ProductType](ProductType.mdx)[]",
"description": "The details of the product types that belong to this tax rate.",
"optional": false,
"defaultValue": "",
@@ -455,7 +455,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "The details of the products that belong to this tax rate.",
"optional": false,
"defaultValue": "",
@@ -473,7 +473,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region that the rate belongs to.",
"optional": false,
"defaultValue": "",
@@ -500,7 +500,7 @@ This represents the association between a tax rate and a product to indicate tha
},
{
"name": "shipping_options",
- "type": "[`ShippingOption`](ShippingOption.mdx)[]",
+ "type": "[ShippingOption](ShippingOption.mdx)[]",
"description": "The details of the shipping options that belong to this tax rate.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ProductType.mdx b/www/apps/docs/content/references/entities/classes/ProductType.mdx
index 2a227a2f96..67d5b340bf 100644
--- a/www/apps/docs/content/references/entities/classes/ProductType.mdx
+++ b/www/apps/docs/content/references/entities/classes/ProductType.mdx
@@ -40,7 +40,7 @@ A Product Type can be added to Products for filtering and reporting purposes.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ProductTypeTaxRate.mdx b/www/apps/docs/content/references/entities/classes/ProductTypeTaxRate.mdx
index 698c6e1e43..2a184d5514 100644
--- a/www/apps/docs/content/references/entities/classes/ProductTypeTaxRate.mdx
+++ b/www/apps/docs/content/references/entities/classes/ProductTypeTaxRate.mdx
@@ -22,7 +22,7 @@ This represents the association between a tax rate and a product type to indicat
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -31,7 +31,7 @@ This represents the association between a tax rate and a product type to indicat
},
{
"name": "product_type",
- "type": "[`ProductType`](ProductType.mdx)",
+ "type": "[ProductType](ProductType.mdx)",
"description": "The details of the product type.",
"optional": true,
"defaultValue": "",
@@ -66,7 +66,7 @@ This represents the association between a tax rate and a product type to indicat
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -113,7 +113,7 @@ This represents the association between a tax rate and a product type to indicat
},
{
"name": "tax_rate",
- "type": "[`TaxRate`](TaxRate.mdx)",
+ "type": "[TaxRate](TaxRate.mdx)",
"description": "The details of the tax rate.",
"optional": true,
"defaultValue": "",
@@ -148,7 +148,7 @@ This represents the association between a tax rate and a product type to indicat
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -184,7 +184,7 @@ This represents the association between a tax rate and a product type to indicat
},
{
"name": "product_types",
- "type": "[`ProductType`](ProductType.mdx)[]",
+ "type": "[ProductType](ProductType.mdx)[]",
"description": "The details of the product types that belong to this tax rate.",
"optional": false,
"defaultValue": "",
@@ -193,7 +193,7 @@ This represents the association between a tax rate and a product type to indicat
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "The details of the products that belong to this tax rate.",
"optional": false,
"defaultValue": "",
@@ -211,7 +211,7 @@ This represents the association between a tax rate and a product type to indicat
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region that the rate belongs to.",
"optional": false,
"defaultValue": "",
@@ -238,7 +238,7 @@ This represents the association between a tax rate and a product type to indicat
},
{
"name": "shipping_options",
- "type": "[`ShippingOption`](ShippingOption.mdx)[]",
+ "type": "[ShippingOption](ShippingOption.mdx)[]",
"description": "The details of the shipping options that belong to this tax rate.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ProductVariant.mdx b/www/apps/docs/content/references/entities/classes/ProductVariant.mdx
index 71b3f5fdb6..e763960845 100644
--- a/www/apps/docs/content/references/entities/classes/ProductVariant.mdx
+++ b/www/apps/docs/content/references/entities/classes/ProductVariant.mdx
@@ -14,7 +14,7 @@ A Product Variant represents a Product with a specific set of Product Option con
{
"name": "allow_backorder",
"type": "`boolean`",
- "description": "Whether the Product Variant should be purchasable when `inventory_quantity` is 0.",
+ "description": "Whether the Product Variant should be purchasable when `inventory\\_quantity` is 0.",
"optional": false,
"defaultValue": "false",
"expandable": false,
@@ -85,7 +85,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "inventory_items",
- "type": "[`ProductVariantInventoryItem`](ProductVariantInventoryItem.mdx)[]",
+ "type": "[ProductVariantInventoryItem](ProductVariantInventoryItem.mdx)[]",
"description": "The details inventory items of the product variant.",
"optional": false,
"defaultValue": "",
@@ -147,7 +147,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "variant",
- "type": "[`ProductVariant`](ProductVariant.mdx)",
+ "type": "[ProductVariant](ProductVariant.mdx)",
"description": "The details of the product variant.",
"optional": false,
"defaultValue": "",
@@ -203,7 +203,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -221,7 +221,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "options",
- "type": "[`ProductOptionValue`](ProductOptionValue.mdx)[]",
+ "type": "[ProductOptionValue](ProductOptionValue.mdx)[]",
"description": "The details of the product options that this product variant defines values for.",
"optional": false,
"defaultValue": "",
@@ -256,7 +256,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -265,7 +265,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "option",
- "type": "[`ProductOption`](ProductOption.mdx)",
+ "type": "[ProductOption](ProductOption.mdx)",
"description": "The details of the product option that the Product Option Value belongs to.",
"optional": false,
"defaultValue": "",
@@ -301,7 +301,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "variant",
- "type": "[`ProductVariant`](ProductVariant.mdx)",
+ "type": "[ProductVariant](ProductVariant.mdx)",
"description": "The details of the product variant that uses this product option value.",
"optional": false,
"defaultValue": "",
@@ -330,7 +330,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "prices",
- "type": "[`MoneyAmount`](MoneyAmount.mdx)[]",
+ "type": "[MoneyAmount](MoneyAmount.mdx)[]",
"description": "The details of the prices of the Product Variant, each represented as a Money Amount. Each Money Amount represents a price in a given currency or a specific Region.",
"optional": false,
"defaultValue": "",
@@ -356,7 +356,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency that the money amount may belong to.",
"optional": true,
"defaultValue": "",
@@ -410,7 +410,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "price_list",
- "type": "``null`` \\| [`PriceList`](PriceList.mdx)",
+ "type": "``null`` \\| [PriceList](PriceList.mdx)",
"description": "The details of the price list that the money amount may belong to.",
"optional": false,
"defaultValue": "",
@@ -428,7 +428,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region that the money amount may belong to.",
"optional": true,
"defaultValue": "",
@@ -455,7 +455,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "variant",
- "type": "[`ProductVariant`](ProductVariant.mdx)",
+ "type": "[ProductVariant](ProductVariant.mdx)",
"description": "The details of the product variant that the money amount may belong to.",
"optional": false,
"defaultValue": "",
@@ -473,7 +473,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "variants",
- "type": "[`ProductVariant`](ProductVariant.mdx)[]",
+ "type": "[ProductVariant](ProductVariant.mdx)[]",
"description": "",
"optional": false,
"defaultValue": "",
@@ -484,7 +484,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "product",
- "type": "[`Product`](Product.mdx)",
+ "type": "[Product](Product.mdx)",
"description": "The details of the product that the product variant belongs to.",
"optional": false,
"defaultValue": "",
@@ -492,7 +492,7 @@ A Product Variant represents a Product with a specific set of Product Option con
"children": [
{
"name": "categories",
- "type": "[`ProductCategory`](ProductCategory.mdx)[]",
+ "type": "[ProductCategory](ProductCategory.mdx)[]",
"description": "The details of the product categories that this product belongs to.",
"optional": false,
"defaultValue": "",
@@ -502,7 +502,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "collection",
- "type": "[`ProductCollection`](ProductCollection.mdx)",
+ "type": "[ProductCollection](ProductCollection.mdx)",
"description": "The details of the product collection that the product belongs to.",
"optional": false,
"defaultValue": "",
@@ -601,7 +601,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "images",
- "type": "[`Image`](Image.mdx)[]",
+ "type": "[Image](Image.mdx)[]",
"description": "The details of the product's images.",
"optional": false,
"defaultValue": "",
@@ -637,7 +637,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -655,7 +655,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "options",
- "type": "[`ProductOption`](ProductOption.mdx)[]",
+ "type": "[ProductOption](ProductOption.mdx)[]",
"description": "The details of the Product Options that are defined for the Product. The product's variants will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
@@ -673,7 +673,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "profile",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)",
+ "type": "[ShippingProfile](ShippingProfile.mdx)",
"description": "The details of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
"optional": false,
"defaultValue": "",
@@ -691,7 +691,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "profiles",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)[]",
+ "type": "[ShippingProfile](ShippingProfile.mdx)[]",
"description": "Available if the relation `profiles` is expanded.",
"optional": false,
"defaultValue": "",
@@ -700,7 +700,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "sales_channels",
- "type": "[`SalesChannel`](SalesChannel.mdx)[]",
+ "type": "[SalesChannel](SalesChannel.mdx)[]",
"description": "The details of the sales channels this product is available in.",
"optional": false,
"defaultValue": "",
@@ -709,7 +709,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "status",
- "type": "[`ProductStatus`](../enums/ProductStatus.mdx)",
+ "type": "[ProductStatus](../enums/ProductStatus.mdx)",
"description": "The status of the product",
"optional": false,
"defaultValue": "draft",
@@ -727,7 +727,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "tags",
- "type": "[`ProductTag`](ProductTag.mdx)[]",
+ "type": "[ProductTag](ProductTag.mdx)[]",
"description": "The details of the product tags used in this product.",
"optional": false,
"defaultValue": "",
@@ -754,7 +754,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "type",
- "type": "[`ProductType`](ProductType.mdx)",
+ "type": "[ProductType](ProductType.mdx)",
"description": "The details of the product type that the product belongs to.",
"optional": false,
"defaultValue": "",
@@ -781,7 +781,7 @@ A Product Variant represents a Product with a specific set of Product Option con
},
{
"name": "variants",
- "type": "[`ProductVariant`](ProductVariant.mdx)[]",
+ "type": "[ProductVariant](ProductVariant.mdx)[]",
"description": "The details of the Product Variants that belong to the Product. Each will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ProductVariantInventoryItem.mdx b/www/apps/docs/content/references/entities/classes/ProductVariantInventoryItem.mdx
index 3c22e88ac4..498749ed2e 100644
--- a/www/apps/docs/content/references/entities/classes/ProductVariantInventoryItem.mdx
+++ b/www/apps/docs/content/references/entities/classes/ProductVariantInventoryItem.mdx
@@ -67,7 +67,7 @@ A Product Variant Inventory Item links variants with inventory items and denotes
},
{
"name": "variant",
- "type": "[`ProductVariant`](ProductVariant.mdx)",
+ "type": "[ProductVariant](ProductVariant.mdx)",
"description": "The details of the product variant.",
"optional": false,
"defaultValue": "",
@@ -76,7 +76,7 @@ A Product Variant Inventory Item links variants with inventory items and denotes
{
"name": "allow_backorder",
"type": "`boolean`",
- "description": "Whether the Product Variant should be purchasable when `inventory_quantity` is 0.",
+ "description": "Whether the Product Variant should be purchasable when `inventory\\_quantity` is 0.",
"optional": false,
"defaultValue": "false",
"expandable": false,
@@ -147,7 +147,7 @@ A Product Variant Inventory Item links variants with inventory items and denotes
},
{
"name": "inventory_items",
- "type": "[`ProductVariantInventoryItem`](ProductVariantInventoryItem.mdx)[]",
+ "type": "[ProductVariantInventoryItem](ProductVariantInventoryItem.mdx)[]",
"description": "The details inventory items of the product variant.",
"optional": false,
"defaultValue": "",
@@ -192,7 +192,7 @@ A Product Variant Inventory Item links variants with inventory items and denotes
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -210,7 +210,7 @@ A Product Variant Inventory Item links variants with inventory items and denotes
},
{
"name": "options",
- "type": "[`ProductOptionValue`](ProductOptionValue.mdx)[]",
+ "type": "[ProductOptionValue](ProductOptionValue.mdx)[]",
"description": "The details of the product options that this product variant defines values for.",
"optional": false,
"defaultValue": "",
@@ -228,7 +228,7 @@ A Product Variant Inventory Item links variants with inventory items and denotes
},
{
"name": "prices",
- "type": "[`MoneyAmount`](MoneyAmount.mdx)[]",
+ "type": "[MoneyAmount](MoneyAmount.mdx)[]",
"description": "The details of the prices of the Product Variant, each represented as a Money Amount. Each Money Amount represents a price in a given currency or a specific Region.",
"optional": false,
"defaultValue": "",
@@ -237,7 +237,7 @@ A Product Variant Inventory Item links variants with inventory items and denotes
},
{
"name": "product",
- "type": "[`Product`](Product.mdx)",
+ "type": "[Product](Product.mdx)",
"description": "The details of the product that the product variant belongs to.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/Refund.mdx b/www/apps/docs/content/references/entities/classes/Refund.mdx
index 474b16eaec..a79a3549a4 100644
--- a/www/apps/docs/content/references/entities/classes/Refund.mdx
+++ b/www/apps/docs/content/references/entities/classes/Refund.mdx
@@ -49,7 +49,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -67,7 +67,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order this refund was created for.",
"optional": false,
"defaultValue": "",
@@ -75,7 +75,7 @@ A refund represents an amount of money transfered back to the customer for a giv
"children": [
{
"name": "billing_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the billing address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -102,7 +102,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart associated with the order.",
"optional": false,
"defaultValue": "",
@@ -120,7 +120,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "claims",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)[]",
+ "type": "[ClaimOrder](ClaimOrder.mdx)[]",
"description": "The details of the claims created for the order.",
"optional": false,
"defaultValue": "",
@@ -138,7 +138,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency used in the order.",
"optional": false,
"defaultValue": "",
@@ -156,7 +156,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "customer",
- "type": "[`Customer`](Customer.mdx)",
+ "type": "[Customer](Customer.mdx)",
"description": "The details of the customer associated with the order.",
"optional": false,
"defaultValue": "",
@@ -183,7 +183,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "discounts",
- "type": "[`Discount`](Discount.mdx)[]",
+ "type": "[Discount](Discount.mdx)[]",
"description": "The details of the discounts applied on the order.",
"optional": false,
"defaultValue": "",
@@ -201,7 +201,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "draft_order",
- "type": "[`DraftOrder`](DraftOrder.mdx)",
+ "type": "[DraftOrder](DraftOrder.mdx)",
"description": "The details of the draft order this order was created from.",
"optional": false,
"defaultValue": "",
@@ -219,7 +219,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "edits",
- "type": "[`OrderEdit`](OrderEdit.mdx)[]",
+ "type": "[OrderEdit](OrderEdit.mdx)[]",
"description": "The details of the order edits done on the order.",
"optional": false,
"defaultValue": "",
@@ -246,7 +246,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "fulfillment_status",
- "type": "[`FulfillmentStatus`](../enums/FulfillmentStatus.mdx)",
+ "type": "[FulfillmentStatus](../enums/FulfillmentStatus.mdx)",
"description": "The order's fulfillment status",
"optional": false,
"defaultValue": "not_fulfilled",
@@ -255,7 +255,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "fulfillments",
- "type": "[`Fulfillment`](Fulfillment.mdx)[]",
+ "type": "[Fulfillment](Fulfillment.mdx)[]",
"description": "The details of the fulfillments created for the order.",
"optional": false,
"defaultValue": "",
@@ -282,7 +282,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "gift_card_transactions",
- "type": "[`GiftCardTransaction`](GiftCardTransaction.mdx)[]",
+ "type": "[GiftCardTransaction](GiftCardTransaction.mdx)[]",
"description": "The gift card transactions made in the order.",
"optional": false,
"defaultValue": "",
@@ -291,7 +291,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "gift_cards",
- "type": "[`GiftCard`](GiftCard.mdx)[]",
+ "type": "[GiftCard](GiftCard.mdx)[]",
"description": "The details of the gift card used in the order.",
"optional": false,
"defaultValue": "",
@@ -327,7 +327,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that belong to the order.",
"optional": false,
"defaultValue": "",
@@ -336,7 +336,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -372,7 +372,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "payment_status",
- "type": "[`PaymentStatus`](../enums/PaymentStatus.mdx)",
+ "type": "[PaymentStatus](../enums/PaymentStatus.mdx)",
"description": "The order's payment status",
"optional": false,
"defaultValue": "not_paid",
@@ -381,7 +381,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "payments",
- "type": "[`Payment`](Payment.mdx)[]",
+ "type": "[Payment](Payment.mdx)[]",
"description": "The details of the payments used in the order.",
"optional": false,
"defaultValue": "",
@@ -417,7 +417,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "refunds",
- "type": "[`Refund`](Refund.mdx)[]",
+ "type": "[Refund](Refund.mdx)[]",
"description": "The details of the refunds created for the order.",
"optional": false,
"defaultValue": "",
@@ -426,7 +426,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this order was created in.",
"optional": false,
"defaultValue": "",
@@ -444,7 +444,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "returnable_items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
"optional": true,
"defaultValue": "",
@@ -453,7 +453,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "returns",
- "type": "[`Return`](Return.mdx)[]",
+ "type": "[Return](Return.mdx)[]",
"description": "The details of the returns created for the order.",
"optional": false,
"defaultValue": "",
@@ -462,7 +462,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "sales_channel",
- "type": "[`SalesChannel`](SalesChannel.mdx)",
+ "type": "[SalesChannel](SalesChannel.mdx)",
"description": "The details of the sales channel this order belongs to.",
"optional": false,
"defaultValue": "",
@@ -480,7 +480,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the shipping address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -498,7 +498,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods used in the order.",
"optional": false,
"defaultValue": "",
@@ -525,7 +525,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "status",
- "type": "[`OrderStatus`](../enums/OrderStatus.mdx)",
+ "type": "[OrderStatus](../enums/OrderStatus.mdx)",
"description": "The order's status",
"optional": false,
"defaultValue": "pending",
@@ -543,7 +543,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "swaps",
- "type": "[`Swap`](Swap.mdx)[]",
+ "type": "[Swap](Swap.mdx)[]",
"description": "The details of the swaps created for the order.",
"optional": false,
"defaultValue": "",
@@ -599,7 +599,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "payment",
- "type": "[`Payment`](Payment.mdx)",
+ "type": "[Payment](Payment.mdx)",
"description": "The details of the payment associated with the refund.",
"optional": false,
"defaultValue": "",
@@ -643,7 +643,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart that the payment session was potentially created for.",
"optional": false,
"defaultValue": "",
@@ -670,7 +670,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency of the payment.",
"optional": false,
"defaultValue": "",
@@ -688,7 +688,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The data required for the Payment Provider to identify, modify and process the Payment. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state.",
"optional": false,
"defaultValue": "",
@@ -715,7 +715,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -724,7 +724,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the payment session was potentially created for.",
"optional": false,
"defaultValue": "",
@@ -751,7 +751,7 @@ A refund represents an amount of money transfered back to the customer for a giv
},
{
"name": "swap",
- "type": "[`Swap`](Swap.mdx)",
+ "type": "[Swap](Swap.mdx)",
"description": "The details of the swap that this payment was potentially created for.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/Region.mdx b/www/apps/docs/content/references/entities/classes/Region.mdx
index e0aa3ac880..3ea4f4dd23 100644
--- a/www/apps/docs/content/references/entities/classes/Region.mdx
+++ b/www/apps/docs/content/references/entities/classes/Region.mdx
@@ -22,7 +22,7 @@ A region holds settings specific to a geographical location, including the curre
},
{
"name": "countries",
- "type": "[`Country`](Country.mdx)[]",
+ "type": "[Country](Country.mdx)[]",
"description": "The details of the countries included in this region.",
"optional": false,
"defaultValue": "",
@@ -84,7 +84,7 @@ A region holds settings specific to a geographical location, including the curre
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region the country is associated with.",
"optional": false,
"defaultValue": "",
@@ -113,7 +113,7 @@ A region holds settings specific to a geographical location, including the curre
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency used in the region.",
"optional": false,
"defaultValue": "",
@@ -187,7 +187,7 @@ A region holds settings specific to a geographical location, including the curre
},
{
"name": "fulfillment_providers",
- "type": "[`FulfillmentProvider`](FulfillmentProvider.mdx)[]",
+ "type": "[FulfillmentProvider](FulfillmentProvider.mdx)[]",
"description": "The details of the fulfillment providers that can be used to fulfill items of orders and similar resources in the region.",
"optional": false,
"defaultValue": "",
@@ -205,7 +205,7 @@ A region holds settings specific to a geographical location, including the curre
{
"name": "is_installed",
"type": "`boolean`",
- "description": "Whether the fulfillment service is installed in the current version. If a fulfillment service is no longer installed, the `is_installed` attribute is set to `false`.",
+ "description": "Whether the fulfillment service is installed in the current version. If a fulfillment service is no longer installed, the `is\\_installed` attribute is set to `false`.",
"optional": false,
"defaultValue": "true",
"expandable": false,
@@ -243,7 +243,7 @@ A region holds settings specific to a geographical location, including the curre
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -261,7 +261,7 @@ A region holds settings specific to a geographical location, including the curre
},
{
"name": "payment_providers",
- "type": "[`PaymentProvider`](PaymentProvider.mdx)[]",
+ "type": "[PaymentProvider](PaymentProvider.mdx)[]",
"description": "The details of the payment providers that can be used to process payments in the region.",
"optional": false,
"defaultValue": "",
@@ -279,7 +279,7 @@ A region holds settings specific to a geographical location, including the curre
{
"name": "is_installed",
"type": "`boolean`",
- "description": "Whether the payment service is installed in the current version. If a payment service is no longer installed, the `is_installed` attribute is set to `false`.",
+ "description": "Whether the payment service is installed in the current version. If a payment service is no longer installed, the `is\\_installed` attribute is set to `false`.",
"optional": false,
"defaultValue": "true",
"expandable": false,
@@ -298,7 +298,7 @@ A region holds settings specific to a geographical location, including the curre
},
{
"name": "tax_provider",
- "type": "[`TaxProvider`](TaxProvider.mdx)",
+ "type": "[TaxProvider](TaxProvider.mdx)",
"description": "The details of the tax provider used in the region.",
"optional": false,
"defaultValue": "",
@@ -316,7 +316,7 @@ A region holds settings specific to a geographical location, including the curre
{
"name": "is_installed",
"type": "`boolean`",
- "description": "Whether the tax service is installed in the current version. If a tax service is no longer installed, the `is_installed` attribute is set to `false`.",
+ "description": "Whether the tax service is installed in the current version. If a tax service is no longer installed, the `is\\_installed` attribute is set to `false`.",
"optional": false,
"defaultValue": "true",
"expandable": false,
@@ -344,7 +344,7 @@ A region holds settings specific to a geographical location, including the curre
},
{
"name": "tax_rates",
- "type": "``null`` \\| [`TaxRate`](TaxRate.mdx)[]",
+ "type": "``null`` \\| [TaxRate](TaxRate.mdx)[]",
"description": "The details of the tax rates used in the region, aside from the default rate.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/Return.mdx b/www/apps/docs/content/references/entities/classes/Return.mdx
index 21529c4a1d..b688709bfe 100644
--- a/www/apps/docs/content/references/entities/classes/Return.mdx
+++ b/www/apps/docs/content/references/entities/classes/Return.mdx
@@ -13,7 +13,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -120,7 +120,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that this claim was created for.",
"optional": false,
"defaultValue": "",
@@ -138,7 +138,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "payment_status",
- "type": "[`ClaimPaymentStatus`](../enums/ClaimPaymentStatus.mdx)",
+ "type": "[ClaimPaymentStatus](../enums/ClaimPaymentStatus.mdx)",
"description": "The status of the claim's payment",
"optional": false,
"defaultValue": "na",
@@ -156,7 +156,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "return_order",
- "type": "[`Return`](Return.mdx)",
+ "type": "[Return](Return.mdx)",
"description": "The details of the return associated with the claim if the claim's type is `replace`.",
"optional": false,
"defaultValue": "",
@@ -165,7 +165,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the address that new items should be shipped to.",
"optional": false,
"defaultValue": "",
@@ -183,7 +183,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods that the claim order will be shipped with.",
"optional": false,
"defaultValue": "",
@@ -192,7 +192,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "type",
- "type": "[`ClaimType`](../enums/ClaimType.mdx)",
+ "type": "[ClaimType](../enums/ClaimType.mdx)",
"description": "The claim's type",
"optional": false,
"defaultValue": "",
@@ -248,7 +248,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "items",
- "type": "[`ReturnItem`](ReturnItem.mdx)[]",
+ "type": "[ReturnItem](ReturnItem.mdx)[]",
"description": "The details of the items that the customer is returning.",
"optional": false,
"defaultValue": "",
@@ -265,7 +265,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "item",
- "type": "[`LineItem`](LineItem.mdx)",
+ "type": "[LineItem](LineItem.mdx)",
"description": "The details of the line item in the original order to be returned.",
"optional": false,
"defaultValue": "",
@@ -283,7 +283,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -310,7 +310,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "reason",
- "type": "[`ReturnReason`](ReturnReason.mdx)",
+ "type": "[ReturnReason](ReturnReason.mdx)",
"description": "The details of the reason for returning the item.",
"optional": false,
"defaultValue": "",
@@ -355,7 +355,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "return_order",
- "type": "[`Return`](Return.mdx)",
+ "type": "[Return](Return.mdx)",
"description": "Details of the Return that the Return Item belongs to.",
"optional": false,
"defaultValue": "",
@@ -375,7 +375,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -393,7 +393,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the return was created for.",
"optional": false,
"defaultValue": "",
@@ -401,7 +401,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
"children": [
{
"name": "billing_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the billing address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -428,7 +428,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart associated with the order.",
"optional": false,
"defaultValue": "",
@@ -446,7 +446,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "claims",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)[]",
+ "type": "[ClaimOrder](ClaimOrder.mdx)[]",
"description": "The details of the claims created for the order.",
"optional": false,
"defaultValue": "",
@@ -464,7 +464,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency used in the order.",
"optional": false,
"defaultValue": "",
@@ -482,7 +482,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "customer",
- "type": "[`Customer`](Customer.mdx)",
+ "type": "[Customer](Customer.mdx)",
"description": "The details of the customer associated with the order.",
"optional": false,
"defaultValue": "",
@@ -509,7 +509,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "discounts",
- "type": "[`Discount`](Discount.mdx)[]",
+ "type": "[Discount](Discount.mdx)[]",
"description": "The details of the discounts applied on the order.",
"optional": false,
"defaultValue": "",
@@ -527,7 +527,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "draft_order",
- "type": "[`DraftOrder`](DraftOrder.mdx)",
+ "type": "[DraftOrder](DraftOrder.mdx)",
"description": "The details of the draft order this order was created from.",
"optional": false,
"defaultValue": "",
@@ -545,7 +545,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "edits",
- "type": "[`OrderEdit`](OrderEdit.mdx)[]",
+ "type": "[OrderEdit](OrderEdit.mdx)[]",
"description": "The details of the order edits done on the order.",
"optional": false,
"defaultValue": "",
@@ -572,7 +572,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "fulfillment_status",
- "type": "[`FulfillmentStatus`](../enums/FulfillmentStatus.mdx)",
+ "type": "[FulfillmentStatus](../enums/FulfillmentStatus.mdx)",
"description": "The order's fulfillment status",
"optional": false,
"defaultValue": "not_fulfilled",
@@ -581,7 +581,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "fulfillments",
- "type": "[`Fulfillment`](Fulfillment.mdx)[]",
+ "type": "[Fulfillment](Fulfillment.mdx)[]",
"description": "The details of the fulfillments created for the order.",
"optional": false,
"defaultValue": "",
@@ -608,7 +608,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "gift_card_transactions",
- "type": "[`GiftCardTransaction`](GiftCardTransaction.mdx)[]",
+ "type": "[GiftCardTransaction](GiftCardTransaction.mdx)[]",
"description": "The gift card transactions made in the order.",
"optional": false,
"defaultValue": "",
@@ -617,7 +617,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "gift_cards",
- "type": "[`GiftCard`](GiftCard.mdx)[]",
+ "type": "[GiftCard](GiftCard.mdx)[]",
"description": "The details of the gift card used in the order.",
"optional": false,
"defaultValue": "",
@@ -653,7 +653,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that belong to the order.",
"optional": false,
"defaultValue": "",
@@ -662,7 +662,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -698,7 +698,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "payment_status",
- "type": "[`PaymentStatus`](../enums/PaymentStatus.mdx)",
+ "type": "[PaymentStatus](../enums/PaymentStatus.mdx)",
"description": "The order's payment status",
"optional": false,
"defaultValue": "not_paid",
@@ -707,7 +707,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "payments",
- "type": "[`Payment`](Payment.mdx)[]",
+ "type": "[Payment](Payment.mdx)[]",
"description": "The details of the payments used in the order.",
"optional": false,
"defaultValue": "",
@@ -743,7 +743,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "refunds",
- "type": "[`Refund`](Refund.mdx)[]",
+ "type": "[Refund](Refund.mdx)[]",
"description": "The details of the refunds created for the order.",
"optional": false,
"defaultValue": "",
@@ -752,7 +752,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this order was created in.",
"optional": false,
"defaultValue": "",
@@ -770,7 +770,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "returnable_items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
"optional": true,
"defaultValue": "",
@@ -779,7 +779,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "returns",
- "type": "[`Return`](Return.mdx)[]",
+ "type": "[Return](Return.mdx)[]",
"description": "The details of the returns created for the order.",
"optional": false,
"defaultValue": "",
@@ -788,7 +788,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "sales_channel",
- "type": "[`SalesChannel`](SalesChannel.mdx)",
+ "type": "[SalesChannel](SalesChannel.mdx)",
"description": "The details of the sales channel this order belongs to.",
"optional": false,
"defaultValue": "",
@@ -806,7 +806,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the shipping address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -824,7 +824,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods used in the order.",
"optional": false,
"defaultValue": "",
@@ -851,7 +851,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "status",
- "type": "[`OrderStatus`](../enums/OrderStatus.mdx)",
+ "type": "[OrderStatus](../enums/OrderStatus.mdx)",
"description": "The order's status",
"optional": false,
"defaultValue": "pending",
@@ -869,7 +869,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "swaps",
- "type": "[`Swap`](Swap.mdx)[]",
+ "type": "[Swap](Swap.mdx)[]",
"description": "The details of the swaps created for the order.",
"optional": false,
"defaultValue": "",
@@ -943,7 +943,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "shipping_data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment.",
"optional": false,
"defaultValue": "",
@@ -952,7 +952,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "shipping_method",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)",
+ "type": "[ShippingMethod](ShippingMethod.mdx)",
"description": "The details of the Shipping Method that will be used to send the Return back. Can be null if the Customer will handle the return shipment themselves.",
"optional": false,
"defaultValue": "",
@@ -960,7 +960,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
"children": [
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart that the shipping method is used in.",
"optional": false,
"defaultValue": "",
@@ -978,7 +978,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "claim_order",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)",
+ "type": "[ClaimOrder](ClaimOrder.mdx)",
"description": "The details of the claim that the shipping method is used in.",
"optional": false,
"defaultValue": "",
@@ -996,7 +996,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "Additional data that the Fulfillment Provider needs to fulfill the shipment. This is used in combination with the Shipping Options data, and may contain information such as a drop point id.",
"optional": false,
"defaultValue": "",
@@ -1024,7 +1024,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the shipping method is used in.",
"optional": false,
"defaultValue": "",
@@ -1060,7 +1060,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "return_order",
- "type": "[`Return`](Return.mdx)",
+ "type": "[Return](Return.mdx)",
"description": "The details of the return that the shipping method is used in.",
"optional": false,
"defaultValue": "",
@@ -1069,7 +1069,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "shipping_option",
- "type": "[`ShippingOption`](ShippingOption.mdx)",
+ "type": "[ShippingOption](ShippingOption.mdx)",
"description": "The details of the shipping option the method was created from.",
"optional": false,
"defaultValue": "",
@@ -1096,7 +1096,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "swap",
- "type": "[`Swap`](Swap.mdx)",
+ "type": "[Swap](Swap.mdx)",
"description": "The details of the swap that the shipping method is used in.",
"optional": false,
"defaultValue": "",
@@ -1114,7 +1114,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "tax_lines",
- "type": "[`ShippingMethodTaxLine`](ShippingMethodTaxLine.mdx)[]",
+ "type": "[ShippingMethodTaxLine](ShippingMethodTaxLine.mdx)[]",
"description": "The details of the tax lines applied on the shipping method.",
"optional": false,
"defaultValue": "",
@@ -1143,7 +1143,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "status",
- "type": "[`ReturnStatus`](../enums/ReturnStatus.mdx)",
+ "type": "[ReturnStatus](../enums/ReturnStatus.mdx)",
"description": "Status of the Return.",
"optional": false,
"defaultValue": "requested",
@@ -1189,7 +1189,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "swap",
- "type": "[`Swap`](Swap.mdx)",
+ "type": "[Swap](Swap.mdx)",
"description": "The details of the swap that the return may belong to.",
"optional": false,
"defaultValue": "",
@@ -1197,7 +1197,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
"children": [
{
"name": "additional_items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the new products to send to the customer, represented as line items.",
"optional": false,
"defaultValue": "",
@@ -1224,7 +1224,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart that the customer uses to complete the swap.",
"optional": false,
"defaultValue": "",
@@ -1278,7 +1278,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "fulfillment_status",
- "type": "[`SwapFulfillmentStatus`](../enums/SwapFulfillmentStatus.mdx)",
+ "type": "[SwapFulfillmentStatus](../enums/SwapFulfillmentStatus.mdx)",
"description": "The status of the Fulfillment of the Swap.",
"optional": false,
"defaultValue": "",
@@ -1287,7 +1287,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "fulfillments",
- "type": "[`Fulfillment`](Fulfillment.mdx)[]",
+ "type": "[Fulfillment](Fulfillment.mdx)[]",
"description": "The details of the fulfillments that are used to send the new items to the customer.",
"optional": false,
"defaultValue": "",
@@ -1314,7 +1314,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -1332,7 +1332,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the swap belongs to.",
"optional": false,
"defaultValue": "",
@@ -1350,8 +1350,8 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "payment",
- "type": "[`Payment`](Payment.mdx)",
- "description": "The details of the additional payment authorized by the customer when `difference_due` is positive.",
+ "type": "[Payment](Payment.mdx)",
+ "description": "The details of the additional payment authorized by the customer when `difference\\_due` is positive.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -1359,7 +1359,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "payment_status",
- "type": "[`SwapPaymentStatus`](../enums/SwapPaymentStatus.mdx)",
+ "type": "[SwapPaymentStatus](../enums/SwapPaymentStatus.mdx)",
"description": "The status of the Payment of the Swap. The payment may either refer to the refund of an amount or the authorization of a new amount.",
"optional": false,
"defaultValue": "",
@@ -1368,7 +1368,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "return_order",
- "type": "[`Return`](Return.mdx)",
+ "type": "[Return](Return.mdx)",
"description": "The details of the return that belongs to the swap, which holds the details on the items being returned.",
"optional": false,
"defaultValue": "",
@@ -1377,7 +1377,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the shipping address that the new items should be sent to.",
"optional": false,
"defaultValue": "",
@@ -1395,7 +1395,7 @@ A Return holds information about Line Items that a Customer wishes to send back,
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods used to fulfill the additional items purchased.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ReturnItem.mdx b/www/apps/docs/content/references/entities/classes/ReturnItem.mdx
index 097b768b6a..015a655ff0 100644
--- a/www/apps/docs/content/references/entities/classes/ReturnItem.mdx
+++ b/www/apps/docs/content/references/entities/classes/ReturnItem.mdx
@@ -22,7 +22,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "item",
- "type": "[`LineItem`](LineItem.mdx)",
+ "type": "[LineItem](LineItem.mdx)",
"description": "The details of the line item in the original order to be returned.",
"optional": false,
"defaultValue": "",
@@ -30,7 +30,7 @@ A return item represents a line item in an order that is to be returned. It incl
"children": [
{
"name": "adjustments",
- "type": "[`LineItemAdjustment`](LineItemAdjustment.mdx)[]",
+ "type": "[LineItemAdjustment](LineItemAdjustment.mdx)[]",
"description": "The details of the item's adjustments, which are available when a discount is applied on the item.",
"optional": false,
"defaultValue": "",
@@ -48,7 +48,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart that the line item may belongs to.",
"optional": false,
"defaultValue": "",
@@ -66,7 +66,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "claim_order",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)",
+ "type": "[ClaimOrder](ClaimOrder.mdx)",
"description": "The details of the claim that the line item may belong to.",
"optional": false,
"defaultValue": "",
@@ -148,7 +148,7 @@ A return item represents a line item in an order that is to be returned. It incl
{
"name": "includes_tax",
"type": "`boolean`",
- "description": "Indicates if the line item unit_price include tax",
+ "description": "Indicates if the line item unit\\_price include tax",
"optional": false,
"defaultValue": "false",
"expandable": false,
@@ -175,7 +175,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -184,7 +184,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the line item may belongs to.",
"optional": false,
"defaultValue": "",
@@ -193,7 +193,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "order_edit",
- "type": "``null`` \\| [`OrderEdit`](OrderEdit.mdx)",
+ "type": "``null`` \\| [OrderEdit](OrderEdit.mdx)",
"description": "The details of the order edit.",
"optional": true,
"defaultValue": "",
@@ -319,7 +319,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "swap",
- "type": "[`Swap`](Swap.mdx)",
+ "type": "[Swap](Swap.mdx)",
"description": "The details of the swap that the line item may belong to.",
"optional": false,
"defaultValue": "",
@@ -337,7 +337,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "tax_lines",
- "type": "[`LineItemTaxLine`](LineItemTaxLine.mdx)[]",
+ "type": "[LineItemTaxLine](LineItemTaxLine.mdx)[]",
"description": "The details of the item's tax lines.",
"optional": false,
"defaultValue": "",
@@ -400,7 +400,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "variant",
- "type": "[`ProductVariant`](ProductVariant.mdx)",
+ "type": "[ProductVariant](ProductVariant.mdx)",
"description": "The details of the product variant that this item was created from.",
"optional": false,
"defaultValue": "",
@@ -429,7 +429,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -456,7 +456,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "reason",
- "type": "[`ReturnReason`](ReturnReason.mdx)",
+ "type": "[ReturnReason](ReturnReason.mdx)",
"description": "The details of the reason for returning the item.",
"optional": false,
"defaultValue": "",
@@ -509,7 +509,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -518,7 +518,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "parent_return_reason",
- "type": "``null`` \\| [`ReturnReason`](ReturnReason.mdx)",
+ "type": "``null`` \\| [ReturnReason](ReturnReason.mdx)",
"description": "The details of the parent reason.",
"optional": false,
"defaultValue": "",
@@ -536,7 +536,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "return_reason_children",
- "type": "[`ReturnReason`](ReturnReason.mdx)[]",
+ "type": "[ReturnReason](ReturnReason.mdx)[]",
"description": "The details of the child reasons.",
"optional": false,
"defaultValue": "",
@@ -601,7 +601,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "return_order",
- "type": "[`Return`](Return.mdx)",
+ "type": "[Return](Return.mdx)",
"description": "Details of the Return that the Return Item belongs to.",
"optional": false,
"defaultValue": "",
@@ -609,7 +609,7 @@ A return item represents a line item in an order that is to be returned. It incl
"children": [
{
"name": "claim_order",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)",
+ "type": "[ClaimOrder](ClaimOrder.mdx)",
"description": "The details of the claim that the return may belong to.",
"optional": false,
"defaultValue": "",
@@ -654,7 +654,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "items",
- "type": "[`ReturnItem`](ReturnItem.mdx)[]",
+ "type": "[ReturnItem](ReturnItem.mdx)[]",
"description": "The details of the items that the customer is returning.",
"optional": false,
"defaultValue": "",
@@ -672,7 +672,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -690,7 +690,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the return was created for.",
"optional": false,
"defaultValue": "",
@@ -726,7 +726,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "shipping_data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment.",
"optional": false,
"defaultValue": "",
@@ -735,7 +735,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "shipping_method",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)",
+ "type": "[ShippingMethod](ShippingMethod.mdx)",
"description": "The details of the Shipping Method that will be used to send the Return back. Can be null if the Customer will handle the return shipment themselves.",
"optional": false,
"defaultValue": "",
@@ -744,7 +744,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "status",
- "type": "[`ReturnStatus`](../enums/ReturnStatus.mdx)",
+ "type": "[ReturnStatus](../enums/ReturnStatus.mdx)",
"description": "Status of the Return.",
"optional": false,
"defaultValue": "requested",
@@ -753,7 +753,7 @@ A return item represents a line item in an order that is to be returned. It incl
},
{
"name": "swap",
- "type": "[`Swap`](Swap.mdx)",
+ "type": "[Swap](Swap.mdx)",
"description": "The details of the swap that the return may belong to.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ReturnReason.mdx b/www/apps/docs/content/references/entities/classes/ReturnReason.mdx
index f5b9f7945b..4d8226ba74 100644
--- a/www/apps/docs/content/references/entities/classes/ReturnReason.mdx
+++ b/www/apps/docs/content/references/entities/classes/ReturnReason.mdx
@@ -58,7 +58,7 @@ A Return Reason is a value defined by an admin. It can be used on Return Items i
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -67,7 +67,7 @@ A Return Reason is a value defined by an admin. It can be used on Return Items i
},
{
"name": "parent_return_reason",
- "type": "``null`` \\| [`ReturnReason`](ReturnReason.mdx)",
+ "type": "``null`` \\| [ReturnReason](ReturnReason.mdx)",
"description": "The details of the parent reason.",
"optional": false,
"defaultValue": "",
@@ -85,7 +85,7 @@ A Return Reason is a value defined by an admin. It can be used on Return Items i
},
{
"name": "return_reason_children",
- "type": "[`ReturnReason`](ReturnReason.mdx)[]",
+ "type": "[ReturnReason](ReturnReason.mdx)[]",
"description": "The details of the child reasons.",
"optional": false,
"defaultValue": "",
@@ -138,7 +138,7 @@ A Return Reason is a value defined by an admin. It can be used on Return Items i
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -147,7 +147,7 @@ A Return Reason is a value defined by an admin. It can be used on Return Items i
},
{
"name": "parent_return_reason",
- "type": "``null`` \\| [`ReturnReason`](ReturnReason.mdx)",
+ "type": "``null`` \\| [ReturnReason](ReturnReason.mdx)",
"description": "The details of the parent reason.",
"optional": false,
"defaultValue": "",
@@ -165,7 +165,7 @@ A Return Reason is a value defined by an admin. It can be used on Return Items i
},
{
"name": "return_reason_children",
- "type": "[`ReturnReason`](ReturnReason.mdx)[]",
+ "type": "[ReturnReason](ReturnReason.mdx)[]",
"description": "The details of the child reasons.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/SalesChannel.mdx b/www/apps/docs/content/references/entities/classes/SalesChannel.mdx
index 3c93fa39c5..80439f78a3 100644
--- a/www/apps/docs/content/references/entities/classes/SalesChannel.mdx
+++ b/www/apps/docs/content/references/entities/classes/SalesChannel.mdx
@@ -58,7 +58,7 @@ A Sales Channel is a method a business offers its products for purchase for the
},
{
"name": "locations",
- "type": "[`SalesChannelLocation`](SalesChannelLocation.mdx)[]",
+ "type": "[SalesChannelLocation](SalesChannelLocation.mdx)[]",
"description": "The details of the stock locations related to the sales channel.",
"optional": false,
"defaultValue": "",
@@ -102,7 +102,7 @@ A Sales Channel is a method a business offers its products for purchase for the
},
{
"name": "sales_channel",
- "type": "[`SalesChannel`](SalesChannel.mdx)",
+ "type": "[SalesChannel](SalesChannel.mdx)",
"description": "The details of the sales channel the location is associated with.",
"optional": false,
"defaultValue": "",
@@ -131,7 +131,7 @@ A Sales Channel is a method a business offers its products for purchase for the
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/SalesChannelLocation.mdx b/www/apps/docs/content/references/entities/classes/SalesChannelLocation.mdx
index 00d31fe8f0..7d4d54b25a 100644
--- a/www/apps/docs/content/references/entities/classes/SalesChannelLocation.mdx
+++ b/www/apps/docs/content/references/entities/classes/SalesChannelLocation.mdx
@@ -49,7 +49,7 @@ This represents the association between a sales channel and a stock locations.
},
{
"name": "sales_channel",
- "type": "[`SalesChannel`](SalesChannel.mdx)",
+ "type": "[SalesChannel](SalesChannel.mdx)",
"description": "The details of the sales channel the location is associated with.",
"optional": false,
"defaultValue": "",
@@ -102,7 +102,7 @@ This represents the association between a sales channel and a stock locations.
},
{
"name": "locations",
- "type": "[`SalesChannelLocation`](SalesChannelLocation.mdx)[]",
+ "type": "[SalesChannelLocation](SalesChannelLocation.mdx)[]",
"description": "The details of the stock locations related to the sales channel.",
"optional": false,
"defaultValue": "",
@@ -111,7 +111,7 @@ This represents the association between a sales channel and a stock locations.
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ShippingMethod.mdx b/www/apps/docs/content/references/entities/classes/ShippingMethod.mdx
index c2fda2e05e..85dc79dc3c 100644
--- a/www/apps/docs/content/references/entities/classes/ShippingMethod.mdx
+++ b/www/apps/docs/content/references/entities/classes/ShippingMethod.mdx
@@ -13,7 +13,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
",
+ "type": "`Record`",
"description": "The context of the cart which can include info like IP or user agent.",
"optional": false,
"defaultValue": "",
@@ -66,7 +66,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "customer",
- "type": "[`Customer`](Customer.mdx)",
+ "type": "[Customer](Customer.mdx)",
"description": "The details of the customer the cart belongs to.",
"optional": false,
"defaultValue": "",
@@ -102,7 +102,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "discounts",
- "type": "[`Discount`](Discount.mdx)[]",
+ "type": "[Discount](Discount.mdx)[]",
"description": "An array of details of all discounts applied to the cart.",
"optional": false,
"defaultValue": "",
@@ -138,7 +138,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "gift_cards",
- "type": "[`GiftCard`](GiftCard.mdx)[]",
+ "type": "[GiftCard](GiftCard.mdx)[]",
"description": "An array of details of all gift cards applied to the cart.",
"optional": false,
"defaultValue": "",
@@ -174,7 +174,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The line items added to the cart.",
"optional": false,
"defaultValue": "",
@@ -183,7 +183,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -201,7 +201,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "payment",
- "type": "[`Payment`](Payment.mdx)",
+ "type": "[Payment](Payment.mdx)",
"description": "The details of the payment associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -228,7 +228,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "payment_session",
- "type": "``null`` \\| [`PaymentSession`](PaymentSession.mdx)",
+ "type": "``null`` \\| [PaymentSession](PaymentSession.mdx)",
"description": "The details of the selected payment session in the cart.",
"optional": false,
"defaultValue": "",
@@ -237,7 +237,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "payment_sessions",
- "type": "[`PaymentSession`](PaymentSession.mdx)[]",
+ "type": "[PaymentSession](PaymentSession.mdx)[]",
"description": "The details of all payment sessions created on the cart.",
"optional": false,
"defaultValue": "",
@@ -273,7 +273,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -291,7 +291,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "sales_channel",
- "type": "[`SalesChannel`](SalesChannel.mdx)",
+ "type": "[SalesChannel](SalesChannel.mdx)",
"description": "The details of the sales channel associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -309,7 +309,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "shipping_address",
- "type": "``null`` \\| [`Address`](Address.mdx)",
+ "type": "``null`` \\| [Address](Address.mdx)",
"description": "The details of the shipping address associated with the cart.",
"optional": false,
"defaultValue": "",
@@ -327,7 +327,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods added to the cart.",
"optional": false,
"defaultValue": "",
@@ -381,7 +381,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "type",
- "type": "[`CartType`](../enums/CartType.mdx)",
+ "type": "[CartType](../enums/CartType.mdx)",
"description": "The cart's type.",
"optional": false,
"defaultValue": "default",
@@ -410,7 +410,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "claim_order",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)",
+ "type": "[ClaimOrder](ClaimOrder.mdx)",
"description": "The details of the claim that the shipping method is used in.",
"optional": false,
"defaultValue": "",
@@ -418,7 +418,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
"children": [
{
"name": "additional_items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the new items to be shipped when the claim's type is `replace`",
"optional": false,
"defaultValue": "",
@@ -436,7 +436,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "claim_items",
- "type": "[`ClaimItem`](ClaimItem.mdx)[]",
+ "type": "[ClaimItem](ClaimItem.mdx)[]",
"description": "The details of the items that should be replaced or refunded.",
"optional": false,
"defaultValue": "",
@@ -463,7 +463,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "fulfillment_status",
- "type": "[`ClaimFulfillmentStatus`](../enums/ClaimFulfillmentStatus.mdx)",
+ "type": "[ClaimFulfillmentStatus](../enums/ClaimFulfillmentStatus.mdx)",
"description": "The claim's fulfillment status",
"optional": false,
"defaultValue": "not_fulfilled",
@@ -472,7 +472,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "fulfillments",
- "type": "[`Fulfillment`](Fulfillment.mdx)[]",
+ "type": "[Fulfillment](Fulfillment.mdx)[]",
"description": "The fulfillments of the new items to be shipped",
"optional": false,
"defaultValue": "",
@@ -499,7 +499,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -517,7 +517,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that this claim was created for.",
"optional": false,
"defaultValue": "",
@@ -535,7 +535,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "payment_status",
- "type": "[`ClaimPaymentStatus`](../enums/ClaimPaymentStatus.mdx)",
+ "type": "[ClaimPaymentStatus](../enums/ClaimPaymentStatus.mdx)",
"description": "The status of the claim's payment",
"optional": false,
"defaultValue": "na",
@@ -553,7 +553,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "return_order",
- "type": "[`Return`](Return.mdx)",
+ "type": "[Return](Return.mdx)",
"description": "The details of the return associated with the claim if the claim's type is `replace`.",
"optional": false,
"defaultValue": "",
@@ -562,7 +562,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the address that new items should be shipped to.",
"optional": false,
"defaultValue": "",
@@ -580,7 +580,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods that the claim order will be shipped with.",
"optional": false,
"defaultValue": "",
@@ -589,7 +589,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "type",
- "type": "[`ClaimType`](../enums/ClaimType.mdx)",
+ "type": "[ClaimType](../enums/ClaimType.mdx)",
"description": "The claim's type",
"optional": false,
"defaultValue": "",
@@ -618,7 +618,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "Additional data that the Fulfillment Provider needs to fulfill the shipment. This is used in combination with the Shipping Options data, and may contain information such as a drop point id.",
"optional": false,
"defaultValue": "",
@@ -646,7 +646,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the shipping method is used in.",
"optional": false,
"defaultValue": "",
@@ -654,7 +654,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
"children": [
{
"name": "billing_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the billing address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -681,7 +681,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart associated with the order.",
"optional": false,
"defaultValue": "",
@@ -699,7 +699,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "claims",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)[]",
+ "type": "[ClaimOrder](ClaimOrder.mdx)[]",
"description": "The details of the claims created for the order.",
"optional": false,
"defaultValue": "",
@@ -717,7 +717,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency used in the order.",
"optional": false,
"defaultValue": "",
@@ -735,7 +735,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "customer",
- "type": "[`Customer`](Customer.mdx)",
+ "type": "[Customer](Customer.mdx)",
"description": "The details of the customer associated with the order.",
"optional": false,
"defaultValue": "",
@@ -762,7 +762,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "discounts",
- "type": "[`Discount`](Discount.mdx)[]",
+ "type": "[Discount](Discount.mdx)[]",
"description": "The details of the discounts applied on the order.",
"optional": false,
"defaultValue": "",
@@ -780,7 +780,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "draft_order",
- "type": "[`DraftOrder`](DraftOrder.mdx)",
+ "type": "[DraftOrder](DraftOrder.mdx)",
"description": "The details of the draft order this order was created from.",
"optional": false,
"defaultValue": "",
@@ -798,7 +798,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "edits",
- "type": "[`OrderEdit`](OrderEdit.mdx)[]",
+ "type": "[OrderEdit](OrderEdit.mdx)[]",
"description": "The details of the order edits done on the order.",
"optional": false,
"defaultValue": "",
@@ -825,7 +825,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "fulfillment_status",
- "type": "[`FulfillmentStatus`](../enums/FulfillmentStatus.mdx)",
+ "type": "[FulfillmentStatus](../enums/FulfillmentStatus.mdx)",
"description": "The order's fulfillment status",
"optional": false,
"defaultValue": "not_fulfilled",
@@ -834,7 +834,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "fulfillments",
- "type": "[`Fulfillment`](Fulfillment.mdx)[]",
+ "type": "[Fulfillment](Fulfillment.mdx)[]",
"description": "The details of the fulfillments created for the order.",
"optional": false,
"defaultValue": "",
@@ -861,7 +861,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "gift_card_transactions",
- "type": "[`GiftCardTransaction`](GiftCardTransaction.mdx)[]",
+ "type": "[GiftCardTransaction](GiftCardTransaction.mdx)[]",
"description": "The gift card transactions made in the order.",
"optional": false,
"defaultValue": "",
@@ -870,7 +870,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "gift_cards",
- "type": "[`GiftCard`](GiftCard.mdx)[]",
+ "type": "[GiftCard](GiftCard.mdx)[]",
"description": "The details of the gift card used in the order.",
"optional": false,
"defaultValue": "",
@@ -906,7 +906,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that belong to the order.",
"optional": false,
"defaultValue": "",
@@ -915,7 +915,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -951,7 +951,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "payment_status",
- "type": "[`PaymentStatus`](../enums/PaymentStatus.mdx)",
+ "type": "[PaymentStatus](../enums/PaymentStatus.mdx)",
"description": "The order's payment status",
"optional": false,
"defaultValue": "not_paid",
@@ -960,7 +960,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "payments",
- "type": "[`Payment`](Payment.mdx)[]",
+ "type": "[Payment](Payment.mdx)[]",
"description": "The details of the payments used in the order.",
"optional": false,
"defaultValue": "",
@@ -996,7 +996,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "refunds",
- "type": "[`Refund`](Refund.mdx)[]",
+ "type": "[Refund](Refund.mdx)[]",
"description": "The details of the refunds created for the order.",
"optional": false,
"defaultValue": "",
@@ -1005,7 +1005,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this order was created in.",
"optional": false,
"defaultValue": "",
@@ -1023,7 +1023,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "returnable_items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
"optional": true,
"defaultValue": "",
@@ -1032,7 +1032,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "returns",
- "type": "[`Return`](Return.mdx)[]",
+ "type": "[Return](Return.mdx)[]",
"description": "The details of the returns created for the order.",
"optional": false,
"defaultValue": "",
@@ -1041,7 +1041,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "sales_channel",
- "type": "[`SalesChannel`](SalesChannel.mdx)",
+ "type": "[SalesChannel](SalesChannel.mdx)",
"description": "The details of the sales channel this order belongs to.",
"optional": false,
"defaultValue": "",
@@ -1059,7 +1059,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the shipping address associated with the order.",
"optional": false,
"defaultValue": "",
@@ -1077,7 +1077,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods used in the order.",
"optional": false,
"defaultValue": "",
@@ -1104,7 +1104,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "status",
- "type": "[`OrderStatus`](../enums/OrderStatus.mdx)",
+ "type": "[OrderStatus](../enums/OrderStatus.mdx)",
"description": "The order's status",
"optional": false,
"defaultValue": "pending",
@@ -1122,7 +1122,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "swaps",
- "type": "[`Swap`](Swap.mdx)[]",
+ "type": "[Swap](Swap.mdx)[]",
"description": "The details of the swaps created for the order.",
"optional": false,
"defaultValue": "",
@@ -1196,7 +1196,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "return_order",
- "type": "[`Return`](Return.mdx)",
+ "type": "[Return](Return.mdx)",
"description": "The details of the return that the shipping method is used in.",
"optional": false,
"defaultValue": "",
@@ -1204,7 +1204,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
"children": [
{
"name": "claim_order",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)",
+ "type": "[ClaimOrder](ClaimOrder.mdx)",
"description": "The details of the claim that the return may belong to.",
"optional": false,
"defaultValue": "",
@@ -1249,7 +1249,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "items",
- "type": "[`ReturnItem`](ReturnItem.mdx)[]",
+ "type": "[ReturnItem](ReturnItem.mdx)[]",
"description": "The details of the items that the customer is returning.",
"optional": false,
"defaultValue": "",
@@ -1267,7 +1267,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -1285,7 +1285,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the return was created for.",
"optional": false,
"defaultValue": "",
@@ -1321,7 +1321,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "shipping_data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment.",
"optional": false,
"defaultValue": "",
@@ -1330,7 +1330,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "shipping_method",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)",
+ "type": "[ShippingMethod](ShippingMethod.mdx)",
"description": "The details of the Shipping Method that will be used to send the Return back. Can be null if the Customer will handle the return shipment themselves.",
"optional": false,
"defaultValue": "",
@@ -1339,7 +1339,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "status",
- "type": "[`ReturnStatus`](../enums/ReturnStatus.mdx)",
+ "type": "[ReturnStatus](../enums/ReturnStatus.mdx)",
"description": "Status of the Return.",
"optional": false,
"defaultValue": "requested",
@@ -1348,7 +1348,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "swap",
- "type": "[`Swap`](Swap.mdx)",
+ "type": "[Swap](Swap.mdx)",
"description": "The details of the swap that the return may belong to.",
"optional": false,
"defaultValue": "",
@@ -1377,7 +1377,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "shipping_option",
- "type": "[`ShippingOption`](ShippingOption.mdx)",
+ "type": "[ShippingOption](ShippingOption.mdx)",
"description": "The details of the shipping option the method was created from.",
"optional": false,
"defaultValue": "",
@@ -1395,7 +1395,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
{
"name": "amount",
"type": "``null`` \\| `number`",
- "description": "The amount to charge for shipping when the Shipping Option price type is `flat_rate`.",
+ "description": "The amount to charge for shipping when the Shipping Option price type is `flat\\_rate`.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -1412,7 +1412,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The data needed for the Fulfillment Provider to identify the Shipping Option.",
"optional": false,
"defaultValue": "",
@@ -1458,7 +1458,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -1476,8 +1476,8 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "price_type",
- "type": "[`ShippingOptionPriceType`](../enums/ShippingOptionPriceType.mdx)",
- "description": "The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations.",
+ "type": "[ShippingOptionPriceType](../enums/ShippingOptionPriceType.mdx)",
+ "description": "The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat\\_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -1485,7 +1485,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "profile",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)",
+ "type": "[ShippingProfile](ShippingProfile.mdx)",
"description": "The details of the shipping profile that the shipping option belongs to.",
"optional": false,
"defaultValue": "",
@@ -1503,7 +1503,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "provider",
- "type": "[`FulfillmentProvider`](FulfillmentProvider.mdx)",
+ "type": "[FulfillmentProvider](FulfillmentProvider.mdx)",
"description": "The details of the fulfillment provider that will be used to later to process the shipping method created from this shipping option and its fulfillments.",
"optional": false,
"defaultValue": "",
@@ -1521,7 +1521,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this shipping option can be used in.",
"optional": false,
"defaultValue": "",
@@ -1539,7 +1539,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "requirements",
- "type": "[`ShippingOptionRequirement`](ShippingOptionRequirement.mdx)[]",
+ "type": "[ShippingOptionRequirement](ShippingOptionRequirement.mdx)[]",
"description": "The details of the requirements that must be satisfied for the Shipping Option to be available for usage in a Cart.",
"optional": false,
"defaultValue": "",
@@ -1577,7 +1577,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "swap",
- "type": "[`Swap`](Swap.mdx)",
+ "type": "[Swap](Swap.mdx)",
"description": "The details of the swap that the shipping method is used in.",
"optional": false,
"defaultValue": "",
@@ -1585,7 +1585,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
"children": [
{
"name": "additional_items",
- "type": "[`LineItem`](LineItem.mdx)[]",
+ "type": "[LineItem](LineItem.mdx)[]",
"description": "The details of the new products to send to the customer, represented as line items.",
"optional": false,
"defaultValue": "",
@@ -1612,7 +1612,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart that the customer uses to complete the swap.",
"optional": false,
"defaultValue": "",
@@ -1666,7 +1666,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "fulfillment_status",
- "type": "[`SwapFulfillmentStatus`](../enums/SwapFulfillmentStatus.mdx)",
+ "type": "[SwapFulfillmentStatus](../enums/SwapFulfillmentStatus.mdx)",
"description": "The status of the Fulfillment of the Swap.",
"optional": false,
"defaultValue": "",
@@ -1675,7 +1675,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "fulfillments",
- "type": "[`Fulfillment`](Fulfillment.mdx)[]",
+ "type": "[Fulfillment](Fulfillment.mdx)[]",
"description": "The details of the fulfillments that are used to send the new items to the customer.",
"optional": false,
"defaultValue": "",
@@ -1702,7 +1702,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -1720,7 +1720,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the swap belongs to.",
"optional": false,
"defaultValue": "",
@@ -1738,8 +1738,8 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "payment",
- "type": "[`Payment`](Payment.mdx)",
- "description": "The details of the additional payment authorized by the customer when `difference_due` is positive.",
+ "type": "[Payment](Payment.mdx)",
+ "description": "The details of the additional payment authorized by the customer when `difference\\_due` is positive.",
"optional": false,
"defaultValue": "",
"expandable": true,
@@ -1747,7 +1747,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "payment_status",
- "type": "[`SwapPaymentStatus`](../enums/SwapPaymentStatus.mdx)",
+ "type": "[SwapPaymentStatus](../enums/SwapPaymentStatus.mdx)",
"description": "The status of the Payment of the Swap. The payment may either refer to the refund of an amount or the authorization of a new amount.",
"optional": false,
"defaultValue": "",
@@ -1756,7 +1756,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "return_order",
- "type": "[`Return`](Return.mdx)",
+ "type": "[Return](Return.mdx)",
"description": "The details of the return that belongs to the swap, which holds the details on the items being returned.",
"optional": false,
"defaultValue": "",
@@ -1765,7 +1765,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "shipping_address",
- "type": "[`Address`](Address.mdx)",
+ "type": "[Address](Address.mdx)",
"description": "The details of the shipping address that the new items should be sent to.",
"optional": false,
"defaultValue": "",
@@ -1783,7 +1783,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "shipping_methods",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)[]",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
"description": "The details of the shipping methods used to fulfill the additional items purchased.",
"optional": false,
"defaultValue": "",
@@ -1812,7 +1812,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "tax_lines",
- "type": "[`ShippingMethodTaxLine`](ShippingMethodTaxLine.mdx)[]",
+ "type": "[ShippingMethodTaxLine](ShippingMethodTaxLine.mdx)[]",
"description": "The details of the tax lines applied on the shipping method.",
"optional": false,
"defaultValue": "",
@@ -1847,7 +1847,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -1874,7 +1874,7 @@ A Shipping Method represents a way in which an Order or Return can be shipped. S
},
{
"name": "shipping_method",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)",
+ "type": "[ShippingMethod](ShippingMethod.mdx)",
"description": "The details of the associated shipping method.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ShippingMethodTaxLine.mdx b/www/apps/docs/content/references/entities/classes/ShippingMethodTaxLine.mdx
index e5659cddfe..0dc57f910b 100644
--- a/www/apps/docs/content/references/entities/classes/ShippingMethodTaxLine.mdx
+++ b/www/apps/docs/content/references/entities/classes/ShippingMethodTaxLine.mdx
@@ -40,7 +40,7 @@ A Shipping Method Tax Line represents the taxes applied on a shipping method in
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -67,7 +67,7 @@ A Shipping Method Tax Line represents the taxes applied on a shipping method in
},
{
"name": "shipping_method",
- "type": "[`ShippingMethod`](ShippingMethod.mdx)",
+ "type": "[ShippingMethod](ShippingMethod.mdx)",
"description": "The details of the associated shipping method.",
"optional": false,
"defaultValue": "",
@@ -75,7 +75,7 @@ A Shipping Method Tax Line represents the taxes applied on a shipping method in
"children": [
{
"name": "cart",
- "type": "[`Cart`](Cart.mdx)",
+ "type": "[Cart](Cart.mdx)",
"description": "The details of the cart that the shipping method is used in.",
"optional": false,
"defaultValue": "",
@@ -93,7 +93,7 @@ A Shipping Method Tax Line represents the taxes applied on a shipping method in
},
{
"name": "claim_order",
- "type": "[`ClaimOrder`](ClaimOrder.mdx)",
+ "type": "[ClaimOrder](ClaimOrder.mdx)",
"description": "The details of the claim that the shipping method is used in.",
"optional": false,
"defaultValue": "",
@@ -111,7 +111,7 @@ A Shipping Method Tax Line represents the taxes applied on a shipping method in
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "Additional data that the Fulfillment Provider needs to fulfill the shipment. This is used in combination with the Shipping Options data, and may contain information such as a drop point id.",
"optional": false,
"defaultValue": "",
@@ -139,7 +139,7 @@ A Shipping Method Tax Line represents the taxes applied on a shipping method in
},
{
"name": "order",
- "type": "[`Order`](Order.mdx)",
+ "type": "[Order](Order.mdx)",
"description": "The details of the order that the shipping method is used in.",
"optional": false,
"defaultValue": "",
@@ -175,7 +175,7 @@ A Shipping Method Tax Line represents the taxes applied on a shipping method in
},
{
"name": "return_order",
- "type": "[`Return`](Return.mdx)",
+ "type": "[Return](Return.mdx)",
"description": "The details of the return that the shipping method is used in.",
"optional": false,
"defaultValue": "",
@@ -184,7 +184,7 @@ A Shipping Method Tax Line represents the taxes applied on a shipping method in
},
{
"name": "shipping_option",
- "type": "[`ShippingOption`](ShippingOption.mdx)",
+ "type": "[ShippingOption](ShippingOption.mdx)",
"description": "The details of the shipping option the method was created from.",
"optional": false,
"defaultValue": "",
@@ -211,7 +211,7 @@ A Shipping Method Tax Line represents the taxes applied on a shipping method in
},
{
"name": "swap",
- "type": "[`Swap`](Swap.mdx)",
+ "type": "[Swap](Swap.mdx)",
"description": "The details of the swap that the shipping method is used in.",
"optional": false,
"defaultValue": "",
@@ -229,7 +229,7 @@ A Shipping Method Tax Line represents the taxes applied on a shipping method in
},
{
"name": "tax_lines",
- "type": "[`ShippingMethodTaxLine`](ShippingMethodTaxLine.mdx)[]",
+ "type": "[ShippingMethodTaxLine](ShippingMethodTaxLine.mdx)[]",
"description": "The details of the tax lines applied on the shipping method.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/ShippingOption.mdx b/www/apps/docs/content/references/entities/classes/ShippingOption.mdx
index c2492852a6..686a2f6163 100644
--- a/www/apps/docs/content/references/entities/classes/ShippingOption.mdx
+++ b/www/apps/docs/content/references/entities/classes/ShippingOption.mdx
@@ -23,7 +23,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
{
"name": "amount",
"type": "``null`` \\| `number`",
- "description": "The amount to charge for shipping when the Shipping Option price type is `flat_rate`.",
+ "description": "The amount to charge for shipping when the Shipping Option price type is `flat\\_rate`.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -40,7 +40,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The data needed for the Fulfillment Provider to identify the Shipping Option.",
"optional": false,
"defaultValue": "",
@@ -86,7 +86,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -104,8 +104,8 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "price_type",
- "type": "[`ShippingOptionPriceType`](../enums/ShippingOptionPriceType.mdx)",
- "description": "The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations.",
+ "type": "[ShippingOptionPriceType](../enums/ShippingOptionPriceType.mdx)",
+ "description": "The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat\\_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -132,7 +132,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "profile",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)",
+ "type": "[ShippingProfile](ShippingProfile.mdx)",
"description": "The details of the shipping profile that the shipping option belongs to.",
"optional": false,
"defaultValue": "",
@@ -167,7 +167,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -185,7 +185,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "The details of the products that the Shipping Profile defines Shipping Options for. Available if the relation `products` is expanded.",
"optional": false,
"defaultValue": "",
@@ -194,7 +194,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "shipping_options",
- "type": "[`ShippingOption`](ShippingOption.mdx)[]",
+ "type": "[ShippingOption](ShippingOption.mdx)[]",
"description": "The details of the shipping options that can be used to create shipping methods for the Products in the Shipping Profile.",
"optional": false,
"defaultValue": "",
@@ -203,8 +203,8 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "type",
- "type": "[`ShippingProfileType`](../enums/ShippingProfileType.mdx)",
- "description": "The type of the Shipping Profile, may be `default`, `gift_card` or `custom`.",
+ "type": "[ShippingProfileType](../enums/ShippingProfileType.mdx)",
+ "description": "The type of the Shipping Profile, may be `default`, `gift\\_card` or `custom`.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -232,7 +232,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "provider",
- "type": "[`FulfillmentProvider`](FulfillmentProvider.mdx)",
+ "type": "[FulfillmentProvider](FulfillmentProvider.mdx)",
"description": "The details of the fulfillment provider that will be used to later to process the shipping method created from this shipping option and its fulfillments.",
"optional": false,
"defaultValue": "",
@@ -250,7 +250,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
{
"name": "is_installed",
"type": "`boolean`",
- "description": "Whether the fulfillment service is installed in the current version. If a fulfillment service is no longer installed, the `is_installed` attribute is set to `false`.",
+ "description": "Whether the fulfillment service is installed in the current version. If a fulfillment service is no longer installed, the `is\\_installed` attribute is set to `false`.",
"optional": false,
"defaultValue": "true",
"expandable": false,
@@ -269,7 +269,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this shipping option can be used in.",
"optional": false,
"defaultValue": "",
@@ -286,7 +286,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "countries",
- "type": "[`Country`](Country.mdx)[]",
+ "type": "[Country](Country.mdx)[]",
"description": "The details of the countries included in this region.",
"optional": false,
"defaultValue": "",
@@ -304,7 +304,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "currency",
- "type": "[`Currency`](Currency.mdx)",
+ "type": "[Currency](Currency.mdx)",
"description": "The details of the currency used in the region.",
"optional": false,
"defaultValue": "",
@@ -331,7 +331,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "fulfillment_providers",
- "type": "[`FulfillmentProvider`](FulfillmentProvider.mdx)[]",
+ "type": "[FulfillmentProvider](FulfillmentProvider.mdx)[]",
"description": "The details of the fulfillment providers that can be used to fulfill items of orders and similar resources in the region.",
"optional": false,
"defaultValue": "",
@@ -368,7 +368,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -386,7 +386,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "payment_providers",
- "type": "[`PaymentProvider`](PaymentProvider.mdx)[]",
+ "type": "[PaymentProvider](PaymentProvider.mdx)[]",
"description": "The details of the payment providers that can be used to process payments in the region.",
"optional": false,
"defaultValue": "",
@@ -404,7 +404,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "tax_provider",
- "type": "[`TaxProvider`](TaxProvider.mdx)",
+ "type": "[TaxProvider](TaxProvider.mdx)",
"description": "The details of the tax provider used in the region.",
"optional": false,
"defaultValue": "",
@@ -431,7 +431,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "tax_rates",
- "type": "``null`` \\| [`TaxRate`](TaxRate.mdx)[]",
+ "type": "``null`` \\| [TaxRate](TaxRate.mdx)[]",
"description": "The details of the tax rates used in the region, aside from the default rate.",
"optional": false,
"defaultValue": "",
@@ -460,7 +460,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "requirements",
- "type": "[`ShippingOptionRequirement`](ShippingOptionRequirement.mdx)[]",
+ "type": "[ShippingOptionRequirement](ShippingOptionRequirement.mdx)[]",
"description": "The details of the requirements that must be satisfied for the Shipping Option to be available for usage in a Cart.",
"optional": false,
"defaultValue": "",
@@ -495,7 +495,7 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "shipping_option",
- "type": "[`ShippingOption`](ShippingOption.mdx)",
+ "type": "[ShippingOption](ShippingOption.mdx)",
"description": "The details of the shipping option that the requirements belong to.",
"optional": false,
"defaultValue": "",
@@ -513,8 +513,8 @@ A Shipping Option represents a way in which an Order or Return can be shipped. S
},
{
"name": "type",
- "type": "[`RequirementType`](../enums/RequirementType.mdx)",
- "description": "The type of the requirement, this defines how the value will be compared to the Cart's total. `min_subtotal` requirements define the minimum subtotal that is needed for the Shipping Option to be available, while the `max_subtotal` defines the maximum subtotal that the Cart can have for the Shipping Option to be available.",
+ "type": "[RequirementType](../enums/RequirementType.mdx)",
+ "description": "The type of the requirement, this defines how the value will be compared to the Cart's total. `min\\_subtotal` requirements define the minimum subtotal that is needed for the Shipping Option to be available, while the `max\\_subtotal` defines the maximum subtotal that the Cart can have for the Shipping Option to be available.",
"optional": false,
"defaultValue": "",
"expandable": false,
diff --git a/www/apps/docs/content/references/entities/classes/ShippingOptionRequirement.mdx b/www/apps/docs/content/references/entities/classes/ShippingOptionRequirement.mdx
index 3ee98ed365..f27eda8ce8 100644
--- a/www/apps/docs/content/references/entities/classes/ShippingOptionRequirement.mdx
+++ b/www/apps/docs/content/references/entities/classes/ShippingOptionRequirement.mdx
@@ -40,7 +40,7 @@ A shipping option requirement defines conditions that a Cart must satisfy for th
},
{
"name": "shipping_option",
- "type": "[`ShippingOption`](ShippingOption.mdx)",
+ "type": "[ShippingOption](ShippingOption.mdx)",
"description": "The details of the shipping option that the requirements belong to.",
"optional": false,
"defaultValue": "",
@@ -58,7 +58,7 @@ A shipping option requirement defines conditions that a Cart must satisfy for th
{
"name": "amount",
"type": "``null`` \\| `number`",
- "description": "The amount to charge for shipping when the Shipping Option price type is `flat_rate`.",
+ "description": "The amount to charge for shipping when the Shipping Option price type is `flat\\_rate`.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -75,7 +75,7 @@ A shipping option requirement defines conditions that a Cart must satisfy for th
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The data needed for the Fulfillment Provider to identify the Shipping Option.",
"optional": false,
"defaultValue": "",
@@ -121,7 +121,7 @@ A shipping option requirement defines conditions that a Cart must satisfy for th
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -139,8 +139,8 @@ A shipping option requirement defines conditions that a Cart must satisfy for th
},
{
"name": "price_type",
- "type": "[`ShippingOptionPriceType`](../enums/ShippingOptionPriceType.mdx)",
- "description": "The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations.",
+ "type": "[ShippingOptionPriceType](../enums/ShippingOptionPriceType.mdx)",
+ "description": "The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat\\_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -148,7 +148,7 @@ A shipping option requirement defines conditions that a Cart must satisfy for th
},
{
"name": "profile",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)",
+ "type": "[ShippingProfile](ShippingProfile.mdx)",
"description": "The details of the shipping profile that the shipping option belongs to.",
"optional": false,
"defaultValue": "",
@@ -166,7 +166,7 @@ A shipping option requirement defines conditions that a Cart must satisfy for th
},
{
"name": "provider",
- "type": "[`FulfillmentProvider`](FulfillmentProvider.mdx)",
+ "type": "[FulfillmentProvider](FulfillmentProvider.mdx)",
"description": "The details of the fulfillment provider that will be used to later to process the shipping method created from this shipping option and its fulfillments.",
"optional": false,
"defaultValue": "",
@@ -184,7 +184,7 @@ A shipping option requirement defines conditions that a Cart must satisfy for th
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this shipping option can be used in.",
"optional": false,
"defaultValue": "",
@@ -202,7 +202,7 @@ A shipping option requirement defines conditions that a Cart must satisfy for th
},
{
"name": "requirements",
- "type": "[`ShippingOptionRequirement`](ShippingOptionRequirement.mdx)[]",
+ "type": "[ShippingOptionRequirement](ShippingOptionRequirement.mdx)[]",
"description": "The details of the requirements that must be satisfied for the Shipping Option to be available for usage in a Cart.",
"optional": false,
"defaultValue": "",
@@ -231,8 +231,8 @@ A shipping option requirement defines conditions that a Cart must satisfy for th
},
{
"name": "type",
- "type": "[`RequirementType`](../enums/RequirementType.mdx)",
- "description": "The type of the requirement, this defines how the value will be compared to the Cart's total. `min_subtotal` requirements define the minimum subtotal that is needed for the Shipping Option to be available, while the `max_subtotal` defines the maximum subtotal that the Cart can have for the Shipping Option to be available.",
+ "type": "[RequirementType](../enums/RequirementType.mdx)",
+ "description": "The type of the requirement, this defines how the value will be compared to the Cart's total. `min\\_subtotal` requirements define the minimum subtotal that is needed for the Shipping Option to be available, while the `max\\_subtotal` defines the maximum subtotal that the Cart can have for the Shipping Option to be available.",
"optional": false,
"defaultValue": "",
"expandable": false,
diff --git a/www/apps/docs/content/references/entities/classes/ShippingProfile.mdx b/www/apps/docs/content/references/entities/classes/ShippingProfile.mdx
index df5b197f60..597a4584b9 100644
--- a/www/apps/docs/content/references/entities/classes/ShippingProfile.mdx
+++ b/www/apps/docs/content/references/entities/classes/ShippingProfile.mdx
@@ -6,7 +6,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
# ShippingProfile
-A Shipping Profile has a set of defined Shipping Options that can be used to fulfill a given set of Products. For example, gift cards are shipped differently than physical products, so a shipping profile with the type `gift_card` groups together the shipping options that can only be used for gift cards.
+A Shipping Profile has a set of defined Shipping Options that can be used to fulfill a given set of Products. For example, gift cards are shipped differently than physical products, so a shipping profile with the type `gift\_card` groups together the shipping options that can only be used for gift cards.
## Properties
@@ -40,7 +40,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -58,7 +58,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "The details of the products that the Shipping Profile defines Shipping Options for. Available if the relation `products` is expanded.",
"optional": false,
"defaultValue": "",
@@ -66,7 +66,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
"children": [
{
"name": "categories",
- "type": "[`ProductCategory`](ProductCategory.mdx)[]",
+ "type": "[ProductCategory](ProductCategory.mdx)[]",
"description": "The details of the product categories that this product belongs to.",
"optional": false,
"defaultValue": "",
@@ -76,7 +76,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "collection",
- "type": "[`ProductCollection`](ProductCollection.mdx)",
+ "type": "[ProductCollection](ProductCollection.mdx)",
"description": "The details of the product collection that the product belongs to.",
"optional": false,
"defaultValue": "",
@@ -175,7 +175,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "images",
- "type": "[`Image`](Image.mdx)[]",
+ "type": "[Image](Image.mdx)[]",
"description": "The details of the product's images.",
"optional": false,
"defaultValue": "",
@@ -211,7 +211,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "metadata",
- "type": "``null`` \\| Record<`string`, `unknown`\\>",
+ "type": "``null`` \\| `Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -229,7 +229,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "options",
- "type": "[`ProductOption`](ProductOption.mdx)[]",
+ "type": "[ProductOption](ProductOption.mdx)[]",
"description": "The details of the Product Options that are defined for the Product. The product's variants will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
@@ -247,7 +247,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "profile",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)",
+ "type": "[ShippingProfile](ShippingProfile.mdx)",
"description": "The details of the shipping profile that the product belongs to. The shipping profile has a set of defined shipping options that can be used to fulfill the product.",
"optional": false,
"defaultValue": "",
@@ -265,7 +265,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "profiles",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)[]",
+ "type": "[ShippingProfile](ShippingProfile.mdx)[]",
"description": "Available if the relation `profiles` is expanded.",
"optional": false,
"defaultValue": "",
@@ -274,7 +274,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "sales_channels",
- "type": "[`SalesChannel`](SalesChannel.mdx)[]",
+ "type": "[SalesChannel](SalesChannel.mdx)[]",
"description": "The details of the sales channels this product is available in.",
"optional": false,
"defaultValue": "",
@@ -283,7 +283,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "status",
- "type": "[`ProductStatus`](../enums/ProductStatus.mdx)",
+ "type": "[ProductStatus](../enums/ProductStatus.mdx)",
"description": "The status of the product",
"optional": false,
"defaultValue": "draft",
@@ -301,7 +301,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "tags",
- "type": "[`ProductTag`](ProductTag.mdx)[]",
+ "type": "[ProductTag](ProductTag.mdx)[]",
"description": "The details of the product tags used in this product.",
"optional": false,
"defaultValue": "",
@@ -328,7 +328,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "type",
- "type": "[`ProductType`](ProductType.mdx)",
+ "type": "[ProductType](ProductType.mdx)",
"description": "The details of the product type that the product belongs to.",
"optional": false,
"defaultValue": "",
@@ -355,7 +355,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "variants",
- "type": "[`ProductVariant`](ProductVariant.mdx)[]",
+ "type": "[ProductVariant](ProductVariant.mdx)[]",
"description": "The details of the Product Variants that belong to the Product. Each will have a unique combination of values of the product's options.",
"optional": false,
"defaultValue": "",
@@ -384,7 +384,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "shipping_options",
- "type": "[`ShippingOption`](ShippingOption.mdx)[]",
+ "type": "[ShippingOption](ShippingOption.mdx)[]",
"description": "The details of the shipping options that can be used to create shipping methods for the Products in the Shipping Profile.",
"optional": false,
"defaultValue": "",
@@ -402,7 +402,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
{
"name": "amount",
"type": "``null`` \\| `number`",
- "description": "The amount to charge for shipping when the Shipping Option price type is `flat_rate`.",
+ "description": "The amount to charge for shipping when the Shipping Option price type is `flat\\_rate`.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -419,7 +419,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The data needed for the Fulfillment Provider to identify the Shipping Option.",
"optional": false,
"defaultValue": "",
@@ -465,7 +465,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -483,8 +483,8 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "price_type",
- "type": "[`ShippingOptionPriceType`](../enums/ShippingOptionPriceType.mdx)",
- "description": "The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations.",
+ "type": "[ShippingOptionPriceType](../enums/ShippingOptionPriceType.mdx)",
+ "description": "The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat\\_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -492,7 +492,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "profile",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)",
+ "type": "[ShippingProfile](ShippingProfile.mdx)",
"description": "The details of the shipping profile that the shipping option belongs to.",
"optional": false,
"defaultValue": "",
@@ -510,7 +510,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "provider",
- "type": "[`FulfillmentProvider`](FulfillmentProvider.mdx)",
+ "type": "[FulfillmentProvider](FulfillmentProvider.mdx)",
"description": "The details of the fulfillment provider that will be used to later to process the shipping method created from this shipping option and its fulfillments.",
"optional": false,
"defaultValue": "",
@@ -528,7 +528,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this shipping option can be used in.",
"optional": false,
"defaultValue": "",
@@ -546,7 +546,7 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "requirements",
- "type": "[`ShippingOptionRequirement`](ShippingOptionRequirement.mdx)[]",
+ "type": "[ShippingOptionRequirement](ShippingOptionRequirement.mdx)[]",
"description": "The details of the requirements that must be satisfied for the Shipping Option to be available for usage in a Cart.",
"optional": false,
"defaultValue": "",
@@ -566,8 +566,8 @@ A Shipping Profile has a set of defined Shipping Options that can be used to ful
},
{
"name": "type",
- "type": "[`ShippingProfileType`](../enums/ShippingProfileType.mdx)",
- "description": "The type of the Shipping Profile, may be `default`, `gift_card` or `custom`.",
+ "type": "[ShippingProfileType](../enums/ShippingProfileType.mdx)",
+ "description": "The type of the Shipping Profile, may be `default`, `gift\\_card` or `custom`.",
"optional": false,
"defaultValue": "",
"expandable": false,
diff --git a/www/apps/docs/content/references/entities/classes/ShippingTaxRate.mdx b/www/apps/docs/content/references/entities/classes/ShippingTaxRate.mdx
index 9fc802a7e7..98eb4d6cd2 100644
--- a/www/apps/docs/content/references/entities/classes/ShippingTaxRate.mdx
+++ b/www/apps/docs/content/references/entities/classes/ShippingTaxRate.mdx
@@ -22,7 +22,7 @@ This represents the tax rates applied on a shipping option.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -40,7 +40,7 @@ This represents the tax rates applied on a shipping option.
},
{
"name": "shipping_option",
- "type": "[`ShippingOption`](ShippingOption.mdx)",
+ "type": "[ShippingOption](ShippingOption.mdx)",
"description": "The details of the shipping option.",
"optional": true,
"defaultValue": "",
@@ -58,7 +58,7 @@ This represents the tax rates applied on a shipping option.
{
"name": "amount",
"type": "``null`` \\| `number`",
- "description": "The amount to charge for shipping when the Shipping Option price type is `flat_rate`.",
+ "description": "The amount to charge for shipping when the Shipping Option price type is `flat\\_rate`.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -75,7 +75,7 @@ This represents the tax rates applied on a shipping option.
},
{
"name": "data",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "The data needed for the Fulfillment Provider to identify the Shipping Option.",
"optional": false,
"defaultValue": "",
@@ -121,7 +121,7 @@ This represents the tax rates applied on a shipping option.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -139,8 +139,8 @@ This represents the tax rates applied on a shipping option.
},
{
"name": "price_type",
- "type": "[`ShippingOptionPriceType`](../enums/ShippingOptionPriceType.mdx)",
- "description": "The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations.",
+ "type": "[ShippingOptionPriceType](../enums/ShippingOptionPriceType.mdx)",
+ "description": "The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat\\_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -148,7 +148,7 @@ This represents the tax rates applied on a shipping option.
},
{
"name": "profile",
- "type": "[`ShippingProfile`](ShippingProfile.mdx)",
+ "type": "[ShippingProfile](ShippingProfile.mdx)",
"description": "The details of the shipping profile that the shipping option belongs to.",
"optional": false,
"defaultValue": "",
@@ -166,7 +166,7 @@ This represents the tax rates applied on a shipping option.
},
{
"name": "provider",
- "type": "[`FulfillmentProvider`](FulfillmentProvider.mdx)",
+ "type": "[FulfillmentProvider](FulfillmentProvider.mdx)",
"description": "The details of the fulfillment provider that will be used to later to process the shipping method created from this shipping option and its fulfillments.",
"optional": false,
"defaultValue": "",
@@ -184,7 +184,7 @@ This represents the tax rates applied on a shipping option.
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region this shipping option can be used in.",
"optional": false,
"defaultValue": "",
@@ -202,7 +202,7 @@ This represents the tax rates applied on a shipping option.
},
{
"name": "requirements",
- "type": "[`ShippingOptionRequirement`](ShippingOptionRequirement.mdx)[]",
+ "type": "[ShippingOptionRequirement](ShippingOptionRequirement.mdx)[]",
"description": "The details of the requirements that must be satisfied for the Shipping Option to be available for usage in a Cart.",
"optional": false,
"defaultValue": "",
@@ -231,7 +231,7 @@ This represents the tax rates applied on a shipping option.
},
{
"name": "tax_rate",
- "type": "[`TaxRate`](TaxRate.mdx)",
+ "type": "[TaxRate](TaxRate.mdx)",
"description": "The details of the associated tax rate.",
"optional": true,
"defaultValue": "",
@@ -266,7 +266,7 @@ This represents the tax rates applied on a shipping option.
},
{
"name": "metadata",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record`",
"description": "An optional key-value map with additional details",
"optional": false,
"defaultValue": "",
@@ -302,7 +302,7 @@ This represents the tax rates applied on a shipping option.
},
{
"name": "product_types",
- "type": "[`ProductType`](ProductType.mdx)[]",
+ "type": "[ProductType](ProductType.mdx)[]",
"description": "The details of the product types that belong to this tax rate.",
"optional": false,
"defaultValue": "",
@@ -311,7 +311,7 @@ This represents the tax rates applied on a shipping option.
},
{
"name": "products",
- "type": "[`Product`](Product.mdx)[]",
+ "type": "[Product](Product.mdx)[]",
"description": "The details of the products that belong to this tax rate.",
"optional": false,
"defaultValue": "",
@@ -329,7 +329,7 @@ This represents the tax rates applied on a shipping option.
},
{
"name": "region",
- "type": "[`Region`](Region.mdx)",
+ "type": "[Region](Region.mdx)",
"description": "The details of the region that the rate belongs to.",
"optional": false,
"defaultValue": "",
@@ -356,7 +356,7 @@ This represents the tax rates applied on a shipping option.
},
{
"name": "shipping_options",
- "type": "[`ShippingOption`](ShippingOption.mdx)[]",
+ "type": "[ShippingOption](ShippingOption.mdx)[]",
"description": "The details of the shipping options that belong to this tax rate.",
"optional": false,
"defaultValue": "",
diff --git a/www/apps/docs/content/references/entities/classes/StagedJob.mdx b/www/apps/docs/content/references/entities/classes/StagedJob.mdx
index 4cc393e7ca..63350dfd34 100644
--- a/www/apps/docs/content/references/entities/classes/StagedJob.mdx
+++ b/www/apps/docs/content/references/entities/classes/StagedJob.mdx
@@ -13,7 +13,7 @@ A staged job resource
",
+ "type": "`Record`",
"description": "Data necessary for the job",
"optional": false,
"defaultValue": "",
@@ -40,7 +40,7 @@ A staged job resource
},
{
"name": "options",
- "type": "Record<`string`, `unknown`\\>",
+ "type": "`Record