diff --git a/docs-util/packages/scripts/package.json b/docs-util/packages/scripts/package.json
index 840eb89798..5eaf9a3e75 100644
--- a/docs-util/packages/scripts/package.json
+++ b/docs-util/packages/scripts/package.json
@@ -33,7 +33,7 @@
"typedoc-plugin-missing-exports": "^2.1.0",
"typedoc-plugin-reference-excluder": "1.1.3",
"typedoc-plugin-rename-defaults": "^0.6.6",
- "typescript": "^5.2.2"
+ "typescript": "5.2"
},
"devDependencies": {
"@types/randomcolor": "^0.5.8"
diff --git a/docs-util/packages/typedoc-config/fulfillment.js b/docs-util/packages/typedoc-config/fulfillment.js
new file mode 100644
index 0000000000..d496d3f4b6
--- /dev/null
+++ b/docs-util/packages/typedoc-config/fulfillment.js
@@ -0,0 +1,64 @@
+/* eslint-disable @typescript-eslint/no-var-requires */
+const path = require("path")
+const globalTypedocOptions = require("./_base")
+
+const pathPrefix = path.join(__dirname, "..", "..", "..")
+
+module.exports = {
+ ...globalTypedocOptions,
+ entryPoints: [
+ path.join(
+ pathPrefix,
+ "packages/medusa/src/interfaces/fulfillment-service.ts"
+ ),
+ ],
+ out: [path.join(pathPrefix, "www/apps/docs/content/references/fulfillment")],
+ tsconfig: path.join(__dirname, "extended-tsconfig", "medusa.json"),
+ name: "Fulfillment Provider Reference",
+ indexTitle: "Fulfillment Provider Reference",
+ entryDocument: "_index.mdx",
+ hideInPageTOC: true,
+ hideBreadcrumbs: true,
+ formatting: {
+ "*": {
+ showCommentsAsHeader: true,
+ sections: {
+ member_sources_definedIn: false,
+ reflection_hierarchy: false,
+ member_sources_inheritedFrom: false,
+ member_sources_implementationOf: false,
+ reflection_implementedBy: false,
+ member_signature_sources: false,
+ reflection_callable: false,
+ reflection_indexable: false,
+ reflection_implements: false,
+ member_signature_title: false,
+ member_signature_returns: false,
+ },
+ parameterStyle: "component",
+ parameterComponent: "ParameterTypes",
+ mdxImports: [
+ `import ParameterTypes from "@site/src/components/ParameterTypes"`,
+ ],
+ reflectionGroups: {
+ Properties: false,
+ },
+ frontmatterData: {
+ displayed_sidebar: "modules",
+ },
+ },
+ AbstractFulfillmentService: {
+ reflectionDescription: `In this document, you’ll learn how to create a fulfillment provider to a Medusa backend and the methods you must implement in it. If you’re unfamiliar with the Shipping architecture in Medusa, make sure to [check out the overview first](https://docs.medusajs.com/modules/carts-and-checkout/shipping).`,
+ frontmatterData: {
+ displayed_sidebar: "modules",
+ slug: "/modules/carts-and-checkout/backend/add-fulfillment-provider",
+ },
+ reflectionTitle: {
+ fullReplacement: "How to Create a Fulfillment Provider",
+ },
+ },
+ },
+ objectLiteralTypeDeclarationStyle: "component",
+ mdxOutput: true,
+ maxLevel: 2,
+}
diff --git a/docs-util/packages/typedoc-plugin-custom/package.json b/docs-util/packages/typedoc-plugin-custom/package.json
index d584fad384..7720376f47 100644
--- a/docs-util/packages/typedoc-plugin-custom/package.json
+++ b/docs-util/packages/typedoc-plugin-custom/package.json
@@ -23,7 +23,7 @@
},
"devDependencies": {
"@types/node": "^16.11.10",
- "typescript": "^4.6"
+ "typescript": "5.2"
},
"keywords": [
"typedocplugin",
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/package.json b/docs-util/packages/typedoc-plugin-markdown-medusa/package.json
index 2477c6a68d..87ec7551d0 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/package.json
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/package.json
@@ -23,7 +23,7 @@
"devDependencies": {
"@types/node": "^16.11.10",
"copyfiles": "^2.4.1",
- "typescript": "^4.6"
+ "typescript": "5.2"
},
"keywords": [
"typedocplugin",
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/render-utils.ts b/docs-util/packages/typedoc-plugin-markdown-medusa/src/render-utils.ts
index 615f6db13f..31c55c9a69 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/render-utils.ts
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/render-utils.ts
@@ -45,6 +45,10 @@ import commentTagHelper from "./resources/helpers/comment-tag"
import exampleHelper from "./resources/helpers/example"
import ifFeatureFlagHelper from "./resources/helpers/if-feature-flag"
import featureFlagHelper from "./resources/helpers/feature-flag"
+import decrementCurrentTitleLevelHelper from "./resources/helpers/decrement-current-title-level"
+import incrementCurrentTitleLevelHelper from "./resources/helpers/increment-current-title-level"
+import hasMoreThanOneSignatureHelper from "./resources/helpers/has-more-than-one-signature"
+import ifCanShowConstructorsTitleHelper from "./resources/helpers/if-can-show-constructors-title"
import { MarkdownTheme } from "./theme"
// test
@@ -120,4 +124,8 @@ export function registerHelpers(theme: MarkdownTheme) {
exampleHelper()
ifFeatureFlagHelper()
featureFlagHelper()
+ decrementCurrentTitleLevelHelper(theme)
+ incrementCurrentTitleLevelHelper(theme)
+ hasMoreThanOneSignatureHelper()
+ ifCanShowConstructorsTitleHelper()
}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/comment-tag.ts b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/comment-tag.ts
index 10330212f0..12b643effa 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/comment-tag.ts
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/comment-tag.ts
@@ -6,7 +6,7 @@ import { MarkdownTheme } from "../../theme"
export default function (theme: MarkdownTheme) {
Handlebars.registerHelper(
"commentTag",
- function (tag: CommentTag, commentLevel = 4, parent = null) {
+ function (tag: CommentTag, parent = null) {
const { showCommentsAsHeader, showCommentsAsDetails } =
theme.getFormattingOptionsForLocation()
if (tag.tag === "@schema") {
@@ -19,8 +19,7 @@ export default function (theme: MarkdownTheme) {
if (showCommentsAsHeader) {
return `${Handlebars.helpers.titleLevel.call(
- parent,
- commentLevel
+ parent
)} ${tagTitle}\n\n${tagContent}`
} else if (showCommentsAsDetails) {
return `\n\n${tagTitle}\n
\n\n${tagContent}\n\n `
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/comments.ts b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/comments.ts
index 9bceb4edfc..c41d41a5c3 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/comments.ts
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/comments.ts
@@ -10,7 +10,6 @@ export default function () {
comment: Comment,
showSummary = true,
showTags = true,
- commentLevel = 4,
parent = null
) {
const md: string[] = []
@@ -24,11 +23,7 @@ export default function () {
(tag) => !EXCLUDED_TAGS.includes(tag.tag)
)
const tags = filteredTags.map((tag) => {
- return Handlebars.helpers.commentTag(
- tag,
- commentLevel,
- parent || comment
- )
+ return Handlebars.helpers.commentTag(tag, parent || comment)
})
md.push(tags.join("\n\n"))
}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/decrement-current-title-level.ts b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/decrement-current-title-level.ts
new file mode 100644
index 0000000000..b14504682b
--- /dev/null
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/decrement-current-title-level.ts
@@ -0,0 +1,9 @@
+import { MarkdownTheme } from "../../theme"
+import * as Handlebars from "handlebars"
+
+export default function (theme: MarkdownTheme) {
+ Handlebars.registerHelper("decrementCurrentTitleLevel", function () {
+ const { currentTitleLevel } = theme
+ theme.setCurrentTitleLevel(currentTitleLevel - 1)
+ })
+}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/example.ts b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/example.ts
index c62a662a1b..e9c570967a 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/example.ts
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/example.ts
@@ -2,18 +2,15 @@ import * as Handlebars from "handlebars"
import { Reflection } from "typedoc"
export default function () {
- Handlebars.registerHelper(
- "example",
- function (reflection: Reflection, commentLevel = 4) {
- const exampleTag = reflection.comment?.blockTags.find(
- (tag) => tag.tag === "@example"
- )
+ Handlebars.registerHelper("example", function (reflection: Reflection) {
+ const exampleTag = reflection.comment?.blockTags.find(
+ (tag) => tag.tag === "@example"
+ )
- if (!exampleTag) {
- return ""
- }
-
- return Handlebars.helpers.commentTag(exampleTag, commentLevel, reflection)
+ if (!exampleTag) {
+ return ""
}
- )
+
+ return Handlebars.helpers.commentTag(exampleTag, reflection)
+ })
}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/has-more-than-one-signature.ts b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/has-more-than-one-signature.ts
new file mode 100644
index 0000000000..0a1a9fd621
--- /dev/null
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/has-more-than-one-signature.ts
@@ -0,0 +1,11 @@
+import { DeclarationReflection } from "typedoc"
+import * as Handlebars from "handlebars"
+
+export default function () {
+ Handlebars.registerHelper(
+ "hasMoreThanOneSignature",
+ function (model: DeclarationReflection) {
+ return (model.signatures?.length || 0) > 1
+ }
+ )
+}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/if-can-show-constructors-title.ts b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/if-can-show-constructors-title.ts
new file mode 100644
index 0000000000..4095eb8e52
--- /dev/null
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/if-can-show-constructors-title.ts
@@ -0,0 +1,14 @@
+import * as Handlebars from "handlebars"
+import { ReflectionGroup } from "typedoc"
+
+export default function () {
+ Handlebars.registerHelper(
+ "ifCanShowConstructorTitle",
+ function (this: ReflectionGroup, options: Handlebars.HelperOptions) {
+ return this.title.toLowerCase() !== "constructors" ||
+ this.children.length > 1
+ ? options.fn(this)
+ : options.inverse(this)
+ }
+ )
+}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/increment-current-title-level.ts b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/increment-current-title-level.ts
new file mode 100644
index 0000000000..02f8c2a511
--- /dev/null
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/increment-current-title-level.ts
@@ -0,0 +1,9 @@
+import { MarkdownTheme } from "../../theme"
+import * as Handlebars from "handlebars"
+
+export default function (theme: MarkdownTheme) {
+ Handlebars.registerHelper("incrementCurrentTitleLevel", function () {
+ const { currentTitleLevel } = theme
+ theme.setCurrentTitleLevel(currentTitleLevel + 1)
+ })
+}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/reflection-title.ts b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/reflection-title.ts
index 2fa95ec9b1..65ef9a2abc 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/reflection-title.ts
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/reflection-title.ts
@@ -10,6 +10,10 @@ export default function (theme: MarkdownTheme) {
function (this: PageEvent, shouldEscape = true) {
const { reflectionTitle } = theme.getFormattingOptionsForLocation()
+ if (reflectionTitle?.fullReplacement?.length) {
+ return reflectionTitle.fullReplacement
+ }
+
const title: string[] = [""]
if (
reflectionTitle?.kind &&
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/signature-title.ts b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/signature-title.ts
index 0bfebe6f1e..c4c11008a2 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/signature-title.ts
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/signature-title.ts
@@ -13,11 +13,15 @@ export default function (theme: MarkdownTheme) {
function (this: SignatureReflection, accessor?: string, standalone = true) {
const { sections, expandMembers = false } =
theme.getFormattingOptionsForLocation()
- if (sections && sections.member_signature_title === false) {
+ const parentHasMoreThanOneSignature =
+ Handlebars.helpers.hasMoreThanOneSignature(this.parent)
+ if (
+ sections &&
+ sections.member_signature_title === false &&
+ !parentHasMoreThanOneSignature
+ ) {
// only show title if there are more than one signatures
- if (!this.parent.signatures || this.parent.signatures.length <= 1) {
- return ""
- }
+ return ""
}
const md: string[] = []
@@ -36,12 +40,12 @@ export default function (theme: MarkdownTheme) {
if (accessor) {
md.push(
`${accessor}${
- expandMembers ? `${Handlebars.helpers.titleLevel(4)} ` : "**"
+ expandMembers ? `${Handlebars.helpers.titleLevel()} ` : "**"
}${this.name}${!expandMembers ? "**" : ""}`
)
} else if (this.name !== "__call" && this.name !== "__type") {
md.push(
- `${expandMembers ? `${Handlebars.helpers.titleLevel(4)} ` : "**"}${
+ `${expandMembers ? `${Handlebars.helpers.titleLevel()} ` : "**"}${
this.name
}${!expandMembers ? "**" : ""}`
)
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/title-level.ts b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/title-level.ts
index 5e2360c271..3aed90593f 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/title-level.ts
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/helpers/title-level.ts
@@ -1,44 +1,18 @@
import { MarkdownTheme } from "../../theme"
import * as Handlebars from "handlebars"
-import { SignatureReflection, Reflection } from "typedoc"
+import { Reflection } from "typedoc"
export default function (theme: MarkdownTheme) {
- Handlebars.registerHelper(
- "titleLevel",
- function (this: Reflection, originalLevel = 3): string {
- const { expandMembers, sections } =
- theme.getFormattingOptionsForLocation()
+ Handlebars.registerHelper("titleLevel", function (this: Reflection): string {
+ const { currentTitleLevel } = theme
- if (!expandMembers) {
- return Array(originalLevel).fill("#").join("")
- }
+ // let titleLevel = currentTitleLevel
- const { allReflectionsHaveOwnDocument } = theme
+ // if (isChild) {
+ // titleLevel++
+ // theme.setCurrentTitleLevel(titleLevel + 1)
+ // }
- let isSignatureChild = false
- if (
- sections &&
- sections.member_signature_title === false &&
- (this instanceof SignatureReflection || this.variant === "signature")
- ) {
- // only show title if there are more than one signatures
- isSignatureChild =
- this.parent !== undefined &&
- "signatures" in this.parent &&
- (this.parent.signatures as SignatureReflection[]).length > 1
- }
-
- const numberToSubtract = allReflectionsHaveOwnDocument
- ? isSignatureChild
- ? 1
- : 2
- : isSignatureChild
- ? 0
- : 1
-
- const level = originalLevel - numberToSubtract
-
- return Array(level).fill("#").join("")
- }
- )
+ return Array(currentTitleLevel).fill("#").join("")
+ })
}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/comment.hbs b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/comment.hbs
index 1d950b6ffd..2889e8ed55 100755
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/comment.hbs
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/comment.hbs
@@ -4,7 +4,7 @@
{{#if hasVisibleComponent}}
-{{{comments this true true 4 model}}}
+{{{comments this true true model}}}
{{/if}}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.declaration.hbs b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.declaration.hbs
index 2a339b5737..f9cbb59a86 100755
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.declaration.hbs
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.declaration.hbs
@@ -12,7 +12,7 @@
{{#if (sectionEnabled "member_declaration_example")}}
-{{{example this 4}}}
+{{{example this}}}
{{/if}}
@@ -20,7 +20,7 @@
{{#if typeParameters}}
-{{{titleLevel 4}}} Type Parameters
+{{{titleLevel}}} Type Parameters
{{#with typeParameters}}
@@ -40,7 +40,7 @@
{{#with type.declaration.indexSignature}}
-{{titleLevel 4}} Index signature
+{{titleLevel}} Index signature
{{{indexSignatureTitle}}}
@@ -58,17 +58,21 @@
{{#if type.declaration.children}}
-{{{titleLevel 4}}} Call signature
+{{{titleLevel}}} Call signature
{{else}}
-{{{titleLevel 4}}} Type declaration
+{{{titleLevel}}} Type declaration
{{/if}}
{{#each type.declaration.signatures}}
-{{> member.signature showSources=false commentLevel=5 }}
+{{incrementCurrentTitleLevel}}
+
+{{> member.signature showSources=false }}
+
+{{decrementCurrentTitleLevel}}
{{/each}}
@@ -82,7 +86,7 @@
{{#with type.declaration}}
-{{{titleLevel 4}}} Type declaration
+{{{titleLevel}}} Type declaration
{{/with}}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.getterSetter.hbs b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.getterSetter.hbs
index 746961b44c..0657dc1fbd 100755
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.getterSetter.hbs
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.getterSetter.hbs
@@ -4,7 +4,7 @@
{{#with getSignature}}
-{{> member.signature accessor="get" showSources=true commentLevel=4 }}
+{{> member.signature accessor="get" showSources=true }}
{{/with}}
@@ -18,7 +18,7 @@
{{#with setSignature}}
-{{> member.signature accessor="set" showSources=true commentLevel=4 }}
+{{> member.signature accessor="set" showSources=true }}
{{/with}}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.hbs b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.hbs
index 91c0a4f0dd..30ac37c284 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.hbs
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.hbs
@@ -2,7 +2,9 @@
{{#if name}}
-{{titleLevel 4}} {{#ifNamedAnchors}} {{/ifNamedAnchors}}{{ escape name }}
+{{titleLevel}} {{#ifNamedAnchors}} {{/ifNamedAnchors}}{{ escape name }}
+
+{{incrementCurrentTitleLevel}}
{{/if}}
@@ -14,7 +16,7 @@
{{#each signatures}}
-{{> member.signature showSources=true commentLevel=../commentLevel }}
+{{> member.signature showSources=true }}
{{/each}}
@@ -59,3 +61,13 @@
___
{{/unless}}
{{/unless}}
+
+{{#unless hasOwnDocument}}
+
+{{#if name}}
+
+{{decrementCurrentTitleLevel}}
+
+{{/if}}
+
+{{/unless}}
\ No newline at end of file
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.signature.hbs b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.signature.hbs
index 7a50c41def..15c12ac98d 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.signature.hbs
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.signature.hbs
@@ -1,5 +1,15 @@
{{{signatureTitle accessor}}}
+{{#if (getFormattingOption "expandMembers")}}
+
+{{#if (hasMoreThanOneSignature parent)}}
+
+{{incrementCurrentTitleLevel}}
+
+{{/if}}
+
+{{/if}}
+
{{#if (sectionEnabled "member_signature_comment")}}
{{#with comment}}
@@ -16,7 +26,7 @@
{{#if (sectionEnabled "member_signature_example")}}
-{{{example this commentLevel}}}
+{{{example this}}}
{{/if}}
@@ -24,7 +34,7 @@
{{#if typeParameters}}
-{{{titleLevel commentLevel}}} Type Parameters
+{{{titleLevel}}} Type Parameters
{{#with typeParameters}}
@@ -40,7 +50,7 @@
{{#if parameters}}
-{{{titleLevel commentLevel}}} Parameters
+{{{titleLevel}}} Parameters
{{#with parameters}}
@@ -56,7 +66,7 @@
{{#if type}}
-{{{titleLevel commentLevel}}} Returns
+{{{titleLevel}}} Returns
{{#if (sectionEnabled "member_signature_returns")}}
@@ -76,12 +86,16 @@
{{#if declaration.signatures}}
+{{incrementCurrentTitleLevel}}
+
{{#each declaration.signatures}}
-{{> member.signature showSources=false commentLevel=commentLevel }}
+{{> member.signature showSources=false }}
{{/each}}
+{{decrementCurrentTitleLevel}}
+
{{/if}}
{{/if}}
@@ -112,7 +126,7 @@
{{#if hasVisibleComponent}}
-{{{comments this false true commentLevel ..}}}
+{{{comments this false true ..}}}
{{/if}}
@@ -124,8 +138,22 @@
{{#if showSources}}
+{{incrementCurrentTitleLevel}}
+
{{> member.sources}}
+{{decrementCurrentTitleLevel}}
+
+{{/if}}
+
+{{/if}}
+
+{{#if (getFormattingOption "expandMembers")}}
+
+{{#if (hasMoreThanOneSignature parent)}}
+
+{{decrementCurrentTitleLevel}}
+
{{/if}}
{{/if}}
\ No newline at end of file
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.sources.hbs b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.sources.hbs
index 3b4887b4b2..74f7b38d46 100755
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.sources.hbs
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/member.sources.hbs
@@ -2,7 +2,7 @@
{{#if implementationOf}}
-{{titleLevel 4}} Implementation of
+{{titleLevel}} Implementation of
{{#with implementationOf}}
@@ -18,7 +18,7 @@
{{#if inheritedFrom}}
-{{titleLevel 4}} Inherited from
+{{titleLevel}} Inherited from
{{#with inheritedFrom}}
@@ -34,7 +34,7 @@
{{#if overwrites}}
-{{titleLevel 4}} Overrides
+{{titleLevel}} Overrides
{{#with overwrites}}
@@ -50,7 +50,7 @@
{{#if sources}}
-{{titleLevel 4}} Defined in
+{{titleLevel}} Defined in
{{#each sources}}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/members.group.hbs b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/members.group.hbs
index b32fb78432..9363f01221 100755
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/members.group.hbs
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/members.group.hbs
@@ -10,7 +10,13 @@ ___
{{#unless (getFormattingOption "expandMembers")}}
-## {{title}} {{../title}}
+{{#ifCanShowConstructorTitle}}
+
+{{titleLevel}} {{title}} {{../title}}
+
+{{incrementCurrentTitleLevel}}
+
+{{/ifCanShowConstructorTitle}}
{{/unless}}
@@ -26,19 +32,35 @@ ___
{{#each children}}
-{{> member commentLevel=5}}
+{{> member }}
{{/each}}
{{/if}}
+{{#unless (getFormattingOption "expandMembers")}}
+
+{{#ifCanShowConstructorTitle}}
+
+{{decrementCurrentTitleLevel}}
+
+{{/ifCanShowConstructorTitle}}
+
+{{/unless}}
+
{{/each}}
{{else}}
{{#unless (getFormattingOption "expandMembers")}}
-## {{title}}
+{{#ifCanShowConstructorTitle}}
+
+{{titleLevel}} {{title}}
+
+{{incrementCurrentTitleLevel}}
+
+{{/ifCanShowConstructorTitle}}
{{/unless}}
@@ -54,12 +76,22 @@ ___
{{#each children}}
-{{> member commentLevel=5}}
+{{> member}}
{{/each}}
{{/if}}
+{{#unless (getFormattingOption "expandMembers")}}
+
+{{#ifCanShowConstructorTitle}}
+
+{{decrementCurrentTitleLevel}}
+
+{{/ifCanShowConstructorTitle}}
+
+{{/unless}}
+
{{/if}}
{{/if}}
\ No newline at end of file
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/members.hbs b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/members.hbs
index c00601347a..19279a9042 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/members.hbs
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/members.hbs
@@ -8,7 +8,9 @@
{{#unless (getFormattingOption "expandMembers")}}
-## {{title}}
+{{{titleLevel}}} {{title}}
+
+{{incrementCurrentTitleLevel}}
{{/unless}}
@@ -16,12 +18,18 @@
{{#unless hasOwnDocument}}
-{{> member commentLevel=4}}
+{{> member}}
{{/unless}}
{{/each}}
+{{#unless (getFormattingOption "expandMembers")}}
+
+{{decrementCurrentTitleLevel}}
+
+{{/unless}}
+
{{/unless}}
{{/each}}
@@ -32,6 +40,10 @@
{{#unless allChildrenHaveOwnDocument}}
+{{#unless @first}}
+___
+{{/unless}}
+
{{> members.group}}
{{/unless}}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/section-title.hbs b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/section-title.hbs
index e863067f41..ac1332513c 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/section-title.hbs
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/section-title.hbs
@@ -1,9 +1,13 @@
{{#if showSources}}
-{{{titleLevel 4}}} {{{title}}}
+{{incrementCurrentTitleLevel}}
-{{else}}
+{{/if}}
-{{{titleLevel 5}}} {{{title}}}
+{{{titleLevel}}} {{{title}}}
+
+{{#if showSources}}
+
+{{decrementCurrentTitleLevel}}
{{/if}}
\ No newline at end of file
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/title.hbs b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/title.hbs
index 75f8b214de..4d1bc47c1d 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/title.hbs
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/partials/title.hbs
@@ -1,6 +1,6 @@
{{#ifShowPageTitle}}
-# {{{reflectionTitle true}}}
+{{titleLevel}} {{{reflectionTitle true}}}
{{/ifShowPageTitle}}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/templates/index.hbs b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/templates/index.hbs
index 19a40da27f..c392fefe55 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/templates/index.hbs
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/templates/index.hbs
@@ -1,5 +1,7 @@
{{> header}}
+{{incrementCurrentTitleLevel}}
+
{{#with model.readme}}
{{{comment this}}}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/templates/reflection.hbs b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/templates/reflection.hbs
index 6c63ea1f9c..7f1e57e8b3 100755
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/templates/reflection.hbs
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/templates/reflection.hbs
@@ -2,6 +2,8 @@
{{> title}}
+{{incrementCurrentTitleLevel}}
+
{{#with model}}
{{#if (sectionEnabled "reflection_comment")}}
@@ -18,7 +20,7 @@
{{#if (sectionEnabled "reflection_example")}}
-{{{example model 2}}}
+{{{example model}}}
{{/if}}
@@ -26,7 +28,7 @@
{{#if model.typeParameters}}
-## Type parameters
+{{{titleLevel}}} Type parameters
{{#with model.typeParameters}}
@@ -42,7 +44,7 @@
{{#ifShowTypeHierarchy}}
-## Hierarchy
+{{{titleLevel}}} Hierarchy
{{#with model.typeHierarchy}}
@@ -58,7 +60,7 @@
{{#if model.implementedTypes}}
-## Implements
+{{{titleLevel}}} Implements
{{#each model.implementedTypes}}
- {{{type}}}
@@ -72,7 +74,7 @@
{{#if model.implementedBy}}
-## Implemented by
+{{{titleLevel}}} Implemented by
{{#each model.implementedBy}}
- {{{type}}}
@@ -86,18 +88,26 @@
{{#if model.signatures}}
-## Callable
+{{{titleLevel}}} Callable
{{#with model}}
+{{incrementCurrentTitleLevel}}
+
{{#each signatures}}
-### {{name}}
+{{{titleLevel}}} {{name}}
-{{> member.signature showSources=true commentLevel=4 }}
+{{incrementCurrentTitleLevel}}
+
+{{> member.signature showSources=true }}
+
+{{decrementCurrentTitleLevel}}
{{/each}}
+{{decrementCurrentTitleLevel}}
+
{{/with}}
{{/if}}
@@ -108,16 +118,20 @@
{{#if model.indexSignature}}
-## Indexable
+{{{titleLevel}}} Indexable
{{#with model}}
{{#with indexSignature}}
+{{incrementCurrentTitleLevel}}
+
{{{indexSignatureTitle}}}
{{> comment}}
+{{decrementCurrentTitleLevel}}
+
{{/with}}
{{/with}}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/templates/reflection.member.hbs b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/templates/reflection.member.hbs
index 8b2a6554b2..8cfcc17b9d 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/templates/reflection.member.hbs
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/resources/templates/reflection.member.hbs
@@ -4,6 +4,10 @@
{{#with model}}
-{{> member showSources=false commentLevel=4}}
+{{incrementCurrentTitleLevel}}
+
+{{> member showSources=false}}
+
+{{decrementCurrentTitleLevel}}
{{/with}}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/theme.ts b/docs-util/packages/typedoc-plugin-markdown-medusa/src/theme.ts
index 1b739b1efb..49df6b4c3c 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/theme.ts
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/theme.ts
@@ -54,6 +54,7 @@ export class MarkdownTheme extends Theme {
reflection?: DeclarationReflection
location!: string
anchorMap: Record = {}
+ currentTitleLevel = 1
static URL_PREFIX = /^(http|ftp)s?:\/\//
@@ -355,6 +356,8 @@ export class MarkdownTheme extends Theme {
* @param page An event object describing the current render operation.
*/
protected onBeginPage(page: PageEvent) {
+ // reset header level counter
+ this.currentTitleLevel = 1
this.location = page.url
this.reflection =
page.model instanceof DeclarationReflection ? page.model : undefined
@@ -403,6 +406,10 @@ export class MarkdownTheme extends Theme {
return `modules.${this.mdxOutput ? "mdx" : "md"}`
}
+ setCurrentTitleLevel(value: number) {
+ this.currentTitleLevel = value
+ }
+
getFormattingOptionsForLocation(): FormattingOptionType {
if (!this.location) {
return {}
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/types.ts b/docs-util/packages/typedoc-plugin-markdown-medusa/src/types.ts
index 8187cf1d80..3b910dd9b2 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/types.ts
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/types.ts
@@ -67,6 +67,7 @@ export type FormattingOptionType = {
kind: boolean
typeParameters: boolean
suffix?: string
+ fullReplacement?: string
}
reflectionDescription?: string
expandMembers?: boolean
diff --git a/docs-util/packages/typedoc-plugin-markdown-medusa/src/utils/reflection-formatter.ts b/docs-util/packages/typedoc-plugin-markdown-medusa/src/utils/reflection-formatter.ts
index fc7909b1dd..32681e883c 100644
--- a/docs-util/packages/typedoc-plugin-markdown-medusa/src/utils/reflection-formatter.ts
+++ b/docs-util/packages/typedoc-plugin-markdown-medusa/src/utils/reflection-formatter.ts
@@ -109,7 +109,7 @@ export function reflectionComponentFormatter(
? getType(reflection.type, "object")
: getReflectionType(reflection, "object", true),
description: comments
- ? stripLineBreaks(Handlebars.helpers.comments(comments, true, false))
+ ? Handlebars.helpers.comments(comments, true, false)
: "",
optional,
defaultValue,
@@ -230,8 +230,8 @@ export function getDefaultValue(
parameter.defaultValue !== "..."
? `${parameter.defaultValue}`
: defaultComment
- ? defaultComment.content.map((content) => stripCode(content.text)).join()
- : null
+ ? defaultComment.content.map((content) => stripCode(content.text)).join()
+ : null
}
export function hasDefaultValues(parameters: ReflectionParameterType[]) {
diff --git a/docs-util/packages/utils/package.json b/docs-util/packages/utils/package.json
index 087a41d26a..c41eddcad4 100644
--- a/docs-util/packages/utils/package.json
+++ b/docs-util/packages/utils/package.json
@@ -18,7 +18,7 @@
},
"devDependencies": {
"@types/node": "^16.11.10",
- "typescript": "^4.6"
+ "typescript": "5.2"
},
"dependencies": {
"rimraf": "^5.0.5"
diff --git a/docs-util/packages/workflows-diagrams-generator/package.json b/docs-util/packages/workflows-diagrams-generator/package.json
index 666fe73a83..b3e65bc7c7 100644
--- a/docs-util/packages/workflows-diagrams-generator/package.json
+++ b/docs-util/packages/workflows-diagrams-generator/package.json
@@ -21,7 +21,7 @@
"@mermaid-js/mermaid-cli": "^10.6.1",
"commander": "^11.1.0",
"ts-node": "^10.9.1",
- "typescript": "^5.1.6"
+ "typescript": "5.2"
},
"devDependencies": {
"@types/node": "^20.9.4"
diff --git a/docs-util/packages/workflows-diagrams-generator/src/commands/generate.ts b/docs-util/packages/workflows-diagrams-generator/src/commands/generate.ts
index c0d3244047..7bcdf91e5f 100644
--- a/docs-util/packages/workflows-diagrams-generator/src/commands/generate.ts
+++ b/docs-util/packages/workflows-diagrams-generator/src/commands/generate.ts
@@ -4,6 +4,7 @@ import * as path from "path"
import { existsSync, mkdirSync, rmSync, writeFileSync } from "fs"
import registerWorkflows from "../utils/register-workflows.js"
import DiagramBuilder from "../classes/diagram-builder.js"
+// @ts-expect-error mermaid typing issue
import { run as runMermaid } from "@mermaid-js/mermaid-cli"
type Options = {
diff --git a/docs-util/yarn.lock b/docs-util/yarn.lock
index 879a6bd7bd..ce60e8427b 100644
--- a/docs-util/yarn.lock
+++ b/docs-util/yarn.lock
@@ -3730,7 +3730,7 @@ __metadata:
typedoc-plugin-missing-exports: ^2.1.0
typedoc-plugin-reference-excluder: 1.1.3
typedoc-plugin-rename-defaults: ^0.6.6
- typescript: ^5.2.2
+ typescript: 5.2
languageName: unknown
linkType: soft
@@ -4232,7 +4232,7 @@ __metadata:
eslint: ^8.53.0
glob: ^10.3.10
typedoc-plugin-markdown: ^3.16.0
- typescript: ^4.6
+ typescript: 5.2
utils: "*"
yaml: ^2.3.3
peerDependencies:
@@ -4256,7 +4256,7 @@ __metadata:
"@types/node": ^16.11.10
copyfiles: ^2.4.1
handlebars: ^4.7.8
- typescript: ^4.6
+ typescript: 5.2
utils: "*"
peerDependencies:
typedoc: 0.25.x
@@ -4337,43 +4337,23 @@ __metadata:
languageName: node
linkType: hard
-"typescript@npm:^4.6":
- version: 4.9.5
- resolution: "typescript@npm:4.9.5"
+"typescript@npm:5.2":
+ version: 5.2.2
+ resolution: "typescript@npm:5.2.2"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
- checksum: 5f6cad2e728a8a063521328e612d7876e12f0d8a8390d3b3aaa452a6a65e24e9ac8ea22beb72a924fd96ea0a49ea63bb4e251fb922b12eedfb7f7a26475e5c56
+ checksum: 91ae3e6193d0ddb8656d4c418a033f0f75dec5e077ebbc2bd6d76439b93f35683936ee1bdc0e9cf94ec76863aa49f27159b5788219b50e1cd0cd6d110aa34b07
languageName: node
linkType: hard
-"typescript@npm:^5.1.6, typescript@npm:^5.2.2":
- version: 5.3.2
- resolution: "typescript@npm:5.3.2"
+"typescript@patch:typescript@5.2#~builtin":
+ version: 5.2.2
+ resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=7ad353"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
- checksum: d7dbe1fbe19039e36a65468ea64b5d338c976550394ba576b7af9c68ed40c0bc5d12ecce390e4b94b287a09a71bd3229f19c2d5680611f35b7c53a3898791159
- languageName: node
- linkType: hard
-
-"typescript@patch:typescript@^4.6#~builtin":
- version: 4.9.5
- resolution: "typescript@patch:typescript@npm%3A4.9.5#~builtin::version=4.9.5&hash=7ad353"
- bin:
- tsc: bin/tsc
- tsserver: bin/tsserver
- checksum: 897c8ac656e01b132fa82be6a8e34c4507b19be63dbf1ff1d8287d775519081a7c91dd0ca3ec62536c8137228141d65b238dfb2e8987a3f5182818f58f83e7d7
- languageName: node
- linkType: hard
-
-"typescript@patch:typescript@^5.1.6#~builtin, typescript@patch:typescript@^5.2.2#~builtin":
- version: 5.3.2
- resolution: "typescript@patch:typescript@npm%3A5.3.2#~builtin::version=5.3.2&hash=7ad353"
- bin:
- tsc: bin/tsc
- tsserver: bin/tsserver
- checksum: c81b9bd20c6dbe90fa43e876c586021447f2b47baede9fa542b1f56715835c043e23b2eaf19c42c067cc6f5ae512bd9a9be28a67b3a1d9807f8c9cfb1269875e
+ checksum: 303979762f9b8932c53f8149e866521a1265168b5c0fde8cc8ad83ac3d0e8ede8096cb02dff5f2de048e7f118a6f61902f81da12d5972c7fb582f09f2f18d169
languageName: node
linkType: hard
@@ -4499,7 +4479,7 @@ __metadata:
dependencies:
"@types/node": ^16.11.10
rimraf: ^5.0.5
- typescript: ^4.6
+ typescript: 5.2
peerDependencies:
typedoc: 0.25.x
languageName: unknown
@@ -4586,7 +4566,7 @@ __metadata:
"@types/node": ^20.9.4
commander: ^11.1.0
ts-node: ^10.9.1
- typescript: ^5.1.6
+ typescript: 5.2
bin:
workflow-diagrams-generator: dist/index.js
languageName: unknown
diff --git a/packages/medusa/src/interfaces/fulfillment-service.ts b/packages/medusa/src/interfaces/fulfillment-service.ts
index cb869f30dc..910f9565ec 100644
--- a/packages/medusa/src/interfaces/fulfillment-service.ts
+++ b/packages/medusa/src/interfaces/fulfillment-service.ts
@@ -7,33 +7,107 @@ type ShippingOptionData = Record
type ShippingMethodData = Record
/**
- * Fulfillment Provider interface
- * Fullfillment provider plugin services should extend the AbstractFulfillmentService from this file
+ * ## Overview
+ *
+ * A fulfillment provider is the shipping provider used to fulfill orders and deliver them to customers. An example of a fulfillment provider is FedEx.
+ *
+ * By default, a Medusa Backend has a `manual` fulfillment provider which has minimal implementation. It allows you to accept orders and fulfill them manually. However, you can integrate any fulfillment provider into Medusa, and your fulfillment provider can interact with third-party shipping providers.
+ *
+ * A fulfillment provider is a service that extends the `AbstractFulfillmentService` and implements its methods. So, adding a fulfillment provider is as simple as creating a service file in `src/services`.
+ * The file's name is the fulfillment provider's class name as a slug and without the word `Service`. For example, if you're creating a `MyFulfillmentService` class, the file name is `src/services/my-fulfillment.ts`.
+ *
+ * ```ts title=src/services/my-fulfillment.ts
+ * import { AbstractFulfillmentService } from "@medusajs/medusa"
+ *
+ * class MyFulfillmentService extends AbstractFulfillmentService {
+ * // methods here...
+ * }
+ * ```
+ *
+ * ---
+ *
+ * ## Identifier Property
+ *
+ * The `FulfillmentProvider` entity has 2 properties: `identifier` and `is_installed`. The `identifier` property in the class is used when the fulfillment provider is created in the database.
+ *
+ * The value of this property is also used to reference the fulfillment provider throughout Medusa. For example, it is used to [add a fulfillment provider](https://docs.medusajs.com/api/admin#regions_postregionsregionfulfillmentproviders) to a region.
+ *
+ * ```ts
+ * class MyFulfillmentService extends AbstractFulfillmentService {
+ * static identifier = "my-fulfillment"
+ *
+ * // ...
+ * }
+ * ```
+ *
+ * ---
*/
export interface FulfillmentService {
/**
+ * @ignore
+ *
* Return a unique identifier to retrieve the fulfillment plugin provider
*/
getIdentifier(): string
/**
- * Called before a shipping option is created in Admin. The method should
- * return all of the options that the fulfillment provider can be used with,
- * and it is here the distinction between different shipping options are
- * enforced. For example, a fulfillment provider may offer Standard Shipping
- * and Express Shipping as fulfillment options, it is up to the store operator
- * to create shipping options in Medusa that are offered to the customer.
+ * This method is used when retrieving the list of fulfillment options available in a region, particularly by the [List Fulfillment Options API Route](https://docs.medusajs.com/api/admin#regions_getregionsregionfulfillmentoptions).
+ * For example, if you’re integrating UPS as a fulfillment provider, you might support two fulfillment options: UPS Express Shipping and UPS Access Point. Each of these options can have different data associated with them.
+ *
+ * @returns {Promise} The list of fulfillment options. These options don't have any required format. Later on, these options can be used when creating a shipping option,
+ * such as when using the [Create Shipping Option API Route](https://docs.medusajs.com/api/admin#shipping-options_postshippingoptions). The chosen fulfillment option, which is one of the
+ * items in the array returned by this method, will be set in the `data` object of the shipping option.
+ *
+ * @example
+ * class MyFulfillmentService extends AbstractFulfillmentService {
+ * // ...
+ * async getFulfillmentOptions(): Promise {
+ * return [
+ * {
+ * id: "my-fulfillment",
+ * },
+ * {
+ * id: "my-fulfillment-dynamic",
+ * },
+ * ]
+ * }
+ * }
*/
getFulfillmentOptions(): Promise
/**
- * Called before a shipping method is set on a cart to ensure that the data
- * sent with the shipping method is valid. The data object may contain extra
- * data about the shipment such as an id of a drop point. It is up to the
- * fulfillment provider to enforce that the correct data is being sent
- * through.
- * @return the data to populate `cart.shipping_methods.$.data` this
- * is usually important for future actions like generating shipping labels
+ * This method is called when a shipping method is created. This typically happens when the customer chooses a shipping option during checkout, when a shipping method is created
+ * for an order return, or in other similar cases. The shipping option and its data are validated before the shipping method is created.
+ *
+ * You can use the provided parameters to validate the chosen shipping option. For example, you can check if the `data` object passed as a second parameter includes all data needed to
+ * fulfill the shipment later on.
+ *
+ * If any of the data is invalid, you can throw an error. This error will stop Medusa from creating a shipping method and the error message will be returned as a result of the API Route.
+ *
+ * @param {ShippingOptionData} optionData - The data object of the shipping option selected when creating the shipping method.
+ * @param {FulfillmentProviderData} data - The `data` object passed in the body of the request.
+ * @param {Cart} cart - The customer's cart details. It may be empty if the shipping method isn't associated with a cart, such as when it's associated with a claim.
+ * @returns {Promise>} The data that will be stored in the `data` property of the shipping method to be created.
+ * Make sure the value you return contains everything you need to fulfill the shipment later on. The returned value may also be used to calculate the price of the shipping method
+ * if it doesn't have a set price. It will be passed along to the {@link calculatePrice} method.
+ *
+ * @example
+ * class MyFulfillmentService extends AbstractFulfillmentService {
+ * // ...
+ * async validateFulfillmentData(
+ * optionData: Record,
+ * data: Record,
+ * cart: Cart
+ * ): Promise> {
+ * if (data.id !== "my-fulfillment") {
+ * throw new Error("invalid data")
+ * }
+ *
+ * return {
+ * ...data,
+ * }
+ * }
+ * }
*/
validateFulfillmentData(
optionData: ShippingOptionData,
@@ -42,18 +116,95 @@ export interface FulfillmentService {
): Promise>
/**
- * Called before a shipping option is created in Admin. Use this to ensure
- * that a fulfillment option does in fact exist.
+ * Once the admin creates the shipping option, the data of the shipping option will be validated first using this method. This method is called when the [Create Shipping Option API Route](https://docs.medusajs.com/api/admin#shipping-options_postshippingoptions) is used.
+ *
+ * @param {ShippingOptionData} data - the data object that is sent in the body of the request, basically, the data object of the shipping option. You can use this data to validate the shipping option before it is saved.
+ * @returns {Promise} Whether the fulfillment option is valid. If the returned value is false, an error is thrown and the shipping option will not be saved.
+ *
+ * @example
+ * For example, you can use this method to ensure that the `id` in the `data` object is correct:
+ *
+ * ```ts
+ * class MyFulfillmentService extends AbstractFulfillmentService {
+ * // ...
+ * async validateOption(
+ * data: Record
+ * ): Promise {
+ * return data.id == "my-fulfillment"
+ * }
+ * }
+ * ```
*/
validateOption(data: ShippingOptionData): Promise
/**
- * Used to determine if a shipping option can have a calculated price
+ * This method is used to determine whether a shipping option is calculated dynamically or flat rate. It is called if the `price_type` of the shipping option being created is set to calculated.
+ *
+ * @param {ShippingOptionData} data - The `data` object of the shipping option being created. You can use this data to determine whether the shipping option should be calculated or not.
+ * This is useful if the fulfillment provider you are integrating has both flat rate and dynamically priced fulfillment options.
+ * @returns {Promise} If this method returns `true`, that means that the price can be calculated dynamically and the shipping option can have the `price_type` set to calculated.
+ * The amount property of the shipping option will then be set to null. The amount will be created later when the shipping method is created on checkout using the {@link calculatePrice} method.
+ * If the method returns `false`, an error is thrown as it means the selected shipping option is invalid and it can only have the `flat_rate` price type.
+ *
+ * @example
+ * class MyFulfillmentService extends AbstractFulfillmentService {
+ * // ...
+ * async canCalculate(
+ * data: Record
+ * ): Promise {
+ * return data.id === "my-fulfillment-dynamic"
+ * }
+ * }
*/
canCalculate(data: ShippingOptionData): Promise
/**
- * Used to calculate a price for a given shipping option.
+ * This method is used in different places, including:
+ *
+ * 1. When the shipping options for a cart are retrieved during checkout. If a shipping option has their `price_type` set to calculated, this method is used to set the amount of the returned shipping option.
+ * 2. When a shipping method is created. If the shipping option associated with the method has their `price_type` set to `calculated`, this method is used to set the `price` attribute of the shipping method in the database.
+ * 3. When the cart's totals are calculated.
+ *
+ * @param {ShippingOptionData} optionData - The `data` object of the selected shipping option.
+ * @param {FulfillmentProviderData} data -
+ * A `data` object that is different based on the context it's used in:
+ *
+ * 1. If the price is being calculated for the list of shipping options available for a cart, it's the `data` object of the shipping option.
+ * 2. If the price is being calculated when the shipping method is being created, it's the data returned by the {@link validateFulfillmentData} method used during the shipping method creation.
+ * 3. If the price is being calculated while calculating the cart's totals, it will be the data object of the cart's shipping method.
+ * @param {Cart} cart - Either the Cart or the Order object.
+ * @returns {Promise} Used to set the price of the shipping method or option, based on the context the method is used in.
+ *
+ * @example
+ * An example of calculating the price based on some custom logic:
+ *
+ * ```ts
+ * class MyFulfillmentService extends AbstractFulfillmentService {
+ * // ...
+ * async calculatePrice(
+ * optionData: Record,
+ * data: Record,
+ * cart: Cart
+ * ): Promise {
+ * return cart.items.length * 1000
+ * }
+ * }
+ * ```
+ *
+ * If your fulfillment provider does not provide any dynamically calculated rates you can return any static value or throw an error. For example:
+ *
+ * ```ts
+ * class MyFulfillmentService extends AbstractFulfillmentService {
+ * // ...
+ * async calculatePrice(
+ * optionData: Record,
+ * data: Record,
+ * cart: Cart
+ * ): Promise {
+ * throw new Error("Method not implemented.")
+ * }
+ * }
+ * ```
*/
calculatePrice(
optionData: ShippingOptionData,
@@ -62,8 +213,38 @@ export interface FulfillmentService {
): Promise
/**
- * Create a fulfillment using data from shipping method, line items, and fulfillment. All from the order.
- * The returned value of this method will populate the `fulfillment.data` field.
+ * This method is used when a fulfillment is created for an order, a claim, or a swap.
+ *
+ * @param {ShippingMethodData} data -
+ * The `data` object of the shipping method associated with the resource, such as the order.
+ * You can use it to access the data specific to the shipping option. This is based on your implementation of previous methods.
+ * @param {LineItem[]} items - The line items in the order to be fulfilled. The admin can choose all or some of the items to fulfill.
+ * @param {Order} order -
+ * The details of the created resource, which is either an order, a claim, or a swap:
+ * - If the resource the fulfillment is being created for is a claim, the `is_claim` property in the object will be `true`.
+ * - If the resource the fulfillment is being created for is a swap, the `is_swap` property in the object will be `true`.
+ * - Otherwise, the resource is an order.
+ * @param {Fulfillment} fulfillment - The fulfillment being created.
+ * @returns {Promise} The data that will be stored in the `data` attribute of the created fulfillment.
+ *
+ * @example
+ * Here is a basic implementation of `createFulfillment` for a fulfillment provider that does not interact with any third-party provider to create the fulfillment:
+ *
+ * ```ts
+ * class MyFulfillmentService extends AbstractFulfillmentService {
+ * // ...
+ * async createFulfillment(
+ * data: Record,
+ * items: LineItem,
+ * order: Order,
+ * fulfillment: Fulfillment
+ * ) {
+ * // No data is being sent anywhere
+ * // No data to be stored in the fulfillment's data object
+ * return {}
+ * }
+ * }
+ * ```
*/
createFulfillment(
data: ShippingMethodData,
@@ -73,32 +254,133 @@ export interface FulfillmentService {
): Promise
/**
- * Cancel a fulfillment using data from the fulfillment
+ * This method is called when a fulfillment is cancelled by the admin. This fulfillment can be for an order, a claim, or a swap.
+ *
+ * @param {FulfillmentProviderData} fulfillmentData - The `data` attribute of the fulfillment being canceled
+ * @returns {Promise} The method isn't expected to return any specific data.
+ *
+ * @example
+ * This is the basic implementation of the method for a fulfillment provider that doesn't interact with a third-party provider to cancel the fulfillment:
+ *
+ * ```ts
+ * class MyFulfillmentService extends FulfillmentService {
+ * // ...
+ * async cancelFulfillment(
+ * fulfillment: Record
+ * ): Promise {
+ * return {}
+ * }
+ * }
+ * ```
*/
cancelFulfillment(fulfillmentData: FulfillmentProviderData): Promise
/**
- * Used to create a return order. Should return the data necessary for future
- * operations on the return; in particular the data may be used to receive
- * documents attached to the return.
+ * Fulfillment providers can also be used to return products. A shipping option can be used for returns if the `is_return` property is true or if an admin creates a Return Shipping Option from the settings.
+ * This method is used when the admin [creates a return request](https://docs.medusajs.com/api/admin#orders_postordersorderreturns) for an order,
+ * [creates a swap](https://docs.medusajs.com/api/admin#orders_postordersorderswaps) for an order, or when the
+ * [customer creates a return of their order](https://docs.medusajs.com/api/store#returns_postreturns). The fulfillment is created automatically for the order return.
+ *
+ * @param {CreateReturnType} returnOrder - the return that the fulfillment is being created for.
+ * @returns {Promise>} Used to set the value of the `shipping_data` attribute of the return being created.
+ *
+ * @example
+ * This is the basic implementation of the method for a fulfillment provider that does not contact with a third-party provider to fulfill the return:
+ *
+ * ```ts
+ * class MyFulfillmentService extends AbstractFulfillmentService {
+ * // ...
+ * async createReturn(
+ * returnOrder: CreateReturnType
+ * ): Promise> {
+ * return {}
+ * }
+ * }
+ * ```
*/
createReturn(returnOrder: CreateReturnType): Promise>
/**
- * Used to retrieve documents associated with a fulfillment.
+ * This method is used to retrieve any documents associated with a fulfillment. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
+ *
+ * @param {FulfillmentProviderData} data - The `data` attribute of the fulfillment that you're retrieving the documents for.
+ * @returns {Promise} There are no restrictions on the returned response. If your fulfillment provider doesn't provide this functionality, you can leave the method empty or through an error.
+ *
+ * @example
+ * class MyFulfillmentService extends FulfillmentService {
+ * // ...
+ * async getFulfillmentDocuments(
+ * data: Record
+ * ): Promise {
+ * // assuming you contact a client to
+ * // retrieve the document
+ * return this.client.getFulfillmentDocuments()
+ * }
+ * }
*/
getFulfillmentDocuments(data: FulfillmentProviderData): Promise
/**
- * Used to retrieve documents related to a return order.
+ * This method is used to retrieve any documents associated with a return. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
+ *
+ * @param {Record} data - The data attribute of the return that you're retrieving the documents for.
+ * @returns {Promise} There are no restrictions on the returned response. If your fulfillment provider doesn't provide this functionality, you can leave the method empty or through an error.
+ *
+ * @example
+ * class MyFulfillmentService extends FulfillmentService {
+ * // ...
+ * async getReturnDocuments(
+ * data: Record
+ * ): Promise {
+ * // assuming you contact a client to
+ * // retrieve the document
+ * return this.client.getReturnDocuments()
+ * }
+ * }
*/
getReturnDocuments(data: Record): Promise
/**
- * Used to retrieve documents related to a shipment.
+ * This method is used to retrieve any documents associated with a shipment. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
+ *
+ * @param {Record} data - The `data` attribute of the shipment that you're retrieving the documents for.
+ * @returns {Promise} There are no restrictions on the returned response. If your fulfillment provider doesn't provide this functionality, you can leave the method empty or through an error.
+ *
+ * @example
+ * class MyFulfillmentService extends FulfillmentService {
+ * // ...
+ * async getShipmentDocuments(
+ * data: Record
+ * ): Promise {
+ * // assuming you contact a client to
+ * // retrieve the document
+ * return this.client.getShipmentDocuments()
+ * }
+ * }
*/
getShipmentDocuments(data: Record): Promise
+ /**
+ * This method is used to retrieve any documents associated with an order and its fulfillments. This method isn't used by default in the backend, but you can use it for
+ * custom use cases such as allowing admins to download these documents.
+ *
+ * @param {FulfillmentProviderData} fulfillmentData - The `data` attribute of the order's fulfillment.
+ * @param documentType - The type of document to retrieve.
+ * @returns {Promise} There are no restrictions on the returned response. If your fulfillment provider doesn't provide this functionality, you can leave the method empty or through an error.
+ *
+ * @example
+ * class MyFulfillmentService extends FulfillmentService {
+ * // ...
+ * async retrieveDocuments(
+ * fulfillmentData: Record,
+ * documentType: "invoice" | "label"
+ * ): Promise {
+ * // assuming you contact a client to
+ * // retrieve the document
+ * return this.client.getDocuments()
+ * }
+ * }
+ */
retrieveDocuments(
fulfillmentData: FulfillmentProviderData,
documentType: "invoice" | "label"
@@ -106,13 +388,42 @@ export interface FulfillmentService {
}
export abstract class AbstractFulfillmentService implements FulfillmentService {
+ /**
+ * You can use the `constructor` of your fulfillment provider to access the different services in Medusa through dependency injection.
+ * You can also use the constructor to initialize your integration with the third-party provider. For example, if you use a client to connect to the third-party provider’s APIs, you can initialize it in the constructor and use it in other methods in the service.
+ * Additionally, if you’re creating your fulfillment provider as an external plugin to be installed on any Medusa backend and you want to access the options added for the plugin, you can access it in the constructor.
+ *
+ * @param {MedusaContainer} container - An instance of `MedusaContainer` that allows you to access other resources, such as services, in your Medusa backend.
+ * @param {Record} config - If this fulfillment provider is created in a plugin, the plugin's options are passed in this parameter.
+ *
+ * @example
+ * class MyFulfillmentService extends AbstractFulfillmentService {
+ * static identifier = "my-fulfillment"
+ *
+ * // ...
+ * }
+ */
protected constructor(
protected readonly container: MedusaContainer,
protected readonly config?: Record // eslint-disable-next-line @typescript-eslint/no-empty-function
) {}
+ /**
+ * The `FulfillmentProvider` entity has 2 properties: `identifier` and `is_installed`. The `identifier` property in the class is used when the fulfillment provider is created in the database.
+ * The value of this property is also used to reference the fulfillment provider throughout Medusa. For example, it is used to [add a fulfillment provider](https://docs.medusajs.com/api/admin#regions_postregionsregionfulfillmentproviders) to a region.
+ *
+ * @example
+ * class MyFulfillmentService extends AbstractFulfillmentService {
+ * static identifier = "my-fulfillment"
+ *
+ * // ...
+ * }
+ */
public static identifier: string
+ /**
+ * @ignore
+ */
public getIdentifier(): string {
const ctr = this.constructor as typeof AbstractFulfillmentService
diff --git a/packages/types/src/pricing/common/price-list.ts b/packages/types/src/pricing/common/price-list.ts
index 42e2a6fd4c..a256ca379b 100644
--- a/packages/types/src/pricing/common/price-list.ts
+++ b/packages/types/src/pricing/common/price-list.ts
@@ -202,7 +202,7 @@ export interface UpdatePriceListDTO {
}
/**
- * @inteface
+ * @interface
*
* Filters to apply on price lists.
*/
diff --git a/www/apps/docs/content/modules/carts-and-checkout/backend/add-fulfillment-provider.md b/www/apps/docs/content/modules/carts-and-checkout/backend/add-fulfillment-provider.md
deleted file mode 100644
index 0d9d15f122..0000000000
--- a/www/apps/docs/content/modules/carts-and-checkout/backend/add-fulfillment-provider.md
+++ /dev/null
@@ -1,507 +0,0 @@
----
-description: 'Learn how to create a fulfillment provider in the Medusa backend. This guide explains the different methods in the fulfillment provider.'
-addHowToData: true
----
-
-# How to Add a Fulfillment Provider
-
-In this document, you’ll learn how to add a fulfillment provider to a Medusa backend. If you’re unfamiliar with the Shipping architecture in Medusa, make sure to [check out the overview first](../shipping.md).
-
-## Overview
-
-A fulfillment provider is the shipping provider used to fulfill orders and deliver them to customers. An example of a fulfillment provider is FedEx.
-
-By default, a Medusa Backend has a `manual` fulfillment provider which has minimal implementation. It allows you to accept orders and fulfill them manually. However, you can integrate any fulfillment provider into Medusa, and your fulfillment provider can interact with third-party shipping providers.
-
-Adding a fulfillment provider is as simple as creating one [service](../../../development/services/create-service.mdx) file in `src/services`. A fulfillment provider is essentially a service that extends the `AbstractFulfillmentService`. It requires implementing 4 methods:
-
-1. `getFulfillmentOptions`: used to retrieve available fulfillment options provided by this fulfillment provider.
-2. `validateOption`: used to validate the shipping option when it’s being created by the admin.
-3. `validateFulfillmentData`: used to validate a shipping method's data before it's created, typically during checkout.
-4. `createFulfillment`: used to perform any additional actions when fulfillment is being created for an order, such as communicating with a third-party service.
-
-There are other [useful methods](#useful-methods) that can be implemented based on your fulfillment provider's use case.
-
-Also, the fulfillment provider class should have a static property `identifier`. It is the name that will be used to install and refer to the fulfillment provider throughout Medusa.
-
-Fulfillment providers are loaded and installed on the backend startup.
-
----
-
-## Create a Fulfillment Provider
-
-The first step is to create a JavaScript or TypeScript file under `src/services`. For example, create the file `src/services/my-fulfillment.ts` with the following content:
-
-```ts title="src/services/my-fulfillment.ts"
-import {
- AbstractFulfillmentService,
- Cart,
- Fulfillment,
- LineItem,
- Order,
-} from "@medusajs/medusa"
-import {
- CreateReturnType,
-} from "@medusajs/medusa/dist/types/fulfillment-provider"
-
-class MyFulfillmentService extends AbstractFulfillmentService {
- async getFulfillmentOptions(): Promise {
- throw new Error("Method not implemented.")
- }
- async validateFulfillmentData(
- optionData: { [x: string]: unknown },
- data: { [x: string]: unknown },
- cart: Cart
- ): Promise> {
- throw new Error("Method not implemented.")
- }
- async validateOption(
- data: { [x: string]: unknown }
- ): Promise {
- throw new Error("Method not implemented.")
- }
- async canCalculate(
- data: { [x: string]: unknown }
- ): Promise {
- throw new Error("Method not implemented.")
- }
- async calculatePrice(
- optionData: { [x: string]: unknown },
- data: { [x: string]: unknown },
- cart: Cart
- ): Promise {
- throw new Error("Method not implemented.")
- }
- async createFulfillment(
- data: { [x: string]: unknown },
- items: LineItem,
- order: Order,
- fulfillment: Fulfillment
- ) {
- throw new Error("Method not implemented.")
- }
- async cancelFulfillment(
- fulfillment: { [x: string]: unknown }
- ): Promise {
- throw new Error("Method not implemented.")
- }
- async createReturn(
- returnOrder: CreateReturnType
- ): Promise> {
- throw new Error("Method not implemented.")
- }
- async getFulfillmentDocuments(
- data: { [x: string]: unknown }
- ): Promise {
- throw new Error("Method not implemented.")
- }
- async getReturnDocuments(
- data: Record
- ): Promise {
- throw new Error("Method not implemented.")
- }
- async getShipmentDocuments(
- data: Record
- ): Promise {
- throw new Error("Method not implemented.")
- }
- async retrieveDocuments(
- fulfillmentData: Record,
- documentType: "invoice" | "label"
- ): Promise {
- throw new Error("Method not implemented.")
- }
-}
-
-export default MyFulfillmentService
-```
-
-Fulfillment provider services must extend the `AbstractFulfillmentService` class imported from `@medusajs/medusa`.
-
-:::note
-
-Following the naming convention of Services, the name of the file should be the slug name of the fulfillment provider, and the name of the class should be the camel case name of the fulfillment provider suffixed with “Service”. You can learn more in the [service documentation](../../../development/services/create-service.mdx).
-
-:::
-
-### Identifier
-
-As mentioned in the overview, fulfillment providers should have a static `identifier` property.
-
-The `FulfillmentProvider` entity has 2 properties: `identifier` and `is_installed`. The `identifier` property in the class will be used when the fulfillment provider is created in the database.
-
-The value of this property will also be used to reference the fulfillment provider throughout Medusa. For example, it is used to [add a fulfillment provider](https://docs.medusajs.com/api/admin#regions_postregionsregionfulfillmentproviders) to a region.
-
-```ts
-class MyFulfillmentService extends AbstractFulfillmentService {
- static identifier = "my-fulfillment"
-
- // ...
-}
-```
-
-### constructor
-
-You can use the `constructor` of your fulfillment provider to have access to different services in Medusa through dependency injection. You can access any services you create in Medusa in the first parameter.
-
-You can also use the constructor to initialize your integration with the third-party provider. For example, if you use a client to connect to the third-party provider’s APIs, you can initialize it in the constructor and use it in other methods in the service.
-
-Additionally, if you’re creating your fulfillment provider as an external plugin to be installed on any Medusa backend and you want to access the options added for the plugin, you can access it in the constructor. The options are passed as a second parameter.
-
-For example:
-
-```ts
-class MyFulfillmentService extends AbstractFulfillmentService {
- // ...
- constructor(container, options) {
- super()
- // you can access options here
- }
-}
-```
-
-### getFulfillmentOptions
-
-This method is used when retrieving the list of fulfillment options available in a region, particularly by the [List Fulfillment Options API Route](https://docs.medusajs.com/api/admin#regions_getregionsregionfulfillmentoptions).
-
-For example, if you’re integrating UPS as a fulfillment provider, you might support two fulfillment options: UPS Express Shipping and UPS Access Point. Each of these options can have different data associated with them.
-
-This method is expected to return an array of options. These options don't have any required format.
-
-Later on, these options can be used when creating a shipping option, such as when using the [Create Shipping Option API Route](https://docs.medusajs.com/api/admin#shipping-options_postshippingoptions). The chosen fulfillment option, which is one of the items in the array returned by this method, will be set in the `data` object of the shipping option.
-
-For example:
-
-```ts
-class MyFulfillmentService extends AbstractFulfillmentService {
- // ...
- async getFulfillmentOptions(): Promise {
- return [
- {
- id: "my-fulfillment",
- },
- {
- id: "my-fulfillment-dynamic",
- },
- ]
- }
-}
-```
-
-### validateOption
-
-Once the admin creates the shipping option, the data of the shipping option will be validated first using this method. This method is called when the [Create Shipping Option API Route](https://docs.medusajs.com/api/admin#shipping-options_postshippingoptions) is used.
-
-This method accepts the `data` object that is sent in the body of the request, basically, the `data` object of the shipping option. You can use this data to validate the shipping option before it is saved.
-
-This method returns a boolean. If the returned value is `false`, an error is thrown and the shipping option will not be saved.
-
-For example, you can use this method to ensure that the `id` in the `data` object is correct:
-
-```ts
-class MyFulfillmentService extends AbstractFulfillmentService {
- // ...
- async validateOption(
- data: { [x: string]: unknown }
- ): Promise {
- return data.id == "my-fulfillment"
- }
-}
-```
-
-If your fulfillment provider doesn't need to run any validation, you can simply return `true`.
-
-### validateFulfillmentData
-
-This method is called when a shipping method is created. This typically happens when the customer chooses a shipping option during checkout, when a shipping method is created for an order return, or in other similar cases. The shipping option and its data are validated before the shipping method is created.
-
-This method accepts three parameters:
-
-1. The first parameter is the `data` object of the shipping option selected when creating the shipping method.
-2. The second parameter is `data` object passed in the body of the request.
-3. The third parameter is an object indicating the customer’s cart data. It may be empty if the shipping method isn't associated with a cart, such as when it's associated with a claim.
-
-You can use these parameters to validate the chosen shipping option. For example, you can check if the `data` object passed as a second parameter includes all data needed to fulfill the shipment later on.
-
-If any of the data is invalid, you can throw an error. This error will stop Medusa from creating a shipping method and the error message will be returned as a result of the API Route.
-
-If everything is valid, this method must return an object that will be stored in the `data` property of the shipping method to be created. So, make sure the value you return contains everything you need to fulfill the shipment later on.
-
-The returned value may also be used to calculate the price of the shipping method if it doesn't have a set price. It will be passed along to the [calculatePrice](#calculateprice) method.
-
-Here's an example implementation:
-
-```ts
-class MyFulfillmentService extends AbstractFulfillmentService {
- // ...
- async validateFulfillmentData(
- optionData: { [x: string]: unknown },
- data: { [x: string]: unknown },
- cart: Cart
- ): Promise> {
- if (data.id !== "my-fulfillment") {
- throw new Error("invalid data")
- }
-
- return {
- ...data,
- }
- }
-}
-```
-
-### createFulfillment
-
-This method is used when a fulfillment is created for an order, a claim, or a swap.
-
-It accepts four parameters:
-
-1. The first parameter is the `data` object of the shipping method associated with the resource, such as the order.
-2. The second parameter is the array of line item objects in the order to be fulfilled. The admin can choose all or some of the items to fulfill.
-3. The third parameter is an object that includes data related to the order, claim, or swap this fulfillment is being created for.
- 1. If the resource the fulfillment is being created for is a claim, the `is_claim` property in the object will be `true`.
- 2. If the resource the fulfillment is being created for is a swap, the `is_swap` property in the object will be `true`.
- 3. Otherwise, the resource is an order.
-4. The fourth parameter is an object of type [Fulfillment](../../../references/entities/classes/Fulfillment.mdx), which is the fulfillment being created.
-
-You can use the `data` property in the shipping method (first parameter) to access the data specific to the shipping option. This is based on your implementation of previous methods.
-
-This method must return an object of data that will be stored in the `data` attribute of the created fulfillment.
-
-Here is a basic implementation of `createFulfillment` for a fulfillment provider that does not interact with any third-party provider to create the fulfillment:
-
-```ts
-class MyFulfillmentService extends AbstractFulfillmentService {
- // ...
- async createFulfillment(
- data: { [x: string]: unknown },
- items: LineItem,
- order: Order,
- fulfillment: Fulfillment
- ) {
- // No data is being sent anywhere
- // No data to be stored in the fulfillment's data object
- return {}
- }
-}
-```
-
-### Useful Methods
-
-The above-detailed methods are the required methods for every fulfillment provider. However, there are additional methods that you can use in your fulfillment provider to customize it further or add additional features.
-
-#### canCalculate
-
-This method is used to determine whether a shipping option is calculated dynamically or flat rate. It is called if the `price_type` of the shipping option being created is set to `calculated`.
-
-This method accepts an object as a parameter, which is the `data` object of the shipping option being created. You can use this data to determine whether the shipping option should be calculated or not. This is useful if the fulfillment provider you are integrating has both flat rate and dynamically priced fulfillment options.
-
-If this method returns `true`, that means that the price can be calculated dynamically and the shipping option can have the `price_type` set to `calculated`. The `amount` property of the shipping option will then be set to `null`. The amount will be created later when the shipping method is created on checkout using the [calculatePrice method](#calculateprice).
-
-If the method returns `false`, an error is thrown as it means the selected shipping option is invalid and it can only have the `flat_rate` price type.
-
-For example:
-
-```ts
-class MyFulfillmentService extends AbstractFulfillmentService {
- // ...
- async canCalculate(
- data: { [x: string]: unknown }
- ): Promise {
- return data.id === "my-fulfillment-dynamic"
- }
-}
-```
-
-#### calculatePrice
-
-This method is used in different places, including:
-
-1. When the shipping options for a cart are retrieved during checkout. If a shipping option has their `price_type` set to `calculated`, this method is used to set the `amount` of the returned shipping option.
-2. When a shipping method is created. If the shipping option associated with the method has their `price_type` set to `calculated`, this method is used to set the `price` attribute of the shipping method in the database.
-3. When the cart's totals are calculated.
-
-This method receives three parameters:
-
-1. The first parameter is the `data` object of the selected shipping option.
-2. The second parameter is a `data` object that is different based on the context it's used in:
- 1. If the price is being calculated for the list of shipping options available for a cart, it's the `data` object of the shipping option.
- 2. If the price is being calculated when the shipping method is being created, it's the data returned by the [validateFulfillmentData](#validatefulfillmentdata) method used during the shipping method creation.
- 3. If the price is being calculated while calculating the cart's totals, it will be the `data` object of the cart's shipping method.
-3. The third parameter is either the [Cart](../../../references/entities/classes/Cart.mdx) or the [Order](../../../references/entities/classes/Order.mdx) object.
-
-The method is expected to return a number that will be used to set the price of the shipping method or option, based on the context it's used in.
-
-If your fulfillment provider does not provide any dynamically calculated rates you can return any static value or throw an error. For example:
-
-```ts
-class MyFulfillmentService extends AbstractFulfillmentService {
- // ...
- async calculatePrice(
- optionData: { [x: string]: unknown },
- data: { [x: string]: unknown },
- cart: Cart
- ): Promise {
- throw new Error("Method not implemented.")
- }
-}
-```
-
-Otherwise, you can use it to calculate the price with custom logic. For example:
-
-```ts
-class MyFulfillmentService extends AbstractFulfillmentService {
- // ...
- async calculatePrice(
- optionData: { [x: string]: unknown },
- data: { [x: string]: unknown },
- cart: Cart
- ): Promise {
- return cart.items.length * 1000
- }
-}
-```
-
-#### createReturn
-
-Fulfillment providers can also be used to return products. A shipping option can be used for returns if the `is_return` property is `true` or if an admin creates a Return Shipping Option from the settings.
-
-This method is used when the admin [creates a return request](https://docs.medusajs.com/api/admin#orders_postordersorderreturns) for an order, [creates a swap](https://docs.medusajs.com/api/admin#orders_postordersorderswaps) for an order, or when the customer [creates a return of their order](https://docs.medusajs.com/api/store#returns_postreturns). The fulfillment is created automatically for the order return.
-
-The method receives as a parameter the [Return](../../../references/entities/classes/Return.mdx) object, which is the return that the fulfillment is being created for.
-
-The method must return an object that will be used to set the value of the `shipping_data` attribute of the return being created.
-
-This is the basic implementation of the method for a fulfillment provider that does not contact with a third-party provider to fulfill the return:
-
-```ts
-class MyFulfillmentService extends AbstractFulfillmentService {
- // ...
- async createReturn(
- returnOrder: CreateReturnType
- ): Promise> {
- return {}
- }
-}
-```
-
-#### cancelFulfillment
-
-This method is called when a fulfillment is cancelled by the admin. This fulfillment can be for an order, a claim, or a swap.
-
-The method receives the `data` attribute of the fulfillment being canceled. The method isn't expected to return any specific data.
-
-This is the basic implementation of the method for a fulfillment provider that doesn't interact with a third-party provider to cancel the fulfillment:
-
-```ts
-class MyFulfillmentService extends FulfillmentService {
- // ...
- async cancelFulfillment(
- fulfillment: { [x: string]: unknown }
- ): Promise {
- return {}
- }
-}
-```
-
-#### retrieveDocuments
-
-This method is used to retrieve any documents associated with an order and its fulfillments. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
-
-The method accepts two parameters:
-
-1. The first parameter is the `data` attribute of the order's fulfillment.
-2. The second parameter is a string indicating the type of document to retrieve. Possible values are `invoice` and `label`.
-
-There are no restrictions on the returned response. If your fulfillment provider doesn't provide this functionality, you can leave the method empty or through an error.
-
-For example:
-
-```ts
-class MyFulfillmentService extends FulfillmentService {
- // ...
- async retrieveDocuments(
- fulfillmentData: Record,
- documentType: "invoice" | "label"
- ): Promise {
- // assuming you contact a client to
- // retrieve the document
- return this.client.getDocuments()
- }
-}
-```
-
-#### getFulfillmentDocuments
-
-This method is used to retrieve any documents associated with a fulfillment. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
-
-The method accepts the `data` attribute of the fulfillment that you're retrieving the documents for.
-
-There are no restrictions on the returned response. If your fulfillment provider doesn't provide this functionality, you can leave the method empty or through an error.
-
-For example:
-
-```ts
-class MyFulfillmentService extends FulfillmentService {
- // ...
- async getFulfillmentDocuments(
- data: { [x: string]: unknown }
- ): Promise {
- // assuming you contact a client to
- // retrieve the document
- return this.client.getFulfillmentDocuments()
- }
-}
-```
-
-#### getReturnDocuments
-
-This method is used to retrieve any documents associated with a return. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
-
-The method accepts the `data` attribute of the return that you're retrieving the documents for.
-
-There are no restrictions on the returned response. If your fulfillment provider doesn't provide this functionality, you can leave the method empty or through an error.
-
-For example:
-
-```ts
-class MyFulfillmentService extends FulfillmentService {
- // ...
- async getReturnDocuments(
- data: Record
- ): Promise {
- // assuming you contact a client to
- // retrieve the document
- return this.client.getReturnDocuments()
- }
-}
-```
-
-#### getShipmentDocuments
-
-This method is used to retrieve any documents associated with a shipment. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
-
-The method accepts the `data` attribute of the shipment that you're retrieving the documents for.
-
-There are no restrictions on the returned response. If your fulfillment provider doesn't provide this functionality, you can leave the method empty or through an error.
-
-For example:
-
-```ts
-class MyFulfillmentService extends FulfillmentService {
- // ...
- async getShipmentDocuments(
- data: Record
- ): Promise {
- // assuming you contact a client to
- // retrieve the document
- return this.client.getShipmentDocuments()
- }
-}
-```
-
----
-
-## See Also
-
-- Example Implementations: [Webshipper plugin](https://github.com/medusajs/medusa/tree/master/packages/medusa-fulfillment-webshipper) and the [manual fulfillment plugin](https://github.com/medusajs/medusa/tree/master/packages/medusa-fulfillment-manual)
diff --git a/www/apps/docs/content/modules/carts-and-checkout/shipping.md b/www/apps/docs/content/modules/carts-and-checkout/shipping.md
index f319c7dec0..f71e8b8547 100644
--- a/www/apps/docs/content/modules/carts-and-checkout/shipping.md
+++ b/www/apps/docs/content/modules/carts-and-checkout/shipping.md
@@ -153,5 +153,5 @@ The `ShippingMethod` instance holds a `price` attribute, which will either b
## See Also
-- [Create a Fulfillment Provider](./backend/add-fulfillment-provider.md)
+- [Create a Fulfillment Provider](../../references/fulfillment/classes/AbstractFulfillmentService.mdx)
- [Available shipping plugins](https://github.com/medusajs/medusa/tree/master/packages)
diff --git a/www/apps/docs/content/modules/orders/fulfillments.md b/www/apps/docs/content/modules/orders/fulfillments.md
index bc9410d34e..7fde94d09d 100644
--- a/www/apps/docs/content/modules/orders/fulfillments.md
+++ b/www/apps/docs/content/modules/orders/fulfillments.md
@@ -10,7 +10,7 @@ In this document, you’ll learn about Fulfillments, how they’re used in your
Fulfillments are used to ship items, typically to a customer. Fulfillments can be used in orders, returns, swaps, and more.
-Fulfillments are processed within Medusa by a [fulfillment provider](../carts-and-checkout/backend/add-fulfillment-provider.md). The fulfillment provider handles creating, validating, and processing the fulfillment, among other functionalities. Typically, a fulfillment provider would be integrated with a third-party service that handles the actual shipping of the items.
+Fulfillments are processed within Medusa by a [fulfillment provider](../../references/fulfillment/classes/AbstractFulfillmentService.mdx). The fulfillment provider handles creating, validating, and processing the fulfillment, among other functionalities. Typically, a fulfillment provider would be integrated with a third-party service that handles the actual shipping of the items.
When a fulfillment is created for one or more item, shipments can then be created for that fulfillment. These shipments can then be tracked using tracking numbers, providing customers and merchants accurate details about a shipment.
diff --git a/www/apps/docs/content/plugins/fulfillment/index.mdx b/www/apps/docs/content/plugins/fulfillment/index.mdx
index 7380f0dc59..12f696a289 100644
--- a/www/apps/docs/content/plugins/fulfillment/index.mdx
+++ b/www/apps/docs/content/plugins/fulfillment/index.mdx
@@ -2,6 +2,6 @@ import DocCardList from '@theme/DocCardList';
# Fulfillment Plugins
-If you can't find your fulfillment provider, try checking the [Community Plugins Library](https://medusajs.com/plugins/?filters=Shipping&categories=Shipping). You can also [create your own fulfillment provider](../../modules/carts-and-checkout/backend/add-fulfillment-provider.md).
+If you can't find your fulfillment provider, try checking the [Community Plugins Library](https://medusajs.com/plugins/?filters=Shipping&categories=Shipping). You can also [create your own fulfillment provider](../../references/fulfillment/classes/AbstractFulfillmentService.mdx).
\ No newline at end of file
diff --git a/www/apps/docs/content/references/entities/enums/AllocationType.mdx b/www/apps/docs/content/references/entities/enums/AllocationType.mdx
index b05b0b0504..cb71377b53 100644
--- a/www/apps/docs/content/references/entities/enums/AllocationType.mdx
+++ b/www/apps/docs/content/references/entities/enums/AllocationType.mdx
@@ -10,7 +10,7 @@ The scope that the discount should apply to.
## Enumeration Members
-#### ITEM
+### ITEM
**ITEM** = `"item"`
@@ -18,7 +18,7 @@ The discount should be applied to applicable items in the cart.
___
-#### TOTAL
+### TOTAL
**TOTAL** = `"total"`
diff --git a/www/apps/docs/content/references/entities/enums/BatchJobStatus.mdx b/www/apps/docs/content/references/entities/enums/BatchJobStatus.mdx
index b2c5e0b950..2a4b2151a6 100644
--- a/www/apps/docs/content/references/entities/enums/BatchJobStatus.mdx
+++ b/www/apps/docs/content/references/entities/enums/BatchJobStatus.mdx
@@ -8,42 +8,42 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
## Enumeration Members
-#### CANCELED
+### CANCELED
**CANCELED** = `"canceled"`
___
-#### COMPLETED
+### COMPLETED
**COMPLETED** = `"completed"`
___
-#### CONFIRMED
+### CONFIRMED
**CONFIRMED** = `"confirmed"`
___
-#### CREATED
+### CREATED
**CREATED** = `"created"`
___
-#### FAILED
+### FAILED
**FAILED** = `"failed"`
___
-#### PRE\_PROCESSED
+### PRE\_PROCESSED
**PRE\_PROCESSED** = `"pre_processed"`
___
-#### PROCESSING
+### PROCESSING
**PROCESSING** = `"processing"`
diff --git a/www/apps/docs/content/references/entities/enums/CartType.mdx b/www/apps/docs/content/references/entities/enums/CartType.mdx
index 401129bcaf..c78f78f7ce 100644
--- a/www/apps/docs/content/references/entities/enums/CartType.mdx
+++ b/www/apps/docs/content/references/entities/enums/CartType.mdx
@@ -8,30 +8,30 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
## Enumeration Members
-#### CLAIM
+### CLAIM
**CLAIM** = `"claim"`
___
-#### DEFAULT
+### DEFAULT
**DEFAULT** = `"default"`
___
-#### DRAFT\_ORDER
+### DRAFT\_ORDER
**DRAFT\_ORDER** = `"draft_order"`
___
-#### PAYMENT\_LINK
+### PAYMENT\_LINK
**PAYMENT\_LINK** = `"payment_link"`
___
-#### SWAP
+### SWAP
**SWAP** = `"swap"`
diff --git a/www/apps/docs/content/references/entities/enums/ClaimFulfillmentStatus.mdx b/www/apps/docs/content/references/entities/enums/ClaimFulfillmentStatus.mdx
index 6bca914bdd..9640e72599 100644
--- a/www/apps/docs/content/references/entities/enums/ClaimFulfillmentStatus.mdx
+++ b/www/apps/docs/content/references/entities/enums/ClaimFulfillmentStatus.mdx
@@ -10,7 +10,7 @@ The claim's fulfillment status.
## Enumeration Members
-#### CANCELED
+### CANCELED
**CANCELED** = `"canceled"`
@@ -18,7 +18,7 @@ The claim's fulfillments are canceled.
___
-#### FULFILLED
+### FULFILLED
**FULFILLED** = `"fulfilled"`
@@ -26,7 +26,7 @@ The claim's replacement items are fulfilled.
___
-#### NOT\_FULFILLED
+### NOT\_FULFILLED
**NOT\_FULFILLED** = `"not_fulfilled"`
@@ -34,7 +34,7 @@ The claim's replacement items are not fulfilled.
___
-#### PARTIALLY\_FULFILLED
+### PARTIALLY\_FULFILLED
**PARTIALLY\_FULFILLED** = `"partially_fulfilled"`
@@ -42,7 +42,7 @@ Some of the claim's replacement items, but not all, are fulfilled.
___
-#### PARTIALLY\_RETURNED
+### PARTIALLY\_RETURNED
**PARTIALLY\_RETURNED** = `"partially_returned"`
@@ -50,7 +50,7 @@ Some of the claim's items, but not all, are returned.
___
-#### PARTIALLY\_SHIPPED
+### PARTIALLY\_SHIPPED
**PARTIALLY\_SHIPPED** = `"partially_shipped"`
@@ -58,7 +58,7 @@ Some of the claim's replacement items, but not all, are shipped.
___
-#### REQUIRES\_ACTION
+### REQUIRES\_ACTION
**REQUIRES\_ACTION** = `"requires_action"`
@@ -66,7 +66,7 @@ The claim's fulfillment requires action.
___
-#### RETURNED
+### RETURNED
**RETURNED** = `"returned"`
@@ -74,7 +74,7 @@ The claim's items are returned.
___
-#### SHIPPED
+### SHIPPED
**SHIPPED** = `"shipped"`
diff --git a/www/apps/docs/content/references/entities/enums/ClaimPaymentStatus.mdx b/www/apps/docs/content/references/entities/enums/ClaimPaymentStatus.mdx
index 05e3d57ce7..4a7aabbcac 100644
--- a/www/apps/docs/content/references/entities/enums/ClaimPaymentStatus.mdx
+++ b/www/apps/docs/content/references/entities/enums/ClaimPaymentStatus.mdx
@@ -10,7 +10,7 @@ The claim's payment status
## Enumeration Members
-#### NA
+### NA
**NA** = `"na"`
@@ -18,7 +18,7 @@ The payment status isn't set, which is typically used when the claim's type is `
___
-#### NOT\_REFUNDED
+### NOT\_REFUNDED
**NOT\_REFUNDED** = `"not_refunded"`
@@ -26,7 +26,7 @@ The payment isn't refunded.
___
-#### REFUNDED
+### REFUNDED
**REFUNDED** = `"refunded"`
diff --git a/www/apps/docs/content/references/entities/enums/ClaimReason.mdx b/www/apps/docs/content/references/entities/enums/ClaimReason.mdx
index 5d9e70c44f..6300920b54 100644
--- a/www/apps/docs/content/references/entities/enums/ClaimReason.mdx
+++ b/www/apps/docs/content/references/entities/enums/ClaimReason.mdx
@@ -8,24 +8,24 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
## Enumeration Members
-#### MISSING\_ITEM
+### MISSING\_ITEM
**MISSING\_ITEM** = `"missing_item"`
___
-#### OTHER
+### OTHER
**OTHER** = `"other"`
___
-#### PRODUCTION\_FAILURE
+### PRODUCTION\_FAILURE
**PRODUCTION\_FAILURE** = `"production_failure"`
___
-#### WRONG\_ITEM
+### WRONG\_ITEM
**WRONG\_ITEM** = `"wrong_item"`
diff --git a/www/apps/docs/content/references/entities/enums/ClaimType.mdx b/www/apps/docs/content/references/entities/enums/ClaimType.mdx
index 929041ee9e..23eabada69 100644
--- a/www/apps/docs/content/references/entities/enums/ClaimType.mdx
+++ b/www/apps/docs/content/references/entities/enums/ClaimType.mdx
@@ -10,7 +10,7 @@ The claim's type.
## Enumeration Members
-#### REFUND
+### REFUND
**REFUND** = `"refund"`
@@ -18,7 +18,7 @@ The claim refunds an amount to the customer.
___
-#### REPLACE
+### REPLACE
**REPLACE** = `"replace"`
diff --git a/www/apps/docs/content/references/entities/enums/DiscountConditionOperator.mdx b/www/apps/docs/content/references/entities/enums/DiscountConditionOperator.mdx
index 5906ead960..d4146cca85 100644
--- a/www/apps/docs/content/references/entities/enums/DiscountConditionOperator.mdx
+++ b/www/apps/docs/content/references/entities/enums/DiscountConditionOperator.mdx
@@ -10,7 +10,7 @@ The possible operators used for a discount condition.
## Enumeration Members
-#### IN
+### IN
**IN** = `"in"`
@@ -18,7 +18,7 @@ The discountable resources are within the specified resources.
___
-#### NOT\_IN
+### NOT\_IN
**NOT\_IN** = `"not_in"`
diff --git a/www/apps/docs/content/references/entities/enums/DiscountConditionType.mdx b/www/apps/docs/content/references/entities/enums/DiscountConditionType.mdx
index 864681779c..cd13c91243 100644
--- a/www/apps/docs/content/references/entities/enums/DiscountConditionType.mdx
+++ b/www/apps/docs/content/references/entities/enums/DiscountConditionType.mdx
@@ -10,7 +10,7 @@ The discount condition's type.
## Enumeration Members
-#### CUSTOMER\_GROUPS
+### CUSTOMER\_GROUPS
**CUSTOMER\_GROUPS** = `"customer_groups"`
@@ -18,7 +18,7 @@ The discount condition is used for customer groups.
___
-#### PRODUCTS
+### PRODUCTS
**PRODUCTS** = `"products"`
@@ -26,7 +26,7 @@ The discount condition is used for products.
___
-#### PRODUCT\_COLLECTIONS
+### PRODUCT\_COLLECTIONS
**PRODUCT\_COLLECTIONS** = `"product_collections"`
@@ -34,7 +34,7 @@ The discount condition is used for product collections.
___
-#### PRODUCT\_TAGS
+### PRODUCT\_TAGS
**PRODUCT\_TAGS** = `"product_tags"`
@@ -42,7 +42,7 @@ The discount condition is used for product tags.
___
-#### PRODUCT\_TYPES
+### PRODUCT\_TYPES
**PRODUCT\_TYPES** = `"product_types"`
diff --git a/www/apps/docs/content/references/entities/enums/DiscountRuleType.mdx b/www/apps/docs/content/references/entities/enums/DiscountRuleType.mdx
index 48fd94f166..7905738dfd 100644
--- a/www/apps/docs/content/references/entities/enums/DiscountRuleType.mdx
+++ b/www/apps/docs/content/references/entities/enums/DiscountRuleType.mdx
@@ -10,7 +10,7 @@ The possible types of discount rules.
## Enumeration Members
-#### FIXED
+### FIXED
**FIXED** = `"fixed"`
@@ -18,7 +18,7 @@ Discounts that reduce the price by a fixed amount.
___
-#### FREE\_SHIPPING
+### FREE\_SHIPPING
**FREE\_SHIPPING** = `"free_shipping"`
@@ -26,7 +26,7 @@ Discounts that sets the shipping price to `0`.
___
-#### PERCENTAGE
+### PERCENTAGE
**PERCENTAGE** = `"percentage"`
diff --git a/www/apps/docs/content/references/entities/enums/DraftOrderStatus.mdx b/www/apps/docs/content/references/entities/enums/DraftOrderStatus.mdx
index ba4212d8ab..87026819d2 100644
--- a/www/apps/docs/content/references/entities/enums/DraftOrderStatus.mdx
+++ b/www/apps/docs/content/references/entities/enums/DraftOrderStatus.mdx
@@ -10,7 +10,7 @@ The draft order's status.
## Enumeration Members
-#### COMPLETED
+### COMPLETED
**COMPLETED** = `"completed"`
@@ -18,7 +18,7 @@ The draft order is completed, and an order has been created from it.
___
-#### OPEN
+### OPEN
**OPEN** = `"open"`
diff --git a/www/apps/docs/content/references/entities/enums/FulfillmentStatus.mdx b/www/apps/docs/content/references/entities/enums/FulfillmentStatus.mdx
index c43bd91df7..560234d78a 100644
--- a/www/apps/docs/content/references/entities/enums/FulfillmentStatus.mdx
+++ b/www/apps/docs/content/references/entities/enums/FulfillmentStatus.mdx
@@ -10,7 +10,7 @@ The order's fulfillment status.
## Enumeration Members
-#### CANCELED
+### CANCELED
**CANCELED** = `"canceled"`
@@ -18,7 +18,7 @@ The order's fulfillments are canceled.
___
-#### FULFILLED
+### FULFILLED
**FULFILLED** = `"fulfilled"`
@@ -26,7 +26,7 @@ The order's items are fulfilled.
___
-#### NOT\_FULFILLED
+### NOT\_FULFILLED
**NOT\_FULFILLED** = `"not_fulfilled"`
@@ -34,7 +34,7 @@ The order's items are not fulfilled.
___
-#### PARTIALLY\_FULFILLED
+### PARTIALLY\_FULFILLED
**PARTIALLY\_FULFILLED** = `"partially_fulfilled"`
@@ -42,7 +42,7 @@ Some of the order's items, but not all, are fulfilled.
___
-#### PARTIALLY\_RETURNED
+### PARTIALLY\_RETURNED
**PARTIALLY\_RETURNED** = `"partially_returned"`
@@ -50,7 +50,7 @@ Some of the order's items, but not all, are returned.
___
-#### PARTIALLY\_SHIPPED
+### PARTIALLY\_SHIPPED
**PARTIALLY\_SHIPPED** = `"partially_shipped"`
@@ -58,7 +58,7 @@ Some of the order's items, but not all, are shipped.
___
-#### REQUIRES\_ACTION
+### REQUIRES\_ACTION
**REQUIRES\_ACTION** = `"requires_action"`
@@ -66,7 +66,7 @@ The order's fulfillment requires action.
___
-#### RETURNED
+### RETURNED
**RETURNED** = `"returned"`
@@ -74,7 +74,7 @@ The order's items are returned.
___
-#### SHIPPED
+### SHIPPED
**SHIPPED** = `"shipped"`
diff --git a/www/apps/docs/content/references/entities/enums/OrderEditItemChangeType.mdx b/www/apps/docs/content/references/entities/enums/OrderEditItemChangeType.mdx
index eb44a8e5b5..92c6cabab5 100644
--- a/www/apps/docs/content/references/entities/enums/OrderEditItemChangeType.mdx
+++ b/www/apps/docs/content/references/entities/enums/OrderEditItemChangeType.mdx
@@ -10,7 +10,7 @@ The type of the order edit item change.
## Enumeration Members
-#### ITEM\_ADD
+### ITEM\_ADD
**ITEM\_ADD** = `"item_add"`
@@ -18,7 +18,7 @@ A new item to be added to the original order.
___
-#### ITEM\_REMOVE
+### ITEM\_REMOVE
**ITEM\_REMOVE** = `"item_remove"`
@@ -26,7 +26,7 @@ An existing item to be removed from the original order.
___
-#### ITEM\_UPDATE
+### ITEM\_UPDATE
**ITEM\_UPDATE** = `"item_update"`
diff --git a/www/apps/docs/content/references/entities/enums/OrderEditStatus.mdx b/www/apps/docs/content/references/entities/enums/OrderEditStatus.mdx
index 2b63c41b80..e965d5f26b 100644
--- a/www/apps/docs/content/references/entities/enums/OrderEditStatus.mdx
+++ b/www/apps/docs/content/references/entities/enums/OrderEditStatus.mdx
@@ -10,7 +10,7 @@ The order edit's status.
## Enumeration Members
-#### CANCELED
+### CANCELED
**CANCELED** = `"canceled"`
@@ -18,7 +18,7 @@ The order edit is canceled.
___
-#### CONFIRMED
+### CONFIRMED
**CONFIRMED** = `"confirmed"`
@@ -26,7 +26,7 @@ The order edit is confirmed.
___
-#### CREATED
+### CREATED
**CREATED** = `"created"`
@@ -34,7 +34,7 @@ The order edit is created.
___
-#### DECLINED
+### DECLINED
**DECLINED** = `"declined"`
@@ -42,7 +42,7 @@ The order edit is declined.
___
-#### REQUESTED
+### REQUESTED
**REQUESTED** = `"requested"`
diff --git a/www/apps/docs/content/references/entities/enums/OrderStatus.mdx b/www/apps/docs/content/references/entities/enums/OrderStatus.mdx
index 60d4dd6001..9427b7ad56 100644
--- a/www/apps/docs/content/references/entities/enums/OrderStatus.mdx
+++ b/www/apps/docs/content/references/entities/enums/OrderStatus.mdx
@@ -10,7 +10,7 @@ The order's status.
## Enumeration Members
-#### ARCHIVED
+### ARCHIVED
**ARCHIVED** = `"archived"`
@@ -18,7 +18,7 @@ The order is archived.
___
-#### CANCELED
+### CANCELED
**CANCELED** = `"canceled"`
@@ -26,7 +26,7 @@ The order is canceled.
___
-#### COMPLETED
+### COMPLETED
**COMPLETED** = `"completed"`
@@ -36,7 +36,7 @@ has been captured.
___
-#### PENDING
+### PENDING
**PENDING** = `"pending"`
@@ -44,7 +44,7 @@ The order is pending.
___
-#### REQUIRES\_ACTION
+### REQUIRES\_ACTION
**REQUIRES\_ACTION** = `"requires_action"`
diff --git a/www/apps/docs/content/references/entities/enums/PaymentCollectionStatus.mdx b/www/apps/docs/content/references/entities/enums/PaymentCollectionStatus.mdx
index c011988b08..5f0e6ffb4f 100644
--- a/www/apps/docs/content/references/entities/enums/PaymentCollectionStatus.mdx
+++ b/www/apps/docs/content/references/entities/enums/PaymentCollectionStatus.mdx
@@ -10,7 +10,7 @@ The payment collection's status.
## Enumeration Members
-#### AUTHORIZED
+### AUTHORIZED
**AUTHORIZED** = `"authorized"`
@@ -18,7 +18,7 @@ The payment colleciton is authorized.
___
-#### AWAITING
+### AWAITING
**AWAITING** = `"awaiting"`
@@ -26,7 +26,7 @@ The payment collection is awaiting payment.
___
-#### CANCELED
+### CANCELED
**CANCELED** = `"canceled"`
@@ -34,7 +34,7 @@ The payment collection is canceled.
___
-#### NOT\_PAID
+### NOT\_PAID
**NOT\_PAID** = `"not_paid"`
@@ -42,7 +42,7 @@ The payment collection isn't paid.
___
-#### PARTIALLY\_AUTHORIZED
+### PARTIALLY\_AUTHORIZED
**PARTIALLY\_AUTHORIZED** = `"partially_authorized"`
diff --git a/www/apps/docs/content/references/entities/enums/PaymentCollectionType.mdx b/www/apps/docs/content/references/entities/enums/PaymentCollectionType.mdx
index 454e617049..b1f8feed0a 100644
--- a/www/apps/docs/content/references/entities/enums/PaymentCollectionType.mdx
+++ b/www/apps/docs/content/references/entities/enums/PaymentCollectionType.mdx
@@ -10,7 +10,7 @@ The payment collection's type.
## Enumeration Members
-#### ORDER\_EDIT
+### ORDER\_EDIT
**ORDER\_EDIT** = `"order_edit"`
diff --git a/www/apps/docs/content/references/entities/enums/PaymentSessionStatus.mdx b/www/apps/docs/content/references/entities/enums/PaymentSessionStatus.mdx
index f45190a1a3..6cc3711019 100644
--- a/www/apps/docs/content/references/entities/enums/PaymentSessionStatus.mdx
+++ b/www/apps/docs/content/references/entities/enums/PaymentSessionStatus.mdx
@@ -8,30 +8,30 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
## Enumeration Members
-#### AUTHORIZED
+### AUTHORIZED
**AUTHORIZED** = `"authorized"`
___
-#### CANCELED
+### CANCELED
**CANCELED** = `"canceled"`
___
-#### ERROR
+### ERROR
**ERROR** = `"error"`
___
-#### PENDING
+### PENDING
**PENDING** = `"pending"`
___
-#### REQUIRES\_MORE
+### REQUIRES\_MORE
**REQUIRES\_MORE** = `"requires_more"`
diff --git a/www/apps/docs/content/references/entities/enums/PaymentStatus.mdx b/www/apps/docs/content/references/entities/enums/PaymentStatus.mdx
index 0b8f68c06c..f1e020cb06 100644
--- a/www/apps/docs/content/references/entities/enums/PaymentStatus.mdx
+++ b/www/apps/docs/content/references/entities/enums/PaymentStatus.mdx
@@ -10,7 +10,7 @@ The order's payment status.
## Enumeration Members
-#### AWAITING
+### AWAITING
**AWAITING** = `"awaiting"`
@@ -18,7 +18,7 @@ The order's payment is awaiting capturing.
___
-#### CANCELED
+### CANCELED
**CANCELED** = `"canceled"`
@@ -26,7 +26,7 @@ The order's payment is canceled.
___
-#### CAPTURED
+### CAPTURED
**CAPTURED** = `"captured"`
@@ -34,7 +34,7 @@ The order's payment is captured.
___
-#### NOT\_PAID
+### NOT\_PAID
**NOT\_PAID** = `"not_paid"`
@@ -42,7 +42,7 @@ The order's payment is not paid.
___
-#### PARTIALLY\_REFUNDED
+### PARTIALLY\_REFUNDED
**PARTIALLY\_REFUNDED** = `"partially_refunded"`
@@ -50,7 +50,7 @@ Some of the order's payment amount is refunded.
___
-#### REFUNDED
+### REFUNDED
**REFUNDED** = `"refunded"`
@@ -58,7 +58,7 @@ The order's payment amount is refunded.
___
-#### REQUIRES\_ACTION
+### REQUIRES\_ACTION
**REQUIRES\_ACTION** = `"requires_action"`
diff --git a/www/apps/docs/content/references/entities/enums/PriceListStatus.mdx b/www/apps/docs/content/references/entities/enums/PriceListStatus.mdx
index e65894337b..458f0df10c 100644
--- a/www/apps/docs/content/references/entities/enums/PriceListStatus.mdx
+++ b/www/apps/docs/content/references/entities/enums/PriceListStatus.mdx
@@ -8,12 +8,12 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
## Enumeration Members
-#### ACTIVE
+### ACTIVE
**ACTIVE** = `"active"`
___
-#### DRAFT
+### DRAFT
**DRAFT** = `"draft"`
diff --git a/www/apps/docs/content/references/entities/enums/PriceListType.mdx b/www/apps/docs/content/references/entities/enums/PriceListType.mdx
index 5d238410a5..f079104657 100644
--- a/www/apps/docs/content/references/entities/enums/PriceListType.mdx
+++ b/www/apps/docs/content/references/entities/enums/PriceListType.mdx
@@ -8,12 +8,12 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
## Enumeration Members
-#### OVERRIDE
+### OVERRIDE
**OVERRIDE** = `"override"`
___
-#### SALE
+### SALE
**SALE** = `"sale"`
diff --git a/www/apps/docs/content/references/entities/enums/ProductStatus.mdx b/www/apps/docs/content/references/entities/enums/ProductStatus.mdx
index 942720d6c7..0f7c8b46df 100644
--- a/www/apps/docs/content/references/entities/enums/ProductStatus.mdx
+++ b/www/apps/docs/content/references/entities/enums/ProductStatus.mdx
@@ -10,7 +10,7 @@ The status of a product.
## Enumeration Members
-#### DRAFT
+### DRAFT
**DRAFT** = `"draft"`
@@ -18,7 +18,7 @@ The product is a draft. It's not viewable by customers.
___
-#### PROPOSED
+### PROPOSED
**PROPOSED** = `"proposed"`
@@ -26,7 +26,7 @@ The product is proposed, but not yet published.
___
-#### PUBLISHED
+### PUBLISHED
**PUBLISHED** = `"published"`
@@ -34,7 +34,7 @@ The product is published.
___
-#### REJECTED
+### REJECTED
**REJECTED** = `"rejected"`
diff --git a/www/apps/docs/content/references/entities/enums/RefundReason.mdx b/www/apps/docs/content/references/entities/enums/RefundReason.mdx
index 73dda8f429..1ca51325cb 100644
--- a/www/apps/docs/content/references/entities/enums/RefundReason.mdx
+++ b/www/apps/docs/content/references/entities/enums/RefundReason.mdx
@@ -10,7 +10,7 @@ The reason of the refund.
## Enumeration Members
-#### CLAIM
+### CLAIM
**CLAIM** = `"claim"`
@@ -18,7 +18,7 @@ The refund is applied because of a created claim.
___
-#### DISCOUNT
+### DISCOUNT
**DISCOUNT** = `"discount"`
@@ -26,7 +26,7 @@ The refund is applied as a discount.
___
-#### OTHER
+### OTHER
**OTHER** = `"other"`
@@ -34,7 +34,7 @@ The refund is created for a custom reason.
___
-#### RETURN
+### RETURN
**RETURN** = `"return"`
@@ -42,7 +42,7 @@ The refund is applied because of a created return.
___
-#### SWAP
+### SWAP
**SWAP** = `"swap"`
diff --git a/www/apps/docs/content/references/entities/enums/RequirementType.mdx b/www/apps/docs/content/references/entities/enums/RequirementType.mdx
index b835485cb6..8c9caa134a 100644
--- a/www/apps/docs/content/references/entities/enums/RequirementType.mdx
+++ b/www/apps/docs/content/references/entities/enums/RequirementType.mdx
@@ -10,7 +10,7 @@ The type of shipping option requirement.
## Enumeration Members
-#### MAX\_SUBTOTAL
+### MAX\_SUBTOTAL
**MAX\_SUBTOTAL** = `"max_subtotal"`
@@ -18,7 +18,7 @@ The shipping option can only be applied if the subtotal is less than the require
___
-#### MIN\_SUBTOTAL
+### MIN\_SUBTOTAL
**MIN\_SUBTOTAL** = `"min_subtotal"`
diff --git a/www/apps/docs/content/references/entities/enums/ReturnStatus.mdx b/www/apps/docs/content/references/entities/enums/ReturnStatus.mdx
index 2408d800b3..7d86a5fe10 100644
--- a/www/apps/docs/content/references/entities/enums/ReturnStatus.mdx
+++ b/www/apps/docs/content/references/entities/enums/ReturnStatus.mdx
@@ -10,7 +10,7 @@ The return's status.
## Enumeration Members
-#### CANCELED
+### CANCELED
**CANCELED** = `"canceled"`
@@ -18,7 +18,7 @@ The return is canceled.
___
-#### RECEIVED
+### RECEIVED
**RECEIVED** = `"received"`
@@ -26,7 +26,7 @@ The return is received.
___
-#### REQUESTED
+### REQUESTED
**REQUESTED** = `"requested"`
@@ -34,7 +34,7 @@ The return is requested.
___
-#### REQUIRES\_ACTION
+### REQUIRES\_ACTION
**REQUIRES\_ACTION** = `"requires_action"`
diff --git a/www/apps/docs/content/references/entities/enums/ShippingOptionPriceType.mdx b/www/apps/docs/content/references/entities/enums/ShippingOptionPriceType.mdx
index 9fbbbdaf80..fb58a0f17b 100644
--- a/www/apps/docs/content/references/entities/enums/ShippingOptionPriceType.mdx
+++ b/www/apps/docs/content/references/entities/enums/ShippingOptionPriceType.mdx
@@ -10,7 +10,7 @@ The type of the shipping option price.
## Enumeration Members
-#### CALCULATED
+### CALCULATED
**CALCULATED** = `"calculated"`
@@ -18,7 +18,7 @@ The shipping option's price is calculated. In this case, the `amount` field is t
___
-#### FLAT\_RATE
+### FLAT\_RATE
**FLAT\_RATE** = `"flat_rate"`
diff --git a/www/apps/docs/content/references/entities/enums/ShippingProfileType.mdx b/www/apps/docs/content/references/entities/enums/ShippingProfileType.mdx
index b59baaf208..eb986e3d76 100644
--- a/www/apps/docs/content/references/entities/enums/ShippingProfileType.mdx
+++ b/www/apps/docs/content/references/entities/enums/ShippingProfileType.mdx
@@ -10,7 +10,7 @@ The shipping profile's type.
## Enumeration Members
-#### CUSTOM
+### CUSTOM
**CUSTOM** = `"custom"`
@@ -18,7 +18,7 @@ The profile used to ship custom items.
___
-#### DEFAULT
+### DEFAULT
**DEFAULT** = `"default"`
@@ -26,7 +26,7 @@ The default profile used to ship item.
___
-#### GIFT\_CARD
+### GIFT\_CARD
**GIFT\_CARD** = `"gift_card"`
diff --git a/www/apps/docs/content/references/entities/enums/SwapFulfillmentStatus.mdx b/www/apps/docs/content/references/entities/enums/SwapFulfillmentStatus.mdx
index fbd0bd3c0c..2997ee1d1b 100644
--- a/www/apps/docs/content/references/entities/enums/SwapFulfillmentStatus.mdx
+++ b/www/apps/docs/content/references/entities/enums/SwapFulfillmentStatus.mdx
@@ -10,7 +10,7 @@ The swap's fulfillment status.
## Enumeration Members
-#### CANCELED
+### CANCELED
**CANCELED** = `"canceled"`
@@ -18,7 +18,7 @@ The swap's fulfillments are canceled.
___
-#### FULFILLED
+### FULFILLED
**FULFILLED** = `"fulfilled"`
@@ -26,7 +26,7 @@ The swap's items are fulfilled.
___
-#### NOT\_FULFILLED
+### NOT\_FULFILLED
**NOT\_FULFILLED** = `"not_fulfilled"`
@@ -34,7 +34,7 @@ The swap's items aren't fulfilled.
___
-#### PARTIALLY\_SHIPPED
+### PARTIALLY\_SHIPPED
**PARTIALLY\_SHIPPED** = `"partially_shipped"`
@@ -42,7 +42,7 @@ Some of the swap's items are shipped.
___
-#### REQUIRES\_ACTION
+### REQUIRES\_ACTION
**REQUIRES\_ACTION** = `"requires_action"`
@@ -50,7 +50,7 @@ The swap's fulfillments require an action.
___
-#### SHIPPED
+### SHIPPED
**SHIPPED** = `"shipped"`
diff --git a/www/apps/docs/content/references/entities/enums/SwapPaymentStatus.mdx b/www/apps/docs/content/references/entities/enums/SwapPaymentStatus.mdx
index fa7af904f3..3804a0f19c 100644
--- a/www/apps/docs/content/references/entities/enums/SwapPaymentStatus.mdx
+++ b/www/apps/docs/content/references/entities/enums/SwapPaymentStatus.mdx
@@ -10,7 +10,7 @@ The swap's payment status.
## Enumeration Members
-#### AWAITING
+### AWAITING
**AWAITING** = `"awaiting"`
@@ -18,7 +18,7 @@ The swap is additional awaiting payment.
___
-#### CANCELED
+### CANCELED
**CANCELED** = `"canceled"`
@@ -26,7 +26,7 @@ The swap's additional payment is canceled.
___
-#### CAPTURED
+### CAPTURED
**CAPTURED** = `"captured"`
@@ -34,7 +34,7 @@ The swap's additional payment is captured.
___
-#### CONFIRMED
+### CONFIRMED
**CONFIRMED** = `"confirmed"`
@@ -42,7 +42,7 @@ The swap's additional payment is confirmed.
___
-#### DIFFERENCE\_REFUNDED
+### DIFFERENCE\_REFUNDED
**DIFFERENCE\_REFUNDED** = `"difference_refunded"`
@@ -50,7 +50,7 @@ The negative difference amount between the returned item(s) and the new one(s) h
___
-#### NOT\_PAID
+### NOT\_PAID
**NOT\_PAID** = `"not_paid"`
@@ -58,7 +58,7 @@ The swap's additional payment isn't paid.
___
-#### PARTIALLY\_REFUNDED
+### PARTIALLY\_REFUNDED
**PARTIALLY\_REFUNDED** = `"partially_refunded"`
@@ -66,7 +66,7 @@ Some of the negative difference amount between the returned item(s) and the new
___
-#### REFUNDED
+### REFUNDED
**REFUNDED** = `"refunded"`
@@ -74,7 +74,7 @@ The amount in the associated order has been refunded.
___
-#### REQUIRES\_ACTION
+### REQUIRES\_ACTION
**REQUIRES\_ACTION** = `"requires_action"`
diff --git a/www/apps/docs/content/references/entities/enums/UserRoles.mdx b/www/apps/docs/content/references/entities/enums/UserRoles.mdx
index a2bb57bb56..52717c53c2 100644
--- a/www/apps/docs/content/references/entities/enums/UserRoles.mdx
+++ b/www/apps/docs/content/references/entities/enums/UserRoles.mdx
@@ -10,7 +10,7 @@ The user's role. These roles don't change the user's capabilities or provide acc
## Enumeration Members
-#### ADMIN
+### ADMIN
**ADMIN** = `"admin"`
@@ -18,7 +18,7 @@ The user is an admin.
___
-#### DEVELOPER
+### DEVELOPER
**DEVELOPER** = `"developer"`
@@ -26,7 +26,7 @@ The user is a developer.
___
-#### MEMBER
+### MEMBER
**MEMBER** = `"member"`
diff --git a/www/apps/docs/content/references/entities/index.mdx b/www/apps/docs/content/references/entities/index.mdx
index 79d66c70a6..e8d0be6506 100644
--- a/www/apps/docs/content/references/entities/index.mdx
+++ b/www/apps/docs/content/references/entities/index.mdx
@@ -135,13 +135,15 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
- [BatchJobResultStatDescriptor](types/BatchJobResultStatDescriptor.mdx)
- [Record](types/Record.mdx)
+___
+
## Functions
-#### Boolean
+### Boolean
`**Boolean**(value?): boolean`
-##### Type Parameters
+#### Type Parameters
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
`boolean`
diff --git a/www/apps/docs/content/references/entities/types/BatchJobResultError.mdx b/www/apps/docs/content/references/entities/types/BatchJobResultError.mdx
index 00c67ac674..df2a2139c5 100644
--- a/www/apps/docs/content/references/entities/types/BatchJobResultError.mdx
+++ b/www/apps/docs/content/references/entities/types/BatchJobResultError.mdx
@@ -8,11 +8,11 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
**BatchJobResultError**: `Object`
-#### Index signature
+## Index signature
▪ [key: `string`]: `unknown`
-#### Type declaration
+## Type declaration
+
+#### Parameters
+
+
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/AbstractFulfillmentService.mdx b/www/apps/docs/content/references/fulfillment/classes/AbstractFulfillmentService.mdx
new file mode 100644
index 0000000000..d7bb33f8f2
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/AbstractFulfillmentService.mdx
@@ -0,0 +1,2939 @@
+---
+displayed_sidebar: modules
+slug: /modules/carts-and-checkout/backend/add-fulfillment-provider
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# How to Create a Fulfillment Provider
+
+In this document, you’ll learn how to create a fulfillment provider to a Medusa backend and the methods you must implement in it. If you’re unfamiliar with the Shipping architecture in Medusa, make sure to [check out the overview first](https://docs.medusajs.com/modules/carts-and-checkout/shipping).
+
+## Overview
+
+A fulfillment provider is the shipping provider used to fulfill orders and deliver them to customers. An example of a fulfillment provider is FedEx.
+
+By default, a Medusa Backend has a `manual` fulfillment provider which has minimal implementation. It allows you to accept orders and fulfill them manually. However, you can integrate any fulfillment provider into Medusa, and your fulfillment provider can interact with third-party shipping providers.
+
+A fulfillment provider is a service that extends the `AbstractFulfillmentService` and implements its methods. So, adding a fulfillment provider is as simple as creating a service file in `src/services`.
+The file's name is the fulfillment provider's class name as a slug and without the word `Service`. For example, if you're creating a `MyFulfillmentService` class, the file name is `src/services/my-fulfillment.ts`.
+
+```ts title=src/services/my-fulfillment.ts
+import { AbstractFulfillmentService } from "@medusajs/medusa"
+
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // methods here...
+}
+```
+
+---
+
+## Identifier Property
+
+The `FulfillmentProvider` entity has 2 properties: `identifier` and `is_installed`. The `identifier` property in the class is used when the fulfillment provider is created in the database.
+
+The value of this property is also used to reference the fulfillment provider throughout Medusa. For example, it is used to [add a fulfillment provider](https://docs.medusajs.com/api/admin#regions\_postregionsregionfulfillmentproviders) to a region.
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ static identifier = "my-fulfillment"
+
+ // ...
+}
+```
+
+---
+
+## constructor
+
+You can use the `constructor` of your fulfillment provider to access the different services in Medusa through dependency injection.
+You can also use the constructor to initialize your integration with the third-party provider. For example, if you use a client to connect to the third-party provider’s APIs, you can initialize it in the constructor and use it in other methods in the service.
+Additionally, if you’re creating your fulfillment provider as an external plugin to be installed on any Medusa backend and you want to access the options added for the plugin, you can access it in the constructor.
+
+### Example
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ static identifier = "my-fulfillment"
+
+ // ...
+}
+```
+
+### Parameters
+
+ [MedusaContainer](../types/MedusaContainer.mdx)",
+ "description": "",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "registerAdd",
+ "type": "``(`name`: `string`, `registration`: `T`) => [MedusaContainer](../types/MedusaContainer.mdx)",
+ "description": "",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ },
+ {
+ "name": "config",
+ "type": "`Record`",
+ "description": "If this fulfillment provider is created in a plugin, the plugin's options are passed in this parameter.",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+]} />
+
+___
+
+## Methods
+
+### calculatePrice
+
+This method is used in different places, including:
+
+1. When the shipping options for a cart are retrieved during checkout. If a shipping option has their `price_type` set to calculated, this method is used to set the amount of the returned shipping option.
+2. When a shipping method is created. If the shipping option associated with the method has their `price_type` set to `calculated`, this method is used to set the `price` attribute of the shipping method in the database.
+3. When the cart's totals are calculated.
+
+#### Example
+
+An example of calculating the price based on some custom logic:
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // ...
+ async calculatePrice(
+ optionData: Record,
+ data: Record,
+ cart: Cart
+ ): Promise {
+ return cart.items.length * 1000
+ }
+}
+```
+
+If your fulfillment provider does not provide any dynamically calculated rates you can return any static value or throw an error. For example:
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // ...
+ async calculatePrice(
+ optionData: Record,
+ data: Record,
+ cart: Cart
+ ): Promise {
+ throw new Error("Method not implemented.")
+ }
+}
+```
+
+#### Parameters
+
+`",
+ "description": "The context of the cart which can include info like IP or user agent.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "created_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was created.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "customer",
+ "type": "[Customer](Customer.mdx)",
+ "description": "The details of the customer the cart belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "customer_id",
+ "type": "`string`",
+ "description": "The customer's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "deleted_at",
+ "type": "`null` \\| `Date`",
+ "description": "The date with timezone at which the resource was deleted.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "discount_total",
+ "type": "`number`",
+ "description": "The total of discount rounded",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "discounts",
+ "type": "[Discount](Discount.mdx)[]",
+ "description": "An array of details of all discounts applied to the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "email",
+ "type": "`string`",
+ "description": "The email associated with the cart",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "gift_card_tax_total",
+ "type": "`number`",
+ "description": "The total of gift cards with taxes",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "gift_card_total",
+ "type": "`number`",
+ "description": "The total of gift cards",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "gift_cards",
+ "type": "[GiftCard](GiftCard.mdx)[]",
+ "description": "An array of details of all gift cards applied to the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "id",
+ "type": "`string`",
+ "description": "The cart's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "idempotency_key",
+ "type": "`string`",
+ "description": "Randomly generated key used to continue the completion of a cart in case of failure.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "item_tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of items with taxes",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "items",
+ "type": "[LineItem](LineItem.mdx)[]",
+ "description": "The line items added to the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "metadata",
+ "type": "`Record`",
+ "description": "An optional key-value map with additional details",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "object",
+ "type": "`\"cart\"`",
+ "description": "",
+ "optional": false,
+ "defaultValue": "\"cart\"",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "payment",
+ "type": "[Payment](Payment.mdx)",
+ "description": "The details of the payment associated with the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "payment_authorized_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the payment was authorized.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "payment_id",
+ "type": "`string`",
+ "description": "The payment's ID if available",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "payment_session",
+ "type": "`null` \\| [PaymentSession](PaymentSession.mdx)",
+ "description": "The details of the selected payment session in the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "payment_sessions",
+ "type": "[PaymentSession](PaymentSession.mdx)[]",
+ "description": "The details of all payment sessions created on the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "raw_discount_total",
+ "type": "`number`",
+ "description": "The total of discount",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refundable_amount",
+ "type": "`number`",
+ "description": "The amount that can be refunded",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refunded_total",
+ "type": "`number`",
+ "description": "The total amount refunded if the order associated with this cart is returned.",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "region",
+ "type": "[Region](Region.mdx)",
+ "description": "The details of the region associated with the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "region_id",
+ "type": "`string`",
+ "description": "The region's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "sales_channel",
+ "type": "[SalesChannel](SalesChannel.mdx)",
+ "description": "The details of the sales channel associated with the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "sales_channel_id",
+ "type": "`null` \\| `string`",
+ "description": "The sales channel ID the cart is associated with.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_address",
+ "type": "`null` \\| [Address](Address.mdx)",
+ "description": "The details of the shipping address associated with the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "shipping_address_id",
+ "type": "`string`",
+ "description": "The shipping address's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_methods",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
+ "description": "The details of the shipping methods added to the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "shipping_tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of shipping with taxes",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_total",
+ "type": "`number`",
+ "description": "The total of shipping",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "subtotal",
+ "type": "`number`",
+ "description": "The subtotal of the cart",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of tax",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "total",
+ "type": "`number`",
+ "description": "The total amount of the cart",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "type",
+ "type": "[CartType](../enums/CartType.mdx)",
+ "description": "The cart's type.",
+ "optional": false,
+ "defaultValue": "default",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "updated_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was updated.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ }
+]} />
+
+#### Returns
+
+
+
+___
+
+### canCalculate
+
+This method is used to determine whether a shipping option is calculated dynamically or flat rate. It is called if the `price_type` of the shipping option being created is set to calculated.
+
+#### Example
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // ...
+ async canCalculate(
+ data: Record
+ ): Promise {
+ return data.id === "my-fulfillment-dynamic"
+ }
+}
+```
+
+#### Parameters
+
+
+
+#### Returns
+
+
+
+___
+
+### cancelFulfillment
+
+This method is called when a fulfillment is cancelled by the admin. This fulfillment can be for an order, a claim, or a swap.
+
+#### Example
+
+This is the basic implementation of the method for a fulfillment provider that doesn't interact with a third-party provider to cancel the fulfillment:
+
+```ts
+class MyFulfillmentService extends FulfillmentService {
+ // ...
+ async cancelFulfillment(
+ fulfillment: Record
+ ): Promise {
+ return {}
+ }
+}
+```
+
+#### Parameters
+
+
+
+#### Returns
+
+
+
+___
+
+### createFulfillment
+
+This method is used when a fulfillment is created for an order, a claim, or a swap.
+
+#### Example
+
+Here is a basic implementation of `createFulfillment` for a fulfillment provider that does not interact with any third-party provider to create the fulfillment:
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // ...
+ async createFulfillment(
+ data: Record,
+ items: LineItem,
+ order: Order,
+ fulfillment: Fulfillment
+ ) {
+ // No data is being sent anywhere
+ // No data to be stored in the fulfillment's data object
+ return {}
+ }
+}
+```
+
+#### Parameters
+
+`",
+ "description": "An optional key-value map with additional details",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "order",
+ "type": "[Order](Order.mdx)",
+ "description": "The details of the order that the line item may belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "order_edit",
+ "type": "`null` \\| [OrderEdit](OrderEdit.mdx)",
+ "description": "The details of the order edit.",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "order_edit_id",
+ "type": "`null` \\| `string`",
+ "description": "The ID of the order edit that the item may belong to.",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "order_id",
+ "type": "`null` \\| `string`",
+ "description": "The ID of the order that the line item may belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "original_item_id",
+ "type": "`null` \\| `string`",
+ "description": "The ID of the original line item. This is useful if the line item belongs to a resource that references an order, such as a return or an order edit.",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "original_tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The original tax total amount of the line item",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "original_total",
+ "type": "`null` \\| `number`",
+ "description": "The original total amount of the line item",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "product_id",
+ "type": "`null` \\| `string`",
+ "description": "",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "quantity",
+ "type": "`number`",
+ "description": "The quantity of the content in the Line Item.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "raw_discount_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of discount of the line item",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refundable",
+ "type": "`null` \\| `number`",
+ "description": "The amount that can be refunded from the given Line Item. Takes taxes and discounts into consideration.",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "returned_quantity",
+ "type": "`null` \\| `number`",
+ "description": "The quantity of the Line Item that has been returned.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipped_quantity",
+ "type": "`null` \\| `number`",
+ "description": "The quantity of the Line Item that has been shipped.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "should_merge",
+ "type": "`boolean`",
+ "description": "Flag to indicate if new Line Items with the same variant should be merged or added as an additional Line Item.",
+ "optional": false,
+ "defaultValue": "true",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "subtotal",
+ "type": "`null` \\| `number`",
+ "description": "The subtotal of the line item",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "swap",
+ "type": "[Swap](Swap.mdx)",
+ "description": "The details of the swap that the line item may belong to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "swap_id",
+ "type": "`string`",
+ "description": "The ID of the swap that the line item may belong to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "tax_lines",
+ "type": "[LineItemTaxLine](LineItemTaxLine.mdx)[]",
+ "description": "The details of the item's tax lines.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of tax of the line item",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "thumbnail",
+ "type": "`null` \\| `string`",
+ "description": "A URL string to a small image of the contents of the Line Item.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "title",
+ "type": "`string`",
+ "description": "The title of the Line Item.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "total",
+ "type": "`null` \\| `number`",
+ "description": "The total amount of the line item",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "unit_price",
+ "type": "`number`",
+ "description": "The price of one unit of the content in the Line Item. This should be in the currency defined by the Cart/Order/Swap/Claim that the Line Item belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "updated_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was updated.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "variant",
+ "type": "[ProductVariant](ProductVariant.mdx)",
+ "description": "The details of the product variant that this item was created from.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "variant_id",
+ "type": "`null` \\| `string`",
+ "description": "The id of the Product Variant contained in the Line Item.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ },
+ {
+ "name": "order",
+ "type": "[Order](Order.mdx)",
+ "description": "An order is a purchase made by a customer. It holds details about payment and fulfillment of the order. An order may also be created from a draft order, which is created by an admin user.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": [
+ {
+ "name": "billing_address",
+ "type": "[Address](Address.mdx)",
+ "description": "The details of the billing address associated with the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "billing_address_id",
+ "type": "`string`",
+ "description": "The ID of the billing address associated with the order",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "canceled_at",
+ "type": "`Date`",
+ "description": "The date the order was canceled on.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "cart",
+ "type": "[Cart](Cart.mdx)",
+ "description": "The details of the cart associated with the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "cart_id",
+ "type": "`string`",
+ "description": "The ID of the cart associated with the order",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "claims",
+ "type": "[ClaimOrder](ClaimOrder.mdx)[]",
+ "description": "The details of the claims created for the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "created_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was created.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "currency",
+ "type": "[Currency](Currency.mdx)",
+ "description": "The details of the currency used in the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "currency_code",
+ "type": "`string`",
+ "description": "The 3 character currency code that is used in the order",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "customer",
+ "type": "[Customer](Customer.mdx)",
+ "description": "The details of the customer associated with the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "customer_id",
+ "type": "`string`",
+ "description": "The ID of the customer associated with the order",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "discount_total",
+ "type": "`number`",
+ "description": "The total of discount rounded",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "discounts",
+ "type": "[Discount](Discount.mdx)[]",
+ "description": "The details of the discounts applied on the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "display_id",
+ "type": "`number`",
+ "description": "The order's display ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "draft_order",
+ "type": "[DraftOrder](DraftOrder.mdx)",
+ "description": "The details of the draft order this order was created from.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "draft_order_id",
+ "type": "`string`",
+ "description": "The ID of the draft order this order was created from.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "edits",
+ "type": "[OrderEdit](OrderEdit.mdx)[]",
+ "description": "The details of the order edits done on the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "email",
+ "type": "`string`",
+ "description": "The email associated with the order",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "external_id",
+ "type": "`null` \\| `string`",
+ "description": "The ID of an external order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "fulfillment_status",
+ "type": "[FulfillmentStatus](../enums/FulfillmentStatus.mdx)",
+ "description": "The order's fulfillment status",
+ "optional": false,
+ "defaultValue": "not_fulfilled",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "fulfillments",
+ "type": "[Fulfillment](Fulfillment.mdx)[]",
+ "description": "The details of the fulfillments created for the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "gift_card_tax_total",
+ "type": "`number`",
+ "description": "The total of gift cards with taxes",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "gift_card_total",
+ "type": "`number`",
+ "description": "The total of gift cards",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "gift_card_transactions",
+ "type": "[GiftCardTransaction](GiftCardTransaction.mdx)[]",
+ "description": "The gift card transactions made in the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "gift_cards",
+ "type": "[GiftCard](GiftCard.mdx)[]",
+ "description": "The details of the gift card used in the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "id",
+ "type": "`string`",
+ "description": "The order's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "idempotency_key",
+ "type": "`string`",
+ "description": "Randomly generated key used to continue the processing of the order in case of failure.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "item_tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The tax total applied on items",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "items",
+ "type": "[LineItem](LineItem.mdx)[]",
+ "description": "The details of the line items that belong to the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "metadata",
+ "type": "`Record`",
+ "description": "An optional key-value map with additional details",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "no_notification",
+ "type": "`boolean`",
+ "description": "Flag for describing whether or not notifications related to this should be send.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "object",
+ "type": "`\"order\"`",
+ "description": "",
+ "optional": false,
+ "defaultValue": "\"order\"",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "paid_total",
+ "type": "`number`",
+ "description": "The total amount paid",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "payment_status",
+ "type": "[PaymentStatus](../enums/PaymentStatus.mdx)",
+ "description": "The order's payment status",
+ "optional": false,
+ "defaultValue": "not_paid",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "payments",
+ "type": "[Payment](Payment.mdx)[]",
+ "description": "The details of the payments used in the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "raw_discount_total",
+ "type": "`number`",
+ "description": "The total of discount",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refundable_amount",
+ "type": "`number`",
+ "description": "The amount that can be refunded",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refunded_total",
+ "type": "`number`",
+ "description": "The total amount refunded if the order is returned.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refunds",
+ "type": "[Refund](Refund.mdx)[]",
+ "description": "The details of the refunds created for the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "region",
+ "type": "[Region](Region.mdx)",
+ "description": "The details of the region this order was created in.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "region_id",
+ "type": "`string`",
+ "description": "The ID of the region this order was created in.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "returnable_items",
+ "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": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "returns",
+ "type": "[Return](Return.mdx)[]",
+ "description": "The details of the returns created for the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "sales_channel",
+ "type": "[SalesChannel](SalesChannel.mdx)",
+ "description": "The details of the sales channel this order belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "sales_channel_id",
+ "type": "`null` \\| `string`",
+ "description": "The ID of the sales channel this order belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_address",
+ "type": "[Address](Address.mdx)",
+ "description": "The details of the shipping address associated with the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "shipping_address_id",
+ "type": "`string`",
+ "description": "The ID of the shipping address associated with the order",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_methods",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
+ "description": "The details of the shipping methods used in the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "shipping_tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The tax total applied on shipping",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_total",
+ "type": "`number`",
+ "description": "The total of shipping",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "status",
+ "type": "[OrderStatus](../enums/OrderStatus.mdx)",
+ "description": "The order's status",
+ "optional": false,
+ "defaultValue": "pending",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "subtotal",
+ "type": "`number`",
+ "description": "The subtotal of the order",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "swaps",
+ "type": "[Swap](Swap.mdx)[]",
+ "description": "The details of the swaps created for the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "tax_rate",
+ "type": "`null` \\| `number`",
+ "description": "The order's tax rate",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of tax",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "total",
+ "type": "`number`",
+ "description": "The total amount of the order",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "updated_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was updated.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ },
+ {
+ "name": "fulfillment",
+ "type": "[Fulfillment](Fulfillment.mdx)",
+ "description": "A Fulfillment is created once an admin can prepare the purchased goods. Fulfillments will eventually be shipped and hold information about how to track shipments. Fulfillments are created through a fulfillment provider, which typically integrates a third-party shipping service. Fulfillments can be associated with orders, claims, swaps, and returns.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": [
+ {
+ "name": "canceled_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the Fulfillment was canceled.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "claim_order",
+ "type": "[ClaimOrder](ClaimOrder.mdx)",
+ "description": "The details of the claim that the fulfillment may belong to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "claim_order_id",
+ "type": "`string`",
+ "description": "The ID of the Claim that the Fulfillment belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "created_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was created.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "data",
+ "type": "`Record`",
+ "description": "This contains all the data necessary for the Fulfillment provider to handle the fulfillment.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "id",
+ "type": "`string`",
+ "description": "The fulfillment's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "idempotency_key",
+ "type": "`string`",
+ "description": "Randomly generated key used to continue the completion of the fulfillment in case of failure.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "items",
+ "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": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "location_id",
+ "type": "`null` \\| `string`",
+ "description": "The ID of the stock location the fulfillment will be shipped from",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "metadata",
+ "type": "`Record`",
+ "description": "An optional key-value map with additional details",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "no_notification",
+ "type": "`boolean`",
+ "description": "Flag for describing whether or not notifications related to this should be sent.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "order",
+ "type": "[Order](Order.mdx)",
+ "description": "The details of the order that the fulfillment may belong to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "order_id",
+ "type": "`string`",
+ "description": "The ID of the Order that the Fulfillment belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "provider",
+ "type": "[FulfillmentProvider](FulfillmentProvider.mdx)",
+ "description": "The details of the fulfillment provider responsible for handling the fulfillment.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "provider_id",
+ "type": "`string`",
+ "description": "The ID of the Fulfillment Provider responsible for handling the fulfillment.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipped_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the Fulfillment was shipped.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "swap",
+ "type": "[Swap](Swap.mdx)",
+ "description": "The details of the swap that the fulfillment may belong to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "swap_id",
+ "type": "`string`",
+ "description": "The ID of the Swap that the Fulfillment belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "tracking_links",
+ "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": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "tracking_numbers",
+ "type": "`string`[]",
+ "description": "The tracking numbers that can be used to track the status of the fulfillment.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "updated_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was updated.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ }
+]} />
+
+#### Returns
+
+`",
+ "description": "",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ }
+]} />
+
+___
+
+### createReturn
+
+Fulfillment providers can also be used to return products. A shipping option can be used for returns if the `is_return` property is true or if an admin creates a Return Shipping Option from the settings.
+This method is used when the admin [creates a return request](https://docs.medusajs.com/api/admin#orders\_postordersorderreturns) for an order,
+[creates a swap](https://docs.medusajs.com/api/admin#orders\_postordersorderswaps) for an order, or when the
+[customer creates a return of their order](https://docs.medusajs.com/api/store#returns\_postreturns). The fulfillment is created automatically for the order return.
+
+#### Example
+
+This is the basic implementation of the method for a fulfillment provider that does not contact with a third-party provider to fulfill the return:
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // ...
+ async createReturn(
+ returnOrder: CreateReturnType
+ ): Promise> {
+ return {}
+ }
+}
+```
+
+#### Parameters
+
+`",
+ "description": "An optional key-value map with additional details",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "no_notification",
+ "type": "`null` \\| `boolean`",
+ "description": "When set to true, no notification will be sent related to this return.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "order",
+ "type": "[Order](Order.mdx)",
+ "description": "The details of the order that the return was created for.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "order_id",
+ "type": "`null` \\| `string`",
+ "description": "The ID of the order that the return was created for.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "received_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the return was received.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refund_amount",
+ "type": "`number`",
+ "description": "The amount that should be refunded as a result of the return.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_data",
+ "type": "`Record`",
+ "description": "Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_method",
+ "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": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "status",
+ "type": "[ReturnStatus](../enums/ReturnStatus.mdx)",
+ "description": "Status of the Return.",
+ "optional": false,
+ "defaultValue": "requested",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "swap",
+ "type": "[Swap](Swap.mdx)",
+ "description": "The details of the swap that the return may belong to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "swap_id",
+ "type": "`null` \\| `string`",
+ "description": "The ID of the swap that the return may belong to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "updated_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was updated.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ }
+]} />
+
+#### Returns
+
+`",
+ "optional": false,
+ "defaultValue": "",
+ "description": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ }
+]} />
+
+___
+
+### getFulfillmentDocuments
+
+This method is used to retrieve any documents associated with a fulfillment. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
+
+#### Example
+
+```ts
+class MyFulfillmentService extends FulfillmentService {
+ // ...
+ async getFulfillmentDocuments(
+ data: Record
+ ): Promise {
+ // assuming you contact a client to
+ // retrieve the document
+ return this.client.getFulfillmentDocuments()
+ }
+}
+```
+
+#### Parameters
+
+
+
+#### Returns
+
+
+
+___
+
+### getFulfillmentOptions
+
+This method is used when retrieving the list of fulfillment options available in a region, particularly by the [List Fulfillment Options API Route](https://docs.medusajs.com/api/admin#regions\_getregionsregionfulfillmentoptions).
+For example, if you’re integrating UPS as a fulfillment provider, you might support two fulfillment options: UPS Express Shipping and UPS Access Point. Each of these options can have different data associated with them.
+
+#### Example
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // ...
+ async getFulfillmentOptions(): Promise {
+ return [
+ {
+ id: "my-fulfillment",
+ },
+ {
+ id: "my-fulfillment-dynamic",
+ },
+ ]
+ }
+}
+```
+
+#### Returns
+
+
+
+___
+
+### getReturnDocuments
+
+This method is used to retrieve any documents associated with a return. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
+
+#### Example
+
+```ts
+class MyFulfillmentService extends FulfillmentService {
+ // ...
+ async getReturnDocuments(
+ data: Record
+ ): Promise {
+ // assuming you contact a client to
+ // retrieve the document
+ return this.client.getReturnDocuments()
+ }
+}
+```
+
+#### Parameters
+
+`",
+ "description": "The data attribute of the return that you're retrieving the documents for.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+]} />
+
+#### Returns
+
+
+
+___
+
+### getShipmentDocuments
+
+This method is used to retrieve any documents associated with a shipment. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
+
+#### Example
+
+```ts
+class MyFulfillmentService extends FulfillmentService {
+ // ...
+ async getShipmentDocuments(
+ data: Record
+ ): Promise {
+ // assuming you contact a client to
+ // retrieve the document
+ return this.client.getShipmentDocuments()
+ }
+}
+```
+
+#### Parameters
+
+`",
+ "description": "The `data` attribute of the shipment that you're retrieving the documents for.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+]} />
+
+#### Returns
+
+
+
+___
+
+### retrieveDocuments
+
+This method is used to retrieve any documents associated with an order and its fulfillments. This method isn't used by default in the backend, but you can use it for
+custom use cases such as allowing admins to download these documents.
+
+#### Example
+
+```ts
+class MyFulfillmentService extends FulfillmentService {
+ // ...
+ async retrieveDocuments(
+ fulfillmentData: Record,
+ documentType: "invoice" | "label"
+ ): Promise {
+ // assuming you contact a client to
+ // retrieve the document
+ return this.client.getDocuments()
+ }
+}
+```
+
+#### Parameters
+
+`",
+ "description": "The `data` attribute of the order's fulfillment.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "documentType",
+ "type": "`\"label\"` \\| `\"invoice\"`",
+ "description": "The type of document to retrieve.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+]} />
+
+#### Returns
+
+
+
+___
+
+### validateFulfillmentData
+
+This method is called when a shipping method is created. This typically happens when the customer chooses a shipping option during checkout, when a shipping method is created
+for an order return, or in other similar cases. The shipping option and its data are validated before the shipping method is created.
+
+You can use the provided parameters to validate the chosen shipping option. For example, you can check if the `data` object passed as a second parameter includes all data needed to
+fulfill the shipment later on.
+
+If any of the data is invalid, you can throw an error. This error will stop Medusa from creating a shipping method and the error message will be returned as a result of the API Route.
+
+#### Example
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // ...
+ async validateFulfillmentData(
+ optionData: Record,
+ data: Record,
+ cart: Cart
+ ): Promise> {
+ if (data.id !== "my-fulfillment") {
+ throw new Error("invalid data")
+ }
+
+ return {
+ ...data,
+ }
+ }
+}
+```
+
+#### Parameters
+
+`",
+ "description": "The context of the cart which can include info like IP or user agent.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "created_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was created.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "customer",
+ "type": "[Customer](Customer.mdx)",
+ "description": "The details of the customer the cart belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "customer_id",
+ "type": "`string`",
+ "description": "The customer's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "deleted_at",
+ "type": "`null` \\| `Date`",
+ "description": "The date with timezone at which the resource was deleted.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "discount_total",
+ "type": "`number`",
+ "description": "The total of discount rounded",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "discounts",
+ "type": "[Discount](Discount.mdx)[]",
+ "description": "An array of details of all discounts applied to the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "email",
+ "type": "`string`",
+ "description": "The email associated with the cart",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "gift_card_tax_total",
+ "type": "`number`",
+ "description": "The total of gift cards with taxes",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "gift_card_total",
+ "type": "`number`",
+ "description": "The total of gift cards",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "gift_cards",
+ "type": "[GiftCard](GiftCard.mdx)[]",
+ "description": "An array of details of all gift cards applied to the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "id",
+ "type": "`string`",
+ "description": "The cart's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "idempotency_key",
+ "type": "`string`",
+ "description": "Randomly generated key used to continue the completion of a cart in case of failure.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "item_tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of items with taxes",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "items",
+ "type": "[LineItem](LineItem.mdx)[]",
+ "description": "The line items added to the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "metadata",
+ "type": "`Record`",
+ "description": "An optional key-value map with additional details",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "object",
+ "type": "`\"cart\"`",
+ "description": "",
+ "optional": false,
+ "defaultValue": "\"cart\"",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "payment",
+ "type": "[Payment](Payment.mdx)",
+ "description": "The details of the payment associated with the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "payment_authorized_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the payment was authorized.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "payment_id",
+ "type": "`string`",
+ "description": "The payment's ID if available",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "payment_session",
+ "type": "`null` \\| [PaymentSession](PaymentSession.mdx)",
+ "description": "The details of the selected payment session in the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "payment_sessions",
+ "type": "[PaymentSession](PaymentSession.mdx)[]",
+ "description": "The details of all payment sessions created on the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "raw_discount_total",
+ "type": "`number`",
+ "description": "The total of discount",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refundable_amount",
+ "type": "`number`",
+ "description": "The amount that can be refunded",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refunded_total",
+ "type": "`number`",
+ "description": "The total amount refunded if the order associated with this cart is returned.",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "region",
+ "type": "[Region](Region.mdx)",
+ "description": "The details of the region associated with the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "region_id",
+ "type": "`string`",
+ "description": "The region's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "sales_channel",
+ "type": "[SalesChannel](SalesChannel.mdx)",
+ "description": "The details of the sales channel associated with the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "sales_channel_id",
+ "type": "`null` \\| `string`",
+ "description": "The sales channel ID the cart is associated with.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_address",
+ "type": "`null` \\| [Address](Address.mdx)",
+ "description": "The details of the shipping address associated with the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "shipping_address_id",
+ "type": "`string`",
+ "description": "The shipping address's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_methods",
+ "type": "[ShippingMethod](ShippingMethod.mdx)[]",
+ "description": "The details of the shipping methods added to the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "shipping_tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of shipping with taxes",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_total",
+ "type": "`number`",
+ "description": "The total of shipping",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "subtotal",
+ "type": "`number`",
+ "description": "The subtotal of the cart",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of tax",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "total",
+ "type": "`number`",
+ "description": "The total amount of the cart",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "type",
+ "type": "[CartType](../enums/CartType.mdx)",
+ "description": "The cart's type.",
+ "optional": false,
+ "defaultValue": "default",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "updated_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was updated.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ }
+]} />
+
+#### Returns
+
+`",
+ "optional": false,
+ "defaultValue": "",
+ "description": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ }
+]} />
+
+___
+
+### validateOption
+
+Once the admin creates the shipping option, the data of the shipping option will be validated first using this method. This method is called when the [Create Shipping Option API Route](https://docs.medusajs.com/api/admin#shipping-options\_postshippingoptions) is used.
+
+#### Example
+
+For example, you can use this method to ensure that the `id` in the `data` object is correct:
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // ...
+ async validateOption(
+ data: Record
+ ): Promise {
+ return data.id == "my-fulfillment"
+ }
+}
+```
+
+#### Parameters
+
+
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/Address.mdx b/www/apps/docs/content/references/fulfillment/classes/Address.mdx
new file mode 100644
index 0000000000..7e25f2eef1
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/Address.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Address
+
+An address is used across the Medusa backend within other schemas and object types. For example, a customer's billing and shipping addresses both use the Address entity.
+
+## constructor
+
+An address is used across the Medusa backend within other schemas and object types. For example, a customer's billing and shipping addresses both use the Address entity.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/BaseEntity.mdx b/www/apps/docs/content/references/fulfillment/classes/BaseEntity.mdx
new file mode 100644
index 0000000000..b254c9e991
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/BaseEntity.mdx
@@ -0,0 +1,11 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# BaseEntity
+
+Base abstract entity for all entities
+
+## constructor
diff --git a/www/apps/docs/content/references/fulfillment/classes/Cart.mdx b/www/apps/docs/content/references/fulfillment/classes/Cart.mdx
new file mode 100644
index 0000000000..80b459c369
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/Cart.mdx
@@ -0,0 +1,51 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Cart
+
+A cart represents a virtual shopping bag. It can be used to complete an order, a swap, or a claim.
+
+## constructor
+
+A cart represents a virtual shopping bag. It can be used to complete an order, a swap, or a claim.
+
+___
+
+## Methods
+
+### afterLoad
+
+#### Returns
+
+
+
+___
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ClaimImage.mdx b/www/apps/docs/content/references/fulfillment/classes/ClaimImage.mdx
new file mode 100644
index 0000000000..85c5bed4b1
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ClaimImage.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ClaimImage
+
+The details of an image attached to a claim.
+
+## constructor
+
+The details of an image attached to a claim.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ClaimItem.mdx b/www/apps/docs/content/references/fulfillment/classes/ClaimItem.mdx
new file mode 100644
index 0000000000..ece9c73cd9
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ClaimItem.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ClaimItem
+
+A claim item is an item created as part of a claim. It references an item in the order that should be exchanged or refunded.
+
+## constructor
+
+A claim item is an item created as part of a claim. It references an item in the order that should be exchanged or refunded.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ClaimOrder.mdx b/www/apps/docs/content/references/fulfillment/classes/ClaimOrder.mdx
new file mode 100644
index 0000000000..684e842ad0
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ClaimOrder.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ClaimOrder
+
+A Claim represents a group of faulty or missing items. It consists of claim items that refer to items in the original order that should be replaced or refunded. It also includes details related to shipping and fulfillment.
+
+## constructor
+
+A Claim represents a group of faulty or missing items. It consists of claim items that refer to items in the original order that should be replaced or refunded. It also includes details related to shipping and fulfillment.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ClaimTag.mdx b/www/apps/docs/content/references/fulfillment/classes/ClaimTag.mdx
new file mode 100644
index 0000000000..1cf3908d6c
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ClaimTag.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ClaimTag
+
+Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping.
+
+## constructor
+
+Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/Country.mdx b/www/apps/docs/content/references/fulfillment/classes/Country.mdx
new file mode 100644
index 0000000000..30e822583b
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/Country.mdx
@@ -0,0 +1,13 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Country
+
+Country details
+
+## constructor
+
+Country details
diff --git a/www/apps/docs/content/references/fulfillment/classes/Currency.mdx b/www/apps/docs/content/references/fulfillment/classes/Currency.mdx
new file mode 100644
index 0000000000..befeb03536
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/Currency.mdx
@@ -0,0 +1,13 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Currency
+
+Currency
+
+## constructor
+
+Currency
diff --git a/www/apps/docs/content/references/fulfillment/classes/Customer.mdx b/www/apps/docs/content/references/fulfillment/classes/Customer.mdx
new file mode 100644
index 0000000000..4101640941
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/Customer.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Customer
+
+A customer can make purchases in your store and manage their profile.
+
+## constructor
+
+A customer can make purchases in your store and manage their profile.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/CustomerGroup.mdx b/www/apps/docs/content/references/fulfillment/classes/CustomerGroup.mdx
new file mode 100644
index 0000000000..e986a54e97
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/CustomerGroup.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# CustomerGroup
+
+A customer group that can be used to organize customers into groups of similar traits.
+
+## constructor
+
+A customer group that can be used to organize customers into groups of similar traits.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/Discount.mdx b/www/apps/docs/content/references/fulfillment/classes/Discount.mdx
new file mode 100644
index 0000000000..fecc31318d
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/Discount.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Discount
+
+A discount can be applied to a cart for promotional purposes.
+
+## constructor
+
+A discount can be applied to a cart for promotional purposes.
+
+___
+
+## Methods
+
+### upperCaseCodeAndTrim
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/DiscountCondition.mdx b/www/apps/docs/content/references/fulfillment/classes/DiscountCondition.mdx
new file mode 100644
index 0000000000..add3562b20
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/DiscountCondition.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# DiscountCondition
+
+Holds rule conditions for when a discount is applicable
+
+## constructor
+
+Holds rule conditions for when a discount is applicable
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/DiscountRule.mdx b/www/apps/docs/content/references/fulfillment/classes/DiscountRule.mdx
new file mode 100644
index 0000000000..1ad4cfc0ae
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/DiscountRule.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# DiscountRule
+
+A discount rule defines how a Discount is calculated when applied to a Cart.
+
+## constructor
+
+A discount rule defines how a Discount is calculated when applied to a Cart.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/DraftOrder.mdx b/www/apps/docs/content/references/fulfillment/classes/DraftOrder.mdx
new file mode 100644
index 0000000000..67282b12ed
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/DraftOrder.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# DraftOrder
+
+A draft order is created by an admin without direct involvement of the customer. Once its payment is marked as captured, it is transformed into an order.
+
+## constructor
+
+A draft order is created by an admin without direct involvement of the customer. Once its payment is marked as captured, it is transformed into an order.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/Fulfillment.mdx b/www/apps/docs/content/references/fulfillment/classes/Fulfillment.mdx
new file mode 100644
index 0000000000..8fcef3503c
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/Fulfillment.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Fulfillment
+
+A Fulfillment is created once an admin can prepare the purchased goods. Fulfillments will eventually be shipped and hold information about how to track shipments. Fulfillments are created through a fulfillment provider, which typically integrates a third-party shipping service. Fulfillments can be associated with orders, claims, swaps, and returns.
+
+## constructor
+
+A Fulfillment is created once an admin can prepare the purchased goods. Fulfillments will eventually be shipped and hold information about how to track shipments. Fulfillments are created through a fulfillment provider, which typically integrates a third-party shipping service. Fulfillments can be associated with orders, claims, swaps, and returns.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/FulfillmentItem.mdx b/www/apps/docs/content/references/fulfillment/classes/FulfillmentItem.mdx
new file mode 100644
index 0000000000..4025a05220
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/FulfillmentItem.mdx
@@ -0,0 +1,13 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# FulfillmentItem
+
+This represents the association between a Line Item and a Fulfillment.
+
+## constructor
+
+This represents the association between a Line Item and a Fulfillment.
diff --git a/www/apps/docs/content/references/fulfillment/classes/FulfillmentProvider.mdx b/www/apps/docs/content/references/fulfillment/classes/FulfillmentProvider.mdx
new file mode 100644
index 0000000000..239dbc5bc9
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/FulfillmentProvider.mdx
@@ -0,0 +1,13 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# FulfillmentProvider
+
+A fulfillment provider represents a fulfillment service installed in the Medusa backend, either through a plugin or backend customizations. It holds the fulfillment service's installation status.
+
+## constructor
+
+A fulfillment provider represents a fulfillment service installed in the Medusa backend, either through a plugin or backend customizations. It holds the fulfillment service's installation status.
diff --git a/www/apps/docs/content/references/fulfillment/classes/GiftCard.mdx b/www/apps/docs/content/references/fulfillment/classes/GiftCard.mdx
new file mode 100644
index 0000000000..a43aa34a55
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/GiftCard.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# GiftCard
+
+Gift Cards are redeemable and represent a value that can be used towards the payment of an Order.
+
+## constructor
+
+Gift Cards are redeemable and represent a value that can be used towards the payment of an Order.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/GiftCardTransaction.mdx b/www/apps/docs/content/references/fulfillment/classes/GiftCardTransaction.mdx
new file mode 100644
index 0000000000..520cbf6bd3
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/GiftCardTransaction.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# GiftCardTransaction
+
+Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order.
+
+## constructor
+
+Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/Image.mdx b/www/apps/docs/content/references/fulfillment/classes/Image.mdx
new file mode 100644
index 0000000000..15fcc60c88
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/Image.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Image
+
+An Image is used to store details about uploaded images. Images are uploaded by the File Service, and the URL is provided by the File Service.
+
+## constructor
+
+An Image is used to store details about uploaded images. Images are uploaded by the File Service, and the URL is provided by the File Service.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/LineItem.mdx b/www/apps/docs/content/references/fulfillment/classes/LineItem.mdx
new file mode 100644
index 0000000000..0db90039c2
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/LineItem.mdx
@@ -0,0 +1,69 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# LineItem
+
+Line Items are created when a product is added to a Cart. When Line Items are purchased they will get copied to the resulting order, swap, or claim, and can eventually be referenced in Fulfillments and Returns. Line items may also be used for order edits.
+
+## constructor
+
+Line Items are created when a product is added to a Cart. When Line Items are purchased they will get copied to the resulting order, swap, or claim, and can eventually be referenced in Fulfillments and Returns. Line items may also be used for order edits.
+
+___
+
+## Methods
+
+### afterUpdateOrLoad
+
+#### Returns
+
+
+
+___
+
+### beforeInsert
+
+#### Returns
+
+
+
+___
+
+### beforeUpdate
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/LineItemAdjustment.mdx b/www/apps/docs/content/references/fulfillment/classes/LineItemAdjustment.mdx
new file mode 100644
index 0000000000..e25b05584a
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/LineItemAdjustment.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# LineItemAdjustment
+
+A Line Item Adjustment includes details on discounts applied on a line item.
+
+## constructor
+
+A Line Item Adjustment includes details on discounts applied on a line item.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/LineItemTaxLine.mdx b/www/apps/docs/content/references/fulfillment/classes/LineItemTaxLine.mdx
new file mode 100644
index 0000000000..4e84930c98
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/LineItemTaxLine.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# LineItemTaxLine
+
+A Line Item Tax Line represents the taxes applied on a line item.
+
+## constructor
+
+A Line Item Tax Line represents the taxes applied on a line item.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/MoneyAmount.mdx b/www/apps/docs/content/references/fulfillment/classes/MoneyAmount.mdx
new file mode 100644
index 0000000000..215796359e
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/MoneyAmount.mdx
@@ -0,0 +1,69 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# MoneyAmount
+
+A Money Amount represent a price amount, for example, a product variant's price or a price in a price list. Each Money Amount either has a Currency or Region associated with it to indicate the pricing in a given Currency or, for fully region-based pricing, the given price in a specific Region. If region-based pricing is used, the amount will be in the currency defined for the Region.
+
+## constructor
+
+A Money Amount represent a price amount, for example, a product variant's price or a price in a price list. Each Money Amount either has a Currency or Region associated with it to indicate the pricing in a given Currency or, for fully region-based pricing, the given price in a specific Region. If region-based pricing is used, the amount will be in the currency defined for the Region.
+
+___
+
+## Methods
+
+### afterLoad
+
+#### Returns
+
+
+
+___
+
+### beforeInsert
+
+#### Returns
+
+
+
+___
+
+### beforeUpdate
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/Order.mdx b/www/apps/docs/content/references/fulfillment/classes/Order.mdx
new file mode 100644
index 0000000000..63a69901bd
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/Order.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Order
+
+An order is a purchase made by a customer. It holds details about payment and fulfillment of the order. An order may also be created from a draft order, which is created by an admin user.
+
+## constructor
+
+An order is a purchase made by a customer. It holds details about payment and fulfillment of the order. An order may also be created from a draft order, which is created by an admin user.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/OrderEdit.mdx b/www/apps/docs/content/references/fulfillment/classes/OrderEdit.mdx
new file mode 100644
index 0000000000..fd6205f966
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/OrderEdit.mdx
@@ -0,0 +1,51 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# OrderEdit
+
+Order edit allows modifying items in an order, such as adding, updating, or deleting items from the original order. Once the order edit is confirmed, the changes are reflected on the original order.
+
+## constructor
+
+Order edit allows modifying items in an order, such as adding, updating, or deleting items from the original order. Once the order edit is confirmed, the changes are reflected on the original order.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
+
+___
+
+### loadStatus
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/OrderItemChange.mdx b/www/apps/docs/content/references/fulfillment/classes/OrderItemChange.mdx
new file mode 100644
index 0000000000..d575cefa43
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/OrderItemChange.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# OrderItemChange
+
+An order item change is a change made within an order edit to an order's items. These changes are not reflected on the original order until the order edit is confirmed.
+
+## constructor
+
+An order item change is a change made within an order edit to an order's items. These changes are not reflected on the original order until the order edit is confirmed.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/Payment.mdx b/www/apps/docs/content/references/fulfillment/classes/Payment.mdx
new file mode 100644
index 0000000000..c70dcbd0c9
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/Payment.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Payment
+
+A payment is originally created from a payment session. Once a payment session is authorized, the payment is created to represent the authorized amount with a given payment method. Payments can be captured, canceled or refunded. Payments can be made towards orders, swaps, order edits, or other resources.
+
+## constructor
+
+A payment is originally created from a payment session. Once a payment session is authorized, the payment is created to represent the authorized amount with a given payment method. Payments can be captured, canceled or refunded. Payments can be made towards orders, swaps, order edits, or other resources.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/PaymentCollection.mdx b/www/apps/docs/content/references/fulfillment/classes/PaymentCollection.mdx
new file mode 100644
index 0000000000..92920258c2
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/PaymentCollection.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# PaymentCollection
+
+A payment collection allows grouping and managing a list of payments at one. This can be helpful when making additional payment for order edits or integrating installment payments.
+
+## constructor
+
+A payment collection allows grouping and managing a list of payments at one. This can be helpful when making additional payment for order edits or integrating installment payments.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/PaymentProvider.mdx b/www/apps/docs/content/references/fulfillment/classes/PaymentProvider.mdx
new file mode 100644
index 0000000000..fb762308d4
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/PaymentProvider.mdx
@@ -0,0 +1,13 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# PaymentProvider
+
+A payment provider represents a payment service installed in the Medusa backend, either through a plugin or backend customizations. It holds the payment service's installation status.
+
+## constructor
+
+A payment provider represents a payment service installed in the Medusa backend, either through a plugin or backend customizations. It holds the payment service's installation status.
diff --git a/www/apps/docs/content/references/fulfillment/classes/PaymentSession.mdx b/www/apps/docs/content/references/fulfillment/classes/PaymentSession.mdx
new file mode 100644
index 0000000000..a53fdec569
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/PaymentSession.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# PaymentSession
+
+A Payment Session is created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, which is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for payment processing such as capture or refund. Payment sessions can also be used as part of payment collections.
+
+## constructor
+
+A Payment Session is created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, which is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for payment processing such as capture or refund. Payment sessions can also be used as part of payment collections.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/PriceList.mdx b/www/apps/docs/content/references/fulfillment/classes/PriceList.mdx
new file mode 100644
index 0000000000..d7a32e70ae
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/PriceList.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# PriceList
+
+A Price List represents a set of prices that override the default price for one or more product variants.
+
+## constructor
+
+A Price List represents a set of prices that override the default price for one or more product variants.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/Product.mdx b/www/apps/docs/content/references/fulfillment/classes/Product.mdx
new file mode 100644
index 0000000000..7ac0b815cd
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/Product.mdx
@@ -0,0 +1,69 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Product
+
+A product is a saleable item that holds general information such as name or description. It must include at least one Product Variant, where each product variant defines different options to purchase the product with (for example, different sizes or colors). The prices and inventory of the product are defined on the variant level.
+
+## constructor
+
+A product is a saleable item that holds general information such as name or description. It must include at least one Product Variant, where each product variant defines different options to purchase the product with (for example, different sizes or colors). The prices and inventory of the product are defined on the variant level.
+
+___
+
+## Methods
+
+### afterLoad
+
+#### Returns
+
+
+
+___
+
+### beforeInsert
+
+#### Returns
+
+
+
+___
+
+### beforeUpdate
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ProductCategory.mdx b/www/apps/docs/content/references/fulfillment/classes/ProductCategory.mdx
new file mode 100644
index 0000000000..1f7a2f961d
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ProductCategory.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ProductCategory
+
+A product category can be used to categorize products into a hierarchy of categories.
+
+## constructor
+
+A product category can be used to categorize products into a hierarchy of categories.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ProductCollection.mdx b/www/apps/docs/content/references/fulfillment/classes/ProductCollection.mdx
new file mode 100644
index 0000000000..392da34c7d
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ProductCollection.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ProductCollection
+
+A Product Collection allows grouping together products for promotional purposes. For example, an admin can create a Summer collection, add products to it, and showcase it on the storefront.
+
+## constructor
+
+A Product Collection allows grouping together products for promotional purposes. For example, an admin can create a Summer collection, add products to it, and showcase it on the storefront.
+
+___
+
+## Methods
+
+### createHandleIfNotProvided
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ProductOption.mdx b/www/apps/docs/content/references/fulfillment/classes/ProductOption.mdx
new file mode 100644
index 0000000000..a2bb9095bb
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ProductOption.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ProductOption
+
+A Product Option defines properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color". Admins are free to create any product options.
+
+## constructor
+
+A Product Option defines properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color". Admins are free to create any product options.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ProductOptionValue.mdx b/www/apps/docs/content/references/fulfillment/classes/ProductOptionValue.mdx
new file mode 100644
index 0000000000..eedae578b8
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ProductOptionValue.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ProductOptionValue
+
+An option value is one of the possible values of a Product Option. Product Variants specify a unique combination of product option values.
+
+## constructor
+
+An option value is one of the possible values of a Product Option. Product Variants specify a unique combination of product option values.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ProductTag.mdx b/www/apps/docs/content/references/fulfillment/classes/ProductTag.mdx
new file mode 100644
index 0000000000..3323f45770
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ProductTag.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ProductTag
+
+A Product Tag can be added to Products for easy filtering and grouping.
+
+## constructor
+
+A Product Tag can be added to Products for easy filtering and grouping.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ProductType.mdx b/www/apps/docs/content/references/fulfillment/classes/ProductType.mdx
new file mode 100644
index 0000000000..548cf332ae
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ProductType.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ProductType
+
+A Product Type can be added to Products for filtering and reporting purposes.
+
+## constructor
+
+A Product Type can be added to Products for filtering and reporting purposes.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ProductVariant.mdx b/www/apps/docs/content/references/fulfillment/classes/ProductVariant.mdx
new file mode 100644
index 0000000000..4bbc21d28c
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ProductVariant.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ProductVariant
+
+A Product Variant represents a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. A product must at least have one product variant.
+
+## constructor
+
+A Product Variant represents a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. A product must at least have one product variant.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ProductVariantInventoryItem.mdx b/www/apps/docs/content/references/fulfillment/classes/ProductVariantInventoryItem.mdx
new file mode 100644
index 0000000000..7825502e99
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ProductVariantInventoryItem.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ProductVariantInventoryItem
+
+A Product Variant Inventory Item links variants with inventory items and denotes the required quantity of the variant.
+
+## constructor
+
+A Product Variant Inventory Item links variants with inventory items and denotes the required quantity of the variant.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/Refund.mdx b/www/apps/docs/content/references/fulfillment/classes/Refund.mdx
new file mode 100644
index 0000000000..06f23de913
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/Refund.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Refund
+
+A refund represents an amount of money transfered back to the customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by an admin for an order.
+
+## constructor
+
+A refund represents an amount of money transfered back to the customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by an admin for an order.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/Region.mdx b/www/apps/docs/content/references/fulfillment/classes/Region.mdx
new file mode 100644
index 0000000000..faa485fbfd
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/Region.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Region
+
+A region holds settings specific to a geographical location, including the currency, tax rates, and fulfillment and payment providers. A Region can consist of multiple countries to accomodate common shopping settings across countries.
+
+## constructor
+
+A region holds settings specific to a geographical location, including the currency, tax rates, and fulfillment and payment providers. A Region can consist of multiple countries to accomodate common shopping settings across countries.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/Return.mdx b/www/apps/docs/content/references/fulfillment/classes/Return.mdx
new file mode 100644
index 0000000000..16996c98f1
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/Return.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Return
+
+A Return holds information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can also be used as part of a Swap or a Claim.
+
+## constructor
+
+A Return holds information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can also be used as part of a Swap or a Claim.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ReturnItem.mdx b/www/apps/docs/content/references/fulfillment/classes/ReturnItem.mdx
new file mode 100644
index 0000000000..0cc8a537bb
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ReturnItem.mdx
@@ -0,0 +1,13 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ReturnItem
+
+A return item represents a line item in an order that is to be returned. It includes details related to the return and the reason behind it.
+
+## constructor
+
+A return item represents a line item in an order that is to be returned. It includes details related to the return and the reason behind it.
diff --git a/www/apps/docs/content/references/fulfillment/classes/ReturnReason.mdx b/www/apps/docs/content/references/fulfillment/classes/ReturnReason.mdx
new file mode 100644
index 0000000000..91f9548b11
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ReturnReason.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ReturnReason
+
+A Return Reason is a value defined by an admin. It can be used on Return Items in order to indicate why a Line Item was returned.
+
+## constructor
+
+A Return Reason is a value defined by an admin. It can be used on Return Items in order to indicate why a Line Item was returned.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/SalesChannel.mdx b/www/apps/docs/content/references/fulfillment/classes/SalesChannel.mdx
new file mode 100644
index 0000000000..7d158ba334
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/SalesChannel.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# SalesChannel
+
+A Sales Channel is a method a business offers its products for purchase for the customers. For example, a Webshop can be a sales channel, and a mobile app can be another.
+
+## constructor
+
+A Sales Channel is a method a business offers its products for purchase for the customers. For example, a Webshop can be a sales channel, and a mobile app can be another.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/SalesChannelLocation.mdx b/www/apps/docs/content/references/fulfillment/classes/SalesChannelLocation.mdx
new file mode 100644
index 0000000000..83481fe96d
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/SalesChannelLocation.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# SalesChannelLocation
+
+This represents the association between a sales channel and a stock locations.
+
+## constructor
+
+This represents the association between a sales channel and a stock locations.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ShippingMethod.mdx b/www/apps/docs/content/references/fulfillment/classes/ShippingMethod.mdx
new file mode 100644
index 0000000000..4063c72fe5
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ShippingMethod.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ShippingMethod
+
+A Shipping Method represents a way in which an Order or Return can be shipped. Shipping Methods are created from a Shipping Option, but may contain additional details that can be necessary for the Fulfillment Provider to handle the shipment. If the shipping method is created for a return, it may be associated with a claim or a swap that the return is part of.
+
+## constructor
+
+A Shipping Method represents a way in which an Order or Return can be shipped. Shipping Methods are created from a Shipping Option, but may contain additional details that can be necessary for the Fulfillment Provider to handle the shipment. If the shipping method is created for a return, it may be associated with a claim or a swap that the return is part of.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ShippingMethodTaxLine.mdx b/www/apps/docs/content/references/fulfillment/classes/ShippingMethodTaxLine.mdx
new file mode 100644
index 0000000000..e56b84e1fa
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ShippingMethodTaxLine.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ShippingMethodTaxLine
+
+A Shipping Method Tax Line represents the taxes applied on a shipping method in a cart.
+
+## constructor
+
+A Shipping Method Tax Line represents the taxes applied on a shipping method in a cart.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ShippingOption.mdx b/www/apps/docs/content/references/fulfillment/classes/ShippingOption.mdx
new file mode 100644
index 0000000000..bd72909c84
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ShippingOption.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ShippingOption
+
+A Shipping Option represents a way in which an Order or Return can be shipped. Shipping Options have an associated Fulfillment Provider that will be used when the fulfillment of an Order is initiated. Shipping Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information.
+
+## constructor
+
+A Shipping Option represents a way in which an Order or Return can be shipped. Shipping Options have an associated Fulfillment Provider that will be used when the fulfillment of an Order is initiated. Shipping Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ShippingOptionRequirement.mdx b/www/apps/docs/content/references/fulfillment/classes/ShippingOptionRequirement.mdx
new file mode 100644
index 0000000000..e5ca8bdb25
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ShippingOptionRequirement.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ShippingOptionRequirement
+
+A shipping option requirement defines conditions that a Cart must satisfy for the Shipping Option to be available for usage in the Cart.
+
+## constructor
+
+A shipping option requirement defines conditions that a Cart must satisfy for the Shipping Option to be available for usage in the Cart.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/ShippingProfile.mdx b/www/apps/docs/content/references/fulfillment/classes/ShippingProfile.mdx
new file mode 100644
index 0000000000..0f46bb9a4c
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/ShippingProfile.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+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.
+
+## constructor
+
+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.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/SoftDeletableEntity.mdx b/www/apps/docs/content/references/fulfillment/classes/SoftDeletableEntity.mdx
new file mode 100644
index 0000000000..ac8e75707c
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/SoftDeletableEntity.mdx
@@ -0,0 +1,11 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# SoftDeletableEntity
+
+Base abstract entity for all entities
+
+## constructor
diff --git a/www/apps/docs/content/references/fulfillment/classes/Swap.mdx b/www/apps/docs/content/references/fulfillment/classes/Swap.mdx
new file mode 100644
index 0000000000..237939102f
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/Swap.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Swap
+
+A swap can be created when a Customer wishes to exchange Products that they have purchased with different Products. It consists of a Return of previously purchased Products and a Fulfillment of new Products. It also includes information on any additional payment or refund required based on the difference between the exchanged products.
+
+## constructor
+
+A swap can be created when a Customer wishes to exchange Products that they have purchased with different Products. It consists of a Return of previously purchased Products and a Fulfillment of new Products. It also includes information on any additional payment or refund required based on the difference between the exchanged products.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/TaxLine.mdx b/www/apps/docs/content/references/fulfillment/classes/TaxLine.mdx
new file mode 100644
index 0000000000..2efceb041b
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/TaxLine.mdx
@@ -0,0 +1,13 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# TaxLine
+
+A tax line represents the taxes amount applied to a line item.
+
+## constructor
+
+A tax line represents the taxes amount applied to a line item.
diff --git a/www/apps/docs/content/references/fulfillment/classes/TaxProvider.mdx b/www/apps/docs/content/references/fulfillment/classes/TaxProvider.mdx
new file mode 100644
index 0000000000..9ce3ce2037
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/TaxProvider.mdx
@@ -0,0 +1,13 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# TaxProvider
+
+A tax provider represents a tax service installed in the Medusa backend, either through a plugin or backend customizations. It holds the tax service's installation status.
+
+## constructor
+
+A tax provider represents a tax service installed in the Medusa backend, either through a plugin or backend customizations. It holds the tax service's installation status.
diff --git a/www/apps/docs/content/references/fulfillment/classes/TaxRate.mdx b/www/apps/docs/content/references/fulfillment/classes/TaxRate.mdx
new file mode 100644
index 0000000000..7ec4a56a42
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/TaxRate.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# TaxRate
+
+A Tax Rate can be used to define a custom rate to charge on specified products, product types, and shipping options within a given region.
+
+## constructor
+
+A Tax Rate can be used to define a custom rate to charge on specified products, product types, and shipping options within a given region.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/classes/TrackingLink.mdx b/www/apps/docs/content/references/fulfillment/classes/TrackingLink.mdx
new file mode 100644
index 0000000000..43f56b3c2f
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/classes/TrackingLink.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# TrackingLink
+
+A tracking link holds information about tracking numbers for a Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. Typically, the tracking link is provided from the third-party service integrated through the used fulfillment provider.
+
+## constructor
+
+A tracking link holds information about tracking numbers for a Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. Typically, the tracking link is provided from the third-party service integrated through the used fulfillment provider.
+
+___
+
+## Methods
+
+### beforeInsert
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/enums/AllocationType.mdx b/www/apps/docs/content/references/fulfillment/enums/AllocationType.mdx
new file mode 100644
index 0000000000..730d1a829c
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/AllocationType.mdx
@@ -0,0 +1,25 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# AllocationType
+
+The scope that the discount should apply to.
+
+## Enumeration Members
+
+### ITEM
+
+ **ITEM** = `"item"`
+
+The discount should be applied to applicable items in the cart.
+
+___
+
+### TOTAL
+
+ **TOTAL** = `"total"`
+
+The discount should be applied to the checkout total.
diff --git a/www/apps/docs/content/references/fulfillment/enums/CartType.mdx b/www/apps/docs/content/references/fulfillment/enums/CartType.mdx
new file mode 100644
index 0000000000..bff32f4c6d
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/CartType.mdx
@@ -0,0 +1,37 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# CartType
+
+## Enumeration Members
+
+### CLAIM
+
+ **CLAIM** = `"claim"`
+
+___
+
+### DEFAULT
+
+ **DEFAULT** = `"default"`
+
+___
+
+### DRAFT\_ORDER
+
+ **DRAFT\_ORDER** = `"draft_order"`
+
+___
+
+### PAYMENT\_LINK
+
+ **PAYMENT\_LINK** = `"payment_link"`
+
+___
+
+### SWAP
+
+ **SWAP** = `"swap"`
diff --git a/www/apps/docs/content/references/fulfillment/enums/ClaimFulfillmentStatus.mdx b/www/apps/docs/content/references/fulfillment/enums/ClaimFulfillmentStatus.mdx
new file mode 100644
index 0000000000..c71f879f68
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/ClaimFulfillmentStatus.mdx
@@ -0,0 +1,81 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ClaimFulfillmentStatus
+
+The claim's fulfillment status.
+
+## Enumeration Members
+
+### CANCELED
+
+ **CANCELED** = `"canceled"`
+
+The claim's fulfillments are canceled.
+
+___
+
+### FULFILLED
+
+ **FULFILLED** = `"fulfilled"`
+
+The claim's replacement items are fulfilled.
+
+___
+
+### NOT\_FULFILLED
+
+ **NOT\_FULFILLED** = `"not_fulfilled"`
+
+The claim's replacement items are not fulfilled.
+
+___
+
+### PARTIALLY\_FULFILLED
+
+ **PARTIALLY\_FULFILLED** = `"partially_fulfilled"`
+
+Some of the claim's replacement items, but not all, are fulfilled.
+
+___
+
+### PARTIALLY\_RETURNED
+
+ **PARTIALLY\_RETURNED** = `"partially_returned"`
+
+Some of the claim's items, but not all, are returned.
+
+___
+
+### PARTIALLY\_SHIPPED
+
+ **PARTIALLY\_SHIPPED** = `"partially_shipped"`
+
+Some of the claim's replacement items, but not all, are shipped.
+
+___
+
+### REQUIRES\_ACTION
+
+ **REQUIRES\_ACTION** = `"requires_action"`
+
+The claim's fulfillment requires action.
+
+___
+
+### RETURNED
+
+ **RETURNED** = `"returned"`
+
+The claim's items are returned.
+
+___
+
+### SHIPPED
+
+ **SHIPPED** = `"shipped"`
+
+The claim's replacement items are shipped.
diff --git a/www/apps/docs/content/references/fulfillment/enums/ClaimPaymentStatus.mdx b/www/apps/docs/content/references/fulfillment/enums/ClaimPaymentStatus.mdx
new file mode 100644
index 0000000000..a2895ece8b
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/ClaimPaymentStatus.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ClaimPaymentStatus
+
+The claim's payment status
+
+## Enumeration Members
+
+### NA
+
+ **NA** = `"na"`
+
+The payment status isn't set, which is typically used when the claim's type is `replace`.
+
+___
+
+### NOT\_REFUNDED
+
+ **NOT\_REFUNDED** = `"not_refunded"`
+
+The payment isn't refunded.
+
+___
+
+### REFUNDED
+
+ **REFUNDED** = `"refunded"`
+
+The payment is refunded.
diff --git a/www/apps/docs/content/references/fulfillment/enums/ClaimReason.mdx b/www/apps/docs/content/references/fulfillment/enums/ClaimReason.mdx
new file mode 100644
index 0000000000..9bdb0eb3cf
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/ClaimReason.mdx
@@ -0,0 +1,31 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ClaimReason
+
+## Enumeration Members
+
+### MISSING\_ITEM
+
+ **MISSING\_ITEM** = `"missing_item"`
+
+___
+
+### OTHER
+
+ **OTHER** = `"other"`
+
+___
+
+### PRODUCTION\_FAILURE
+
+ **PRODUCTION\_FAILURE** = `"production_failure"`
+
+___
+
+### WRONG\_ITEM
+
+ **WRONG\_ITEM** = `"wrong_item"`
diff --git a/www/apps/docs/content/references/fulfillment/enums/ClaimType.mdx b/www/apps/docs/content/references/fulfillment/enums/ClaimType.mdx
new file mode 100644
index 0000000000..0b7f383d9f
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/ClaimType.mdx
@@ -0,0 +1,25 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ClaimType
+
+The claim's type.
+
+## Enumeration Members
+
+### REFUND
+
+ **REFUND** = `"refund"`
+
+The claim refunds an amount to the customer.
+
+___
+
+### REPLACE
+
+ **REPLACE** = `"replace"`
+
+The claim replaces the returned item with a new one.
diff --git a/www/apps/docs/content/references/fulfillment/enums/DiscountConditionOperator.mdx b/www/apps/docs/content/references/fulfillment/enums/DiscountConditionOperator.mdx
new file mode 100644
index 0000000000..4e236e0f5f
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/DiscountConditionOperator.mdx
@@ -0,0 +1,25 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# DiscountConditionOperator
+
+The possible operators used for a discount condition.
+
+## Enumeration Members
+
+### IN
+
+ **IN** = `"in"`
+
+The discountable resources are within the specified resources.
+
+___
+
+### NOT\_IN
+
+ **NOT\_IN** = `"not_in"`
+
+The discountable resources are everything but the specified resources.
diff --git a/www/apps/docs/content/references/fulfillment/enums/DiscountConditionType.mdx b/www/apps/docs/content/references/fulfillment/enums/DiscountConditionType.mdx
new file mode 100644
index 0000000000..c76b8a1702
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/DiscountConditionType.mdx
@@ -0,0 +1,49 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# DiscountConditionType
+
+The discount condition's type.
+
+## Enumeration Members
+
+### CUSTOMER\_GROUPS
+
+ **CUSTOMER\_GROUPS** = `"customer_groups"`
+
+The discount condition is used for customer groups.
+
+___
+
+### PRODUCTS
+
+ **PRODUCTS** = `"products"`
+
+The discount condition is used for products.
+
+___
+
+### PRODUCT\_COLLECTIONS
+
+ **PRODUCT\_COLLECTIONS** = `"product_collections"`
+
+The discount condition is used for product collections.
+
+___
+
+### PRODUCT\_TAGS
+
+ **PRODUCT\_TAGS** = `"product_tags"`
+
+The discount condition is used for product tags.
+
+___
+
+### PRODUCT\_TYPES
+
+ **PRODUCT\_TYPES** = `"product_types"`
+
+The discount condition is used for product types.
diff --git a/www/apps/docs/content/references/fulfillment/enums/DiscountRuleType.mdx b/www/apps/docs/content/references/fulfillment/enums/DiscountRuleType.mdx
new file mode 100644
index 0000000000..3e729ec213
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/DiscountRuleType.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# DiscountRuleType
+
+The possible types of discount rules.
+
+## Enumeration Members
+
+### FIXED
+
+ **FIXED** = `"fixed"`
+
+Discounts that reduce the price by a fixed amount.
+
+___
+
+### FREE\_SHIPPING
+
+ **FREE\_SHIPPING** = `"free_shipping"`
+
+Discounts that sets the shipping price to `0`.
+
+___
+
+### PERCENTAGE
+
+ **PERCENTAGE** = `"percentage"`
+
+Discounts that reduce the price by a percentage reduction.
diff --git a/www/apps/docs/content/references/fulfillment/enums/DraftOrderStatus.mdx b/www/apps/docs/content/references/fulfillment/enums/DraftOrderStatus.mdx
new file mode 100644
index 0000000000..1ae483867c
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/DraftOrderStatus.mdx
@@ -0,0 +1,25 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# DraftOrderStatus
+
+The draft order's status.
+
+## Enumeration Members
+
+### COMPLETED
+
+ **COMPLETED** = `"completed"`
+
+The draft order is completed, and an order has been created from it.
+
+___
+
+### OPEN
+
+ **OPEN** = `"open"`
+
+The draft order is open.
diff --git a/www/apps/docs/content/references/fulfillment/enums/FulfillmentStatus.mdx b/www/apps/docs/content/references/fulfillment/enums/FulfillmentStatus.mdx
new file mode 100644
index 0000000000..e394d6207c
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/FulfillmentStatus.mdx
@@ -0,0 +1,81 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# FulfillmentStatus
+
+The order's fulfillment status.
+
+## Enumeration Members
+
+### CANCELED
+
+ **CANCELED** = `"canceled"`
+
+The order's fulfillments are canceled.
+
+___
+
+### FULFILLED
+
+ **FULFILLED** = `"fulfilled"`
+
+The order's items are fulfilled.
+
+___
+
+### NOT\_FULFILLED
+
+ **NOT\_FULFILLED** = `"not_fulfilled"`
+
+The order's items are not fulfilled.
+
+___
+
+### PARTIALLY\_FULFILLED
+
+ **PARTIALLY\_FULFILLED** = `"partially_fulfilled"`
+
+Some of the order's items, but not all, are fulfilled.
+
+___
+
+### PARTIALLY\_RETURNED
+
+ **PARTIALLY\_RETURNED** = `"partially_returned"`
+
+Some of the order's items, but not all, are returned.
+
+___
+
+### PARTIALLY\_SHIPPED
+
+ **PARTIALLY\_SHIPPED** = `"partially_shipped"`
+
+Some of the order's items, but not all, are shipped.
+
+___
+
+### REQUIRES\_ACTION
+
+ **REQUIRES\_ACTION** = `"requires_action"`
+
+The order's fulfillment requires action.
+
+___
+
+### RETURNED
+
+ **RETURNED** = `"returned"`
+
+The order's items are returned.
+
+___
+
+### SHIPPED
+
+ **SHIPPED** = `"shipped"`
+
+The order's items are shipped.
diff --git a/www/apps/docs/content/references/fulfillment/enums/OrderEditItemChangeType.mdx b/www/apps/docs/content/references/fulfillment/enums/OrderEditItemChangeType.mdx
new file mode 100644
index 0000000000..c607268d42
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/OrderEditItemChangeType.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# OrderEditItemChangeType
+
+The type of the order edit item change.
+
+## Enumeration Members
+
+### ITEM\_ADD
+
+ **ITEM\_ADD** = `"item_add"`
+
+A new item to be added to the original order.
+
+___
+
+### ITEM\_REMOVE
+
+ **ITEM\_REMOVE** = `"item_remove"`
+
+An existing item to be removed from the original order.
+
+___
+
+### ITEM\_UPDATE
+
+ **ITEM\_UPDATE** = `"item_update"`
+
+An existing item to be updated in the original order.
diff --git a/www/apps/docs/content/references/fulfillment/enums/OrderEditStatus.mdx b/www/apps/docs/content/references/fulfillment/enums/OrderEditStatus.mdx
new file mode 100644
index 0000000000..4e73fb1386
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/OrderEditStatus.mdx
@@ -0,0 +1,49 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# OrderEditStatus
+
+The order edit's status.
+
+## Enumeration Members
+
+### CANCELED
+
+ **CANCELED** = `"canceled"`
+
+The order edit is canceled.
+
+___
+
+### CONFIRMED
+
+ **CONFIRMED** = `"confirmed"`
+
+The order edit is confirmed.
+
+___
+
+### CREATED
+
+ **CREATED** = `"created"`
+
+The order edit is created.
+
+___
+
+### DECLINED
+
+ **DECLINED** = `"declined"`
+
+The order edit is declined.
+
+___
+
+### REQUESTED
+
+ **REQUESTED** = `"requested"`
+
+The order edit is requested.
diff --git a/www/apps/docs/content/references/fulfillment/enums/OrderStatus.mdx b/www/apps/docs/content/references/fulfillment/enums/OrderStatus.mdx
new file mode 100644
index 0000000000..078aeb828e
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/OrderStatus.mdx
@@ -0,0 +1,51 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# OrderStatus
+
+The order's status.
+
+## Enumeration Members
+
+### ARCHIVED
+
+ **ARCHIVED** = `"archived"`
+
+The order is archived.
+
+___
+
+### CANCELED
+
+ **CANCELED** = `"canceled"`
+
+The order is canceled.
+
+___
+
+### COMPLETED
+
+ **COMPLETED** = `"completed"`
+
+The order is completed, meaning that
+the items have been fulfilled and the payment
+has been captured.
+
+___
+
+### PENDING
+
+ **PENDING** = `"pending"`
+
+The order is pending.
+
+___
+
+### REQUIRES\_ACTION
+
+ **REQUIRES\_ACTION** = `"requires_action"`
+
+The order requires action.
diff --git a/www/apps/docs/content/references/fulfillment/enums/PaymentCollectionStatus.mdx b/www/apps/docs/content/references/fulfillment/enums/PaymentCollectionStatus.mdx
new file mode 100644
index 0000000000..69236ded7d
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/PaymentCollectionStatus.mdx
@@ -0,0 +1,49 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# PaymentCollectionStatus
+
+The payment collection's status.
+
+## Enumeration Members
+
+### AUTHORIZED
+
+ **AUTHORIZED** = `"authorized"`
+
+The payment colleciton is authorized.
+
+___
+
+### AWAITING
+
+ **AWAITING** = `"awaiting"`
+
+The payment collection is awaiting payment.
+
+___
+
+### CANCELED
+
+ **CANCELED** = `"canceled"`
+
+The payment collection is canceled.
+
+___
+
+### NOT\_PAID
+
+ **NOT\_PAID** = `"not_paid"`
+
+The payment collection isn't paid.
+
+___
+
+### PARTIALLY\_AUTHORIZED
+
+ **PARTIALLY\_AUTHORIZED** = `"partially_authorized"`
+
+Some of the payments in the payment collection are authorized.
diff --git a/www/apps/docs/content/references/fulfillment/enums/PaymentStatus.mdx b/www/apps/docs/content/references/fulfillment/enums/PaymentStatus.mdx
new file mode 100644
index 0000000000..328faa775d
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/PaymentStatus.mdx
@@ -0,0 +1,65 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# PaymentStatus
+
+The order's payment status.
+
+## Enumeration Members
+
+### AWAITING
+
+ **AWAITING** = `"awaiting"`
+
+The order's payment is awaiting capturing.
+
+___
+
+### CANCELED
+
+ **CANCELED** = `"canceled"`
+
+The order's payment is canceled.
+
+___
+
+### CAPTURED
+
+ **CAPTURED** = `"captured"`
+
+The order's payment is captured.
+
+___
+
+### NOT\_PAID
+
+ **NOT\_PAID** = `"not_paid"`
+
+The order's payment is not paid.
+
+___
+
+### PARTIALLY\_REFUNDED
+
+ **PARTIALLY\_REFUNDED** = `"partially_refunded"`
+
+Some of the order's payment amount is refunded.
+
+___
+
+### REFUNDED
+
+ **REFUNDED** = `"refunded"`
+
+The order's payment amount is refunded.
+
+___
+
+### REQUIRES\_ACTION
+
+ **REQUIRES\_ACTION** = `"requires_action"`
+
+The order's payment requires action.
diff --git a/www/apps/docs/content/references/fulfillment/enums/PriceListStatus.mdx b/www/apps/docs/content/references/fulfillment/enums/PriceListStatus.mdx
new file mode 100644
index 0000000000..60b251262f
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/PriceListStatus.mdx
@@ -0,0 +1,19 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# PriceListStatus
+
+## Enumeration Members
+
+### ACTIVE
+
+ **ACTIVE** = `"active"`
+
+___
+
+### DRAFT
+
+ **DRAFT** = `"draft"`
diff --git a/www/apps/docs/content/references/fulfillment/enums/PriceListType.mdx b/www/apps/docs/content/references/fulfillment/enums/PriceListType.mdx
new file mode 100644
index 0000000000..73a7c41d7f
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/PriceListType.mdx
@@ -0,0 +1,19 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# PriceListType
+
+## Enumeration Members
+
+### OVERRIDE
+
+ **OVERRIDE** = `"override"`
+
+___
+
+### SALE
+
+ **SALE** = `"sale"`
diff --git a/www/apps/docs/content/references/fulfillment/enums/ProductStatus.mdx b/www/apps/docs/content/references/fulfillment/enums/ProductStatus.mdx
new file mode 100644
index 0000000000..86e2929feb
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/ProductStatus.mdx
@@ -0,0 +1,41 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ProductStatus
+
+The status of a product.
+
+## Enumeration Members
+
+### DRAFT
+
+ **DRAFT** = `"draft"`
+
+The product is a draft. It's not viewable by customers.
+
+___
+
+### PROPOSED
+
+ **PROPOSED** = `"proposed"`
+
+The product is proposed, but not yet published.
+
+___
+
+### PUBLISHED
+
+ **PUBLISHED** = `"published"`
+
+The product is published.
+
+___
+
+### REJECTED
+
+ **REJECTED** = `"rejected"`
+
+The product is rejected. It's not viewable by customers.
diff --git a/www/apps/docs/content/references/fulfillment/enums/RequirementType.mdx b/www/apps/docs/content/references/fulfillment/enums/RequirementType.mdx
new file mode 100644
index 0000000000..bb8a100a33
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/RequirementType.mdx
@@ -0,0 +1,25 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# RequirementType
+
+The type of shipping option requirement.
+
+## Enumeration Members
+
+### MAX\_SUBTOTAL
+
+ **MAX\_SUBTOTAL** = `"max_subtotal"`
+
+The shipping option can only be applied if the subtotal is less than the requirement's amont.
+
+___
+
+### MIN\_SUBTOTAL
+
+ **MIN\_SUBTOTAL** = `"min_subtotal"`
+
+The shipping option can only be applied if the subtotal is greater than the requirement's amount.
diff --git a/www/apps/docs/content/references/fulfillment/enums/ReturnStatus.mdx b/www/apps/docs/content/references/fulfillment/enums/ReturnStatus.mdx
new file mode 100644
index 0000000000..22fab6e6d1
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/ReturnStatus.mdx
@@ -0,0 +1,41 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ReturnStatus
+
+The return's status.
+
+## Enumeration Members
+
+### CANCELED
+
+ **CANCELED** = `"canceled"`
+
+The return is canceled.
+
+___
+
+### RECEIVED
+
+ **RECEIVED** = `"received"`
+
+The return is received.
+
+___
+
+### REQUESTED
+
+ **REQUESTED** = `"requested"`
+
+The return is requested.
+
+___
+
+### REQUIRES\_ACTION
+
+ **REQUIRES\_ACTION** = `"requires_action"`
+
+The return is awaiting action.
diff --git a/www/apps/docs/content/references/fulfillment/enums/ShippingOptionPriceType.mdx b/www/apps/docs/content/references/fulfillment/enums/ShippingOptionPriceType.mdx
new file mode 100644
index 0000000000..02eca86af8
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/ShippingOptionPriceType.mdx
@@ -0,0 +1,25 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ShippingOptionPriceType
+
+The type of the shipping option price.
+
+## Enumeration Members
+
+### CALCULATED
+
+ **CALCULATED** = `"calculated"`
+
+The shipping option's price is calculated. In this case, the `amount` field is typically `null`.
+
+___
+
+### FLAT\_RATE
+
+ **FLAT\_RATE** = `"flat_rate"`
+
+The shipping option's price is a flat rate.
diff --git a/www/apps/docs/content/references/fulfillment/enums/ShippingProfileType.mdx b/www/apps/docs/content/references/fulfillment/enums/ShippingProfileType.mdx
new file mode 100644
index 0000000000..dceab3e10d
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/ShippingProfileType.mdx
@@ -0,0 +1,33 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ShippingProfileType
+
+The shipping profile's type.
+
+## Enumeration Members
+
+### CUSTOM
+
+ **CUSTOM** = `"custom"`
+
+The profile used to ship custom items.
+
+___
+
+### DEFAULT
+
+ **DEFAULT** = `"default"`
+
+The default profile used to ship item.
+
+___
+
+### GIFT\_CARD
+
+ **GIFT\_CARD** = `"gift_card"`
+
+The profile used to ship gift cards.
diff --git a/www/apps/docs/content/references/fulfillment/enums/SwapFulfillmentStatus.mdx b/www/apps/docs/content/references/fulfillment/enums/SwapFulfillmentStatus.mdx
new file mode 100644
index 0000000000..f37d020ff5
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/SwapFulfillmentStatus.mdx
@@ -0,0 +1,57 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# SwapFulfillmentStatus
+
+The swap's fulfillment status.
+
+## Enumeration Members
+
+### CANCELED
+
+ **CANCELED** = `"canceled"`
+
+The swap's fulfillments are canceled.
+
+___
+
+### FULFILLED
+
+ **FULFILLED** = `"fulfilled"`
+
+The swap's items are fulfilled.
+
+___
+
+### NOT\_FULFILLED
+
+ **NOT\_FULFILLED** = `"not_fulfilled"`
+
+The swap's items aren't fulfilled.
+
+___
+
+### PARTIALLY\_SHIPPED
+
+ **PARTIALLY\_SHIPPED** = `"partially_shipped"`
+
+Some of the swap's items are shipped.
+
+___
+
+### REQUIRES\_ACTION
+
+ **REQUIRES\_ACTION** = `"requires_action"`
+
+The swap's fulfillments require an action.
+
+___
+
+### SHIPPED
+
+ **SHIPPED** = `"shipped"`
+
+The swap's items are shipped.
diff --git a/www/apps/docs/content/references/fulfillment/enums/SwapPaymentStatus.mdx b/www/apps/docs/content/references/fulfillment/enums/SwapPaymentStatus.mdx
new file mode 100644
index 0000000000..ff7f20baee
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/enums/SwapPaymentStatus.mdx
@@ -0,0 +1,81 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# SwapPaymentStatus
+
+The swap's payment status.
+
+## Enumeration Members
+
+### AWAITING
+
+ **AWAITING** = `"awaiting"`
+
+The swap is additional awaiting payment.
+
+___
+
+### CANCELED
+
+ **CANCELED** = `"canceled"`
+
+The swap's additional payment is canceled.
+
+___
+
+### CAPTURED
+
+ **CAPTURED** = `"captured"`
+
+The swap's additional payment is captured.
+
+___
+
+### CONFIRMED
+
+ **CONFIRMED** = `"confirmed"`
+
+The swap's additional payment is confirmed.
+
+___
+
+### DIFFERENCE\_REFUNDED
+
+ **DIFFERENCE\_REFUNDED** = `"difference_refunded"`
+
+The negative difference amount between the returned item(s) and the new one(s) has been refuneded.
+
+___
+
+### NOT\_PAID
+
+ **NOT\_PAID** = `"not_paid"`
+
+The swap's additional payment isn't paid.
+
+___
+
+### PARTIALLY\_REFUNDED
+
+ **PARTIALLY\_REFUNDED** = `"partially_refunded"`
+
+Some of the negative difference amount between the returned item(s) and the new one(s) has been refuneded.
+
+___
+
+### REFUNDED
+
+ **REFUNDED** = `"refunded"`
+
+The amount in the associated order has been refunded.
+
+___
+
+### REQUIRES\_ACTION
+
+ **REQUIRES\_ACTION** = `"requires_action"`
+
+The swap's payment requires an action.
diff --git a/www/apps/docs/content/references/fulfillment/interfaces/Boolean.mdx b/www/apps/docs/content/references/fulfillment/interfaces/Boolean.mdx
new file mode 100644
index 0000000000..54b013b61c
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/interfaces/Boolean.mdx
@@ -0,0 +1,27 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Boolean
+
+## Methods
+
+### valueOf
+
+Returns the primitive value of the specified object.
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/interfaces/FulfillmentService.mdx b/www/apps/docs/content/references/fulfillment/interfaces/FulfillmentService.mdx
new file mode 100644
index 0000000000..474bd71bdb
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/interfaces/FulfillmentService.mdx
@@ -0,0 +1,2876 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# FulfillmentService
+
+## Overview
+
+A fulfillment provider is the shipping provider used to fulfill orders and deliver them to customers. An example of a fulfillment provider is FedEx.
+
+By default, a Medusa Backend has a `manual` fulfillment provider which has minimal implementation. It allows you to accept orders and fulfill them manually. However, you can integrate any fulfillment provider into Medusa, and your fulfillment provider can interact with third-party shipping providers.
+
+A fulfillment provider is a service that extends the `AbstractFulfillmentService` and implements its methods. So, adding a fulfillment provider is as simple as creating a service file in `src/services`.
+The file's name is the fulfillment provider's class name as a slug and without the word `Service`. For example, if you're creating a `MyFulfillmentService` class, the file name is `src/services/my-fulfillment.ts`.
+
+```ts title=src/services/my-fulfillment.ts
+import { AbstractFulfillmentService } from "@medusajs/medusa"
+
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // methods here...
+}
+```
+
+---
+
+## Identifier Property
+
+The `FulfillmentProvider` entity has 2 properties: `identifier` and `is_installed`. The `identifier` property in the class is used when the fulfillment provider is created in the database.
+
+The value of this property is also used to reference the fulfillment provider throughout Medusa. For example, it is used to [add a fulfillment provider](https://docs.medusajs.com/api/admin#regions\_postregionsregionfulfillmentproviders) to a region.
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ static identifier = "my-fulfillment"
+
+ // ...
+}
+```
+
+---
+
+## Methods
+
+### calculatePrice
+
+This method is used in different places, including:
+
+1. When the shipping options for a cart are retrieved during checkout. If a shipping option has their `price_type` set to calculated, this method is used to set the amount of the returned shipping option.
+2. When a shipping method is created. If the shipping option associated with the method has their `price_type` set to `calculated`, this method is used to set the `price` attribute of the shipping method in the database.
+3. When the cart's totals are calculated.
+
+#### Example
+
+An example of calculating the price based on some custom logic:
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // ...
+ async calculatePrice(
+ optionData: Record,
+ data: Record,
+ cart: Cart
+ ): Promise {
+ return cart.items.length * 1000
+ }
+}
+```
+
+If your fulfillment provider does not provide any dynamically calculated rates you can return any static value or throw an error. For example:
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // ...
+ async calculatePrice(
+ optionData: Record,
+ data: Record,
+ cart: Cart
+ ): Promise {
+ throw new Error("Method not implemented.")
+ }
+}
+```
+
+#### Parameters
+
+`",
+ "description": "The context of the cart which can include info like IP or user agent.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "created_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was created.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "customer",
+ "type": "[Customer](../classes/Customer.mdx)",
+ "description": "The details of the customer the cart belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "customer_id",
+ "type": "`string`",
+ "description": "The customer's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "deleted_at",
+ "type": "`null` \\| `Date`",
+ "description": "The date with timezone at which the resource was deleted.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "discount_total",
+ "type": "`number`",
+ "description": "The total of discount rounded",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "discounts",
+ "type": "[Discount](../classes/Discount.mdx)[]",
+ "description": "An array of details of all discounts applied to the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "email",
+ "type": "`string`",
+ "description": "The email associated with the cart",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "gift_card_tax_total",
+ "type": "`number`",
+ "description": "The total of gift cards with taxes",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "gift_card_total",
+ "type": "`number`",
+ "description": "The total of gift cards",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "gift_cards",
+ "type": "[GiftCard](../classes/GiftCard.mdx)[]",
+ "description": "An array of details of all gift cards applied to the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "id",
+ "type": "`string`",
+ "description": "The cart's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "idempotency_key",
+ "type": "`string`",
+ "description": "Randomly generated key used to continue the completion of a cart in case of failure.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "item_tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of items with taxes",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "items",
+ "type": "[LineItem](../classes/LineItem.mdx)[]",
+ "description": "The line items added to the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "metadata",
+ "type": "`Record`",
+ "description": "An optional key-value map with additional details",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "object",
+ "type": "`\"cart\"`",
+ "description": "",
+ "optional": false,
+ "defaultValue": "\"cart\"",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "payment",
+ "type": "[Payment](../classes/Payment.mdx)",
+ "description": "The details of the payment associated with the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "payment_authorized_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the payment was authorized.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "payment_id",
+ "type": "`string`",
+ "description": "The payment's ID if available",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "payment_session",
+ "type": "`null` \\| [PaymentSession](../classes/PaymentSession.mdx)",
+ "description": "The details of the selected payment session in the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "payment_sessions",
+ "type": "[PaymentSession](../classes/PaymentSession.mdx)[]",
+ "description": "The details of all payment sessions created on the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "raw_discount_total",
+ "type": "`number`",
+ "description": "The total of discount",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refundable_amount",
+ "type": "`number`",
+ "description": "The amount that can be refunded",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refunded_total",
+ "type": "`number`",
+ "description": "The total amount refunded if the order associated with this cart is returned.",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "region",
+ "type": "[Region](../classes/Region.mdx)",
+ "description": "The details of the region associated with the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "region_id",
+ "type": "`string`",
+ "description": "The region's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "sales_channel",
+ "type": "[SalesChannel](../classes/SalesChannel.mdx)",
+ "description": "The details of the sales channel associated with the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "sales_channel_id",
+ "type": "`null` \\| `string`",
+ "description": "The sales channel ID the cart is associated with.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_address",
+ "type": "`null` \\| [Address](../classes/Address.mdx)",
+ "description": "The details of the shipping address associated with the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "shipping_address_id",
+ "type": "`string`",
+ "description": "The shipping address's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_methods",
+ "type": "[ShippingMethod](../classes/ShippingMethod.mdx)[]",
+ "description": "The details of the shipping methods added to the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "shipping_tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of shipping with taxes",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_total",
+ "type": "`number`",
+ "description": "The total of shipping",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "subtotal",
+ "type": "`number`",
+ "description": "The subtotal of the cart",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of tax",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "total",
+ "type": "`number`",
+ "description": "The total amount of the cart",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "type",
+ "type": "[CartType](../enums/CartType.mdx)",
+ "description": "The cart's type.",
+ "optional": false,
+ "defaultValue": "default",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "updated_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was updated.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ }
+]} />
+
+#### Returns
+
+
+
+___
+
+### canCalculate
+
+This method is used to determine whether a shipping option is calculated dynamically or flat rate. It is called if the `price_type` of the shipping option being created is set to calculated.
+
+#### Example
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // ...
+ async canCalculate(
+ data: Record
+ ): Promise {
+ return data.id === "my-fulfillment-dynamic"
+ }
+}
+```
+
+#### Parameters
+
+
+
+#### Returns
+
+
+
+___
+
+### cancelFulfillment
+
+This method is called when a fulfillment is cancelled by the admin. This fulfillment can be for an order, a claim, or a swap.
+
+#### Example
+
+This is the basic implementation of the method for a fulfillment provider that doesn't interact with a third-party provider to cancel the fulfillment:
+
+```ts
+class MyFulfillmentService extends FulfillmentService {
+ // ...
+ async cancelFulfillment(
+ fulfillment: Record
+ ): Promise {
+ return {}
+ }
+}
+```
+
+#### Parameters
+
+
+
+#### Returns
+
+
+
+___
+
+### createFulfillment
+
+This method is used when a fulfillment is created for an order, a claim, or a swap.
+
+#### Example
+
+Here is a basic implementation of `createFulfillment` for a fulfillment provider that does not interact with any third-party provider to create the fulfillment:
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // ...
+ async createFulfillment(
+ data: Record,
+ items: LineItem,
+ order: Order,
+ fulfillment: Fulfillment
+ ) {
+ // No data is being sent anywhere
+ // No data to be stored in the fulfillment's data object
+ return {}
+ }
+}
+```
+
+#### Parameters
+
+`",
+ "description": "An optional key-value map with additional details",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "order",
+ "type": "[Order](../classes/Order.mdx)",
+ "description": "The details of the order that the line item may belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "order_edit",
+ "type": "`null` \\| [OrderEdit](../classes/OrderEdit.mdx)",
+ "description": "The details of the order edit.",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "order_edit_id",
+ "type": "`null` \\| `string`",
+ "description": "The ID of the order edit that the item may belong to.",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "order_id",
+ "type": "`null` \\| `string`",
+ "description": "The ID of the order that the line item may belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "original_item_id",
+ "type": "`null` \\| `string`",
+ "description": "The ID of the original line item. This is useful if the line item belongs to a resource that references an order, such as a return or an order edit.",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "original_tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The original tax total amount of the line item",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "original_total",
+ "type": "`null` \\| `number`",
+ "description": "The original total amount of the line item",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "product_id",
+ "type": "`null` \\| `string`",
+ "description": "",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "quantity",
+ "type": "`number`",
+ "description": "The quantity of the content in the Line Item.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "raw_discount_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of discount of the line item",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refundable",
+ "type": "`null` \\| `number`",
+ "description": "The amount that can be refunded from the given Line Item. Takes taxes and discounts into consideration.",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "returned_quantity",
+ "type": "`null` \\| `number`",
+ "description": "The quantity of the Line Item that has been returned.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipped_quantity",
+ "type": "`null` \\| `number`",
+ "description": "The quantity of the Line Item that has been shipped.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "should_merge",
+ "type": "`boolean`",
+ "description": "Flag to indicate if new Line Items with the same variant should be merged or added as an additional Line Item.",
+ "optional": false,
+ "defaultValue": "true",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "subtotal",
+ "type": "`null` \\| `number`",
+ "description": "The subtotal of the line item",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "swap",
+ "type": "[Swap](../classes/Swap.mdx)",
+ "description": "The details of the swap that the line item may belong to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "swap_id",
+ "type": "`string`",
+ "description": "The ID of the swap that the line item may belong to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "tax_lines",
+ "type": "[LineItemTaxLine](../classes/LineItemTaxLine.mdx)[]",
+ "description": "The details of the item's tax lines.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of tax of the line item",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "thumbnail",
+ "type": "`null` \\| `string`",
+ "description": "A URL string to a small image of the contents of the Line Item.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "title",
+ "type": "`string`",
+ "description": "The title of the Line Item.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "total",
+ "type": "`null` \\| `number`",
+ "description": "The total amount of the line item",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "unit_price",
+ "type": "`number`",
+ "description": "The price of one unit of the content in the Line Item. This should be in the currency defined by the Cart/Order/Swap/Claim that the Line Item belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "updated_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was updated.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "variant",
+ "type": "[ProductVariant](../classes/ProductVariant.mdx)",
+ "description": "The details of the product variant that this item was created from.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "variant_id",
+ "type": "`null` \\| `string`",
+ "description": "The id of the Product Variant contained in the Line Item.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ },
+ {
+ "name": "order",
+ "type": "[Order](../classes/Order.mdx)",
+ "description": "The details of the created resource, which is either an order, a claim, or a swap:\n- If the resource the fulfillment is being created for is a claim, the `is_claim` property in the object will be `true`.\n- If the resource the fulfillment is being created for is a swap, the `is_swap` property in the object will be `true`.\n- Otherwise, the resource is an order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": [
+ {
+ "name": "billing_address",
+ "type": "[Address](../classes/Address.mdx)",
+ "description": "The details of the billing address associated with the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "billing_address_id",
+ "type": "`string`",
+ "description": "The ID of the billing address associated with the order",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "canceled_at",
+ "type": "`Date`",
+ "description": "The date the order was canceled on.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "cart",
+ "type": "[Cart](../classes/Cart.mdx)",
+ "description": "The details of the cart associated with the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "cart_id",
+ "type": "`string`",
+ "description": "The ID of the cart associated with the order",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "claims",
+ "type": "[ClaimOrder](../classes/ClaimOrder.mdx)[]",
+ "description": "The details of the claims created for the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "created_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was created.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "currency",
+ "type": "[Currency](../classes/Currency.mdx)",
+ "description": "The details of the currency used in the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "currency_code",
+ "type": "`string`",
+ "description": "The 3 character currency code that is used in the order",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "customer",
+ "type": "[Customer](../classes/Customer.mdx)",
+ "description": "The details of the customer associated with the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "customer_id",
+ "type": "`string`",
+ "description": "The ID of the customer associated with the order",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "discount_total",
+ "type": "`number`",
+ "description": "The total of discount rounded",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "discounts",
+ "type": "[Discount](../classes/Discount.mdx)[]",
+ "description": "The details of the discounts applied on the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "display_id",
+ "type": "`number`",
+ "description": "The order's display ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "draft_order",
+ "type": "[DraftOrder](../classes/DraftOrder.mdx)",
+ "description": "The details of the draft order this order was created from.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "draft_order_id",
+ "type": "`string`",
+ "description": "The ID of the draft order this order was created from.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "edits",
+ "type": "[OrderEdit](../classes/OrderEdit.mdx)[]",
+ "description": "The details of the order edits done on the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "email",
+ "type": "`string`",
+ "description": "The email associated with the order",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "external_id",
+ "type": "`null` \\| `string`",
+ "description": "The ID of an external order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "fulfillment_status",
+ "type": "[FulfillmentStatus](../enums/FulfillmentStatus.mdx)",
+ "description": "The order's fulfillment status",
+ "optional": false,
+ "defaultValue": "not_fulfilled",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "fulfillments",
+ "type": "[Fulfillment](../classes/Fulfillment.mdx)[]",
+ "description": "The details of the fulfillments created for the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "gift_card_tax_total",
+ "type": "`number`",
+ "description": "The total of gift cards with taxes",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "gift_card_total",
+ "type": "`number`",
+ "description": "The total of gift cards",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "gift_card_transactions",
+ "type": "[GiftCardTransaction](../classes/GiftCardTransaction.mdx)[]",
+ "description": "The gift card transactions made in the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "gift_cards",
+ "type": "[GiftCard](../classes/GiftCard.mdx)[]",
+ "description": "The details of the gift card used in the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "id",
+ "type": "`string`",
+ "description": "The order's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "idempotency_key",
+ "type": "`string`",
+ "description": "Randomly generated key used to continue the processing of the order in case of failure.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "item_tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The tax total applied on items",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "items",
+ "type": "[LineItem](../classes/LineItem.mdx)[]",
+ "description": "The details of the line items that belong to the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "metadata",
+ "type": "`Record`",
+ "description": "An optional key-value map with additional details",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "no_notification",
+ "type": "`boolean`",
+ "description": "Flag for describing whether or not notifications related to this should be send.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "object",
+ "type": "`\"order\"`",
+ "description": "",
+ "optional": false,
+ "defaultValue": "\"order\"",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "paid_total",
+ "type": "`number`",
+ "description": "The total amount paid",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "payment_status",
+ "type": "[PaymentStatus](../enums/PaymentStatus.mdx)",
+ "description": "The order's payment status",
+ "optional": false,
+ "defaultValue": "not_paid",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "payments",
+ "type": "[Payment](../classes/Payment.mdx)[]",
+ "description": "The details of the payments used in the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "raw_discount_total",
+ "type": "`number`",
+ "description": "The total of discount",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refundable_amount",
+ "type": "`number`",
+ "description": "The amount that can be refunded",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refunded_total",
+ "type": "`number`",
+ "description": "The total amount refunded if the order is returned.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refunds",
+ "type": "[Refund](../classes/Refund.mdx)[]",
+ "description": "The details of the refunds created for the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "region",
+ "type": "[Region](../classes/Region.mdx)",
+ "description": "The details of the region this order was created in.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "region_id",
+ "type": "`string`",
+ "description": "The ID of the region this order was created in.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "returnable_items",
+ "type": "[LineItem](../classes/LineItem.mdx)[]",
+ "description": "The details of the line items that are returnable as part of the order, swaps, or claims",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "returns",
+ "type": "[Return](../classes/Return.mdx)[]",
+ "description": "The details of the returns created for the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "sales_channel",
+ "type": "[SalesChannel](../classes/SalesChannel.mdx)",
+ "description": "The details of the sales channel this order belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "sales_channel_id",
+ "type": "`null` \\| `string`",
+ "description": "The ID of the sales channel this order belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_address",
+ "type": "[Address](../classes/Address.mdx)",
+ "description": "The details of the shipping address associated with the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "shipping_address_id",
+ "type": "`string`",
+ "description": "The ID of the shipping address associated with the order",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_methods",
+ "type": "[ShippingMethod](../classes/ShippingMethod.mdx)[]",
+ "description": "The details of the shipping methods used in the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "shipping_tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The tax total applied on shipping",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_total",
+ "type": "`number`",
+ "description": "The total of shipping",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "status",
+ "type": "[OrderStatus](../enums/OrderStatus.mdx)",
+ "description": "The order's status",
+ "optional": false,
+ "defaultValue": "pending",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "subtotal",
+ "type": "`number`",
+ "description": "The subtotal of the order",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "swaps",
+ "type": "[Swap](../classes/Swap.mdx)[]",
+ "description": "The details of the swaps created for the order.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "tax_rate",
+ "type": "`null` \\| `number`",
+ "description": "The order's tax rate",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of tax",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "total",
+ "type": "`number`",
+ "description": "The total amount of the order",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "updated_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was updated.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ },
+ {
+ "name": "fulfillment",
+ "type": "[Fulfillment](../classes/Fulfillment.mdx)",
+ "description": "The fulfillment being created.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": [
+ {
+ "name": "canceled_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the Fulfillment was canceled.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "claim_order",
+ "type": "[ClaimOrder](../classes/ClaimOrder.mdx)",
+ "description": "The details of the claim that the fulfillment may belong to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "claim_order_id",
+ "type": "`string`",
+ "description": "The ID of the Claim that the Fulfillment belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "created_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was created.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "data",
+ "type": "`Record`",
+ "description": "This contains all the data necessary for the Fulfillment provider to handle the fulfillment.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "id",
+ "type": "`string`",
+ "description": "The fulfillment's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "idempotency_key",
+ "type": "`string`",
+ "description": "Randomly generated key used to continue the completion of the fulfillment in case of failure.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "items",
+ "type": "[FulfillmentItem](../classes/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": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "location_id",
+ "type": "`null` \\| `string`",
+ "description": "The ID of the stock location the fulfillment will be shipped from",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "metadata",
+ "type": "`Record`",
+ "description": "An optional key-value map with additional details",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "no_notification",
+ "type": "`boolean`",
+ "description": "Flag for describing whether or not notifications related to this should be sent.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "order",
+ "type": "[Order](../classes/Order.mdx)",
+ "description": "The details of the order that the fulfillment may belong to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "order_id",
+ "type": "`string`",
+ "description": "The ID of the Order that the Fulfillment belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "provider",
+ "type": "[FulfillmentProvider](../classes/FulfillmentProvider.mdx)",
+ "description": "The details of the fulfillment provider responsible for handling the fulfillment.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "provider_id",
+ "type": "`string`",
+ "description": "The ID of the Fulfillment Provider responsible for handling the fulfillment.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipped_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the Fulfillment was shipped.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "swap",
+ "type": "[Swap](../classes/Swap.mdx)",
+ "description": "The details of the swap that the fulfillment may belong to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "swap_id",
+ "type": "`string`",
+ "description": "The ID of the Swap that the Fulfillment belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "tracking_links",
+ "type": "[TrackingLink](../classes/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": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "tracking_numbers",
+ "type": "`string`[]",
+ "description": "The tracking numbers that can be used to track the status of the fulfillment.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "updated_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was updated.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ }
+]} />
+
+#### Returns
+
+`",
+ "description": "",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ }
+]} />
+
+___
+
+### createReturn
+
+Fulfillment providers can also be used to return products. A shipping option can be used for returns if the `is_return` property is true or if an admin creates a Return Shipping Option from the settings.
+This method is used when the admin [creates a return request](https://docs.medusajs.com/api/admin#orders\_postordersorderreturns) for an order,
+[creates a swap](https://docs.medusajs.com/api/admin#orders\_postordersorderswaps) for an order, or when the
+[customer creates a return of their order](https://docs.medusajs.com/api/store#returns\_postreturns). The fulfillment is created automatically for the order return.
+
+#### Example
+
+This is the basic implementation of the method for a fulfillment provider that does not contact with a third-party provider to fulfill the return:
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // ...
+ async createReturn(
+ returnOrder: CreateReturnType
+ ): Promise> {
+ return {}
+ }
+}
+```
+
+#### Parameters
+
+`",
+ "description": "An optional key-value map with additional details",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "no_notification",
+ "type": "`null` \\| `boolean`",
+ "description": "When set to true, no notification will be sent related to this return.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "order",
+ "type": "[Order](../classes/Order.mdx)",
+ "description": "The details of the order that the return was created for.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "order_id",
+ "type": "`null` \\| `string`",
+ "description": "The ID of the order that the return was created for.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "received_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the return was received.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refund_amount",
+ "type": "`number`",
+ "description": "The amount that should be refunded as a result of the return.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_data",
+ "type": "`Record`",
+ "description": "Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_method",
+ "type": "[ShippingMethod](../classes/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": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "status",
+ "type": "[ReturnStatus](../enums/ReturnStatus.mdx)",
+ "description": "Status of the Return.",
+ "optional": false,
+ "defaultValue": "requested",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "swap",
+ "type": "[Swap](../classes/Swap.mdx)",
+ "description": "The details of the swap that the return may belong to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "swap_id",
+ "type": "`null` \\| `string`",
+ "description": "The ID of the swap that the return may belong to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "updated_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was updated.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ }
+]} />
+
+#### Returns
+
+`",
+ "optional": false,
+ "defaultValue": "",
+ "description": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ }
+]} />
+
+___
+
+### getFulfillmentDocuments
+
+This method is used to retrieve any documents associated with a fulfillment. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
+
+#### Example
+
+```ts
+class MyFulfillmentService extends FulfillmentService {
+ // ...
+ async getFulfillmentDocuments(
+ data: Record
+ ): Promise {
+ // assuming you contact a client to
+ // retrieve the document
+ return this.client.getFulfillmentDocuments()
+ }
+}
+```
+
+#### Parameters
+
+
+
+#### Returns
+
+
+
+___
+
+### getFulfillmentOptions
+
+This method is used when retrieving the list of fulfillment options available in a region, particularly by the [List Fulfillment Options API Route](https://docs.medusajs.com/api/admin#regions\_getregionsregionfulfillmentoptions).
+For example, if you’re integrating UPS as a fulfillment provider, you might support two fulfillment options: UPS Express Shipping and UPS Access Point. Each of these options can have different data associated with them.
+
+#### Example
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // ...
+ async getFulfillmentOptions(): Promise {
+ return [
+ {
+ id: "my-fulfillment",
+ },
+ {
+ id: "my-fulfillment-dynamic",
+ },
+ ]
+ }
+}
+```
+
+#### Returns
+
+
+
+___
+
+### getReturnDocuments
+
+This method is used to retrieve any documents associated with a return. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
+
+#### Example
+
+```ts
+class MyFulfillmentService extends FulfillmentService {
+ // ...
+ async getReturnDocuments(
+ data: Record
+ ): Promise {
+ // assuming you contact a client to
+ // retrieve the document
+ return this.client.getReturnDocuments()
+ }
+}
+```
+
+#### Parameters
+
+`",
+ "description": "The data attribute of the return that you're retrieving the documents for.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+]} />
+
+#### Returns
+
+
+
+___
+
+### getShipmentDocuments
+
+This method is used to retrieve any documents associated with a shipment. This method isn't used by default in the backend, but you can use it for custom use cases such as allowing admins to download these documents.
+
+#### Example
+
+```ts
+class MyFulfillmentService extends FulfillmentService {
+ // ...
+ async getShipmentDocuments(
+ data: Record
+ ): Promise {
+ // assuming you contact a client to
+ // retrieve the document
+ return this.client.getShipmentDocuments()
+ }
+}
+```
+
+#### Parameters
+
+`",
+ "description": "The `data` attribute of the shipment that you're retrieving the documents for.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+]} />
+
+#### Returns
+
+
+
+___
+
+### retrieveDocuments
+
+This method is used to retrieve any documents associated with an order and its fulfillments. This method isn't used by default in the backend, but you can use it for
+custom use cases such as allowing admins to download these documents.
+
+#### Example
+
+```ts
+class MyFulfillmentService extends FulfillmentService {
+ // ...
+ async retrieveDocuments(
+ fulfillmentData: Record,
+ documentType: "invoice" | "label"
+ ): Promise {
+ // assuming you contact a client to
+ // retrieve the document
+ return this.client.getDocuments()
+ }
+}
+```
+
+#### Parameters
+
+
+
+#### Returns
+
+
+
+___
+
+### validateFulfillmentData
+
+This method is called when a shipping method is created. This typically happens when the customer chooses a shipping option during checkout, when a shipping method is created
+for an order return, or in other similar cases. The shipping option and its data are validated before the shipping method is created.
+
+You can use the provided parameters to validate the chosen shipping option. For example, you can check if the `data` object passed as a second parameter includes all data needed to
+fulfill the shipment later on.
+
+If any of the data is invalid, you can throw an error. This error will stop Medusa from creating a shipping method and the error message will be returned as a result of the API Route.
+
+#### Example
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // ...
+ async validateFulfillmentData(
+ optionData: Record,
+ data: Record,
+ cart: Cart
+ ): Promise> {
+ if (data.id !== "my-fulfillment") {
+ throw new Error("invalid data")
+ }
+
+ return {
+ ...data,
+ }
+ }
+}
+```
+
+#### Parameters
+
+`",
+ "description": "The context of the cart which can include info like IP or user agent.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "created_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was created.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "customer",
+ "type": "[Customer](../classes/Customer.mdx)",
+ "description": "The details of the customer the cart belongs to.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "customer_id",
+ "type": "`string`",
+ "description": "The customer's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "deleted_at",
+ "type": "`null` \\| `Date`",
+ "description": "The date with timezone at which the resource was deleted.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "discount_total",
+ "type": "`number`",
+ "description": "The total of discount rounded",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "discounts",
+ "type": "[Discount](../classes/Discount.mdx)[]",
+ "description": "An array of details of all discounts applied to the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "email",
+ "type": "`string`",
+ "description": "The email associated with the cart",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "gift_card_tax_total",
+ "type": "`number`",
+ "description": "The total of gift cards with taxes",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "gift_card_total",
+ "type": "`number`",
+ "description": "The total of gift cards",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "gift_cards",
+ "type": "[GiftCard](../classes/GiftCard.mdx)[]",
+ "description": "An array of details of all gift cards applied to the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "id",
+ "type": "`string`",
+ "description": "The cart's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "idempotency_key",
+ "type": "`string`",
+ "description": "Randomly generated key used to continue the completion of a cart in case of failure.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "item_tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of items with taxes",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "items",
+ "type": "[LineItem](../classes/LineItem.mdx)[]",
+ "description": "The line items added to the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "metadata",
+ "type": "`Record`",
+ "description": "An optional key-value map with additional details",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "object",
+ "type": "`\"cart\"`",
+ "description": "",
+ "optional": false,
+ "defaultValue": "\"cart\"",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "payment",
+ "type": "[Payment](../classes/Payment.mdx)",
+ "description": "The details of the payment associated with the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "payment_authorized_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the payment was authorized.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "payment_id",
+ "type": "`string`",
+ "description": "The payment's ID if available",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "payment_session",
+ "type": "`null` \\| [PaymentSession](../classes/PaymentSession.mdx)",
+ "description": "The details of the selected payment session in the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "payment_sessions",
+ "type": "[PaymentSession](../classes/PaymentSession.mdx)[]",
+ "description": "The details of all payment sessions created on the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "raw_discount_total",
+ "type": "`number`",
+ "description": "The total of discount",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refundable_amount",
+ "type": "`number`",
+ "description": "The amount that can be refunded",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "refunded_total",
+ "type": "`number`",
+ "description": "The total amount refunded if the order associated with this cart is returned.",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "region",
+ "type": "[Region](../classes/Region.mdx)",
+ "description": "The details of the region associated with the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "region_id",
+ "type": "`string`",
+ "description": "The region's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "sales_channel",
+ "type": "[SalesChannel](../classes/SalesChannel.mdx)",
+ "description": "The details of the sales channel associated with the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "sales_channel_id",
+ "type": "`null` \\| `string`",
+ "description": "The sales channel ID the cart is associated with.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_address",
+ "type": "`null` \\| [Address](../classes/Address.mdx)",
+ "description": "The details of the shipping address associated with the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "shipping_address_id",
+ "type": "`string`",
+ "description": "The shipping address's ID",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_methods",
+ "type": "[ShippingMethod](../classes/ShippingMethod.mdx)[]",
+ "description": "The details of the shipping methods added to the cart.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": true,
+ "children": []
+ },
+ {
+ "name": "shipping_tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of shipping with taxes",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "shipping_total",
+ "type": "`number`",
+ "description": "The total of shipping",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "subtotal",
+ "type": "`number`",
+ "description": "The subtotal of the cart",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "tax_total",
+ "type": "`null` \\| `number`",
+ "description": "The total of tax",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "total",
+ "type": "`number`",
+ "description": "The total amount of the cart",
+ "optional": true,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "type",
+ "type": "[CartType](../enums/CartType.mdx)",
+ "description": "The cart's type.",
+ "optional": false,
+ "defaultValue": "default",
+ "expandable": false,
+ "children": []
+ },
+ {
+ "name": "updated_at",
+ "type": "`Date`",
+ "description": "The date with timezone at which the resource was updated.",
+ "optional": false,
+ "defaultValue": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ }
+]} />
+
+#### Returns
+
+`",
+ "optional": false,
+ "defaultValue": "",
+ "description": "",
+ "expandable": false,
+ "children": []
+ }
+ ]
+ }
+]} />
+
+___
+
+### validateOption
+
+Once the admin creates the shipping option, the data of the shipping option will be validated first using this method. This method is called when the [Create Shipping Option API Route](https://docs.medusajs.com/api/admin#shipping-options\_postshippingoptions) is used.
+
+#### Example
+
+For example, you can use this method to ensure that the `id` in the `data` object is correct:
+
+```ts
+class MyFulfillmentService extends AbstractFulfillmentService {
+ // ...
+ async validateOption(
+ data: Record
+ ): Promise {
+ return data.id == "my-fulfillment"
+ }
+}
+```
+
+#### Parameters
+
+
+
+#### Returns
+
+
diff --git a/www/apps/docs/content/references/fulfillment/types/CreateReturnType.mdx b/www/apps/docs/content/references/fulfillment/types/CreateReturnType.mdx
new file mode 100644
index 0000000000..57bc5120b3
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/types/CreateReturnType.mdx
@@ -0,0 +1,9 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# CreateReturnType
+
+ **CreateReturnType**: [Omit](Omit.mdx)<[Return](../classes/Return.mdx), "beforeInsert">
diff --git a/www/apps/docs/content/references/fulfillment/types/Exclude.mdx b/www/apps/docs/content/references/fulfillment/types/Exclude.mdx
new file mode 100644
index 0000000000..645f1c362a
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/types/Exclude.mdx
@@ -0,0 +1,34 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Exclude
+
+ **Exclude**: `T` extends `U` ? `never` : `T`
+
+Exclude from T those types that are assignable to U
+
+## Type Parameters
+
+
diff --git a/www/apps/docs/content/references/fulfillment/types/FulfillmentProviderData.mdx b/www/apps/docs/content/references/fulfillment/types/FulfillmentProviderData.mdx
new file mode 100644
index 0000000000..131b873239
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/types/FulfillmentProviderData.mdx
@@ -0,0 +1,9 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# FulfillmentProviderData
+
+ **FulfillmentProviderData**: `Record`
diff --git a/www/apps/docs/content/references/fulfillment/types/MedusaContainer.mdx b/www/apps/docs/content/references/fulfillment/types/MedusaContainer.mdx
new file mode 100644
index 0000000000..d4f449a4b0
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/types/MedusaContainer.mdx
@@ -0,0 +1,9 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# MedusaContainer
+
+ **MedusaContainer**: `AwilixContainer` & ``{ createScope: () => [MedusaContainer](MedusaContainer.mdx) ; registerAdd: <T>(name: string, registration: T) => [MedusaContainer](MedusaContainer.mdx) }``
diff --git a/www/apps/docs/content/references/fulfillment/types/Omit.mdx b/www/apps/docs/content/references/fulfillment/types/Omit.mdx
new file mode 100644
index 0000000000..04136e4dd6
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/types/Omit.mdx
@@ -0,0 +1,34 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Omit
+
+ **Omit**: [Pick](Pick.mdx)<T, [Exclude](Exclude.mdx)<keyof T, K>>
+
+Construct a type with the properties of T except for those in type K.
+
+## Type Parameters
+
+
diff --git a/www/apps/docs/content/references/fulfillment/types/Pick.mdx b/www/apps/docs/content/references/fulfillment/types/Pick.mdx
new file mode 100644
index 0000000000..92950bfb39
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/types/Pick.mdx
@@ -0,0 +1,34 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Pick
+
+ **Pick**: { [P in K]: T[P] }
+
+From T, pick a set of properties whose keys are in the union K
+
+## Type Parameters
+
+
diff --git a/www/apps/docs/content/references/fulfillment/types/Record.mdx b/www/apps/docs/content/references/fulfillment/types/Record.mdx
new file mode 100644
index 0000000000..5a0cb4a1c0
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/types/Record.mdx
@@ -0,0 +1,34 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# Record
+
+ **Record**: { [P in K]: T }
+
+Construct a type with a set of properties K of type T
+
+## Type Parameters
+
+
diff --git a/www/apps/docs/content/references/fulfillment/types/ShippingMethodData.mdx b/www/apps/docs/content/references/fulfillment/types/ShippingMethodData.mdx
new file mode 100644
index 0000000000..2cca286019
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/types/ShippingMethodData.mdx
@@ -0,0 +1,9 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ShippingMethodData
+
+ **ShippingMethodData**: `Record`
diff --git a/www/apps/docs/content/references/fulfillment/types/ShippingOptionData.mdx b/www/apps/docs/content/references/fulfillment/types/ShippingOptionData.mdx
new file mode 100644
index 0000000000..8c63d4a052
--- /dev/null
+++ b/www/apps/docs/content/references/fulfillment/types/ShippingOptionData.mdx
@@ -0,0 +1,9 @@
+---
+displayed_sidebar: modules
+---
+
+import ParameterTypes from "@site/src/components/ParameterTypes"
+
+# ShippingOptionData
+
+ **ShippingOptionData**: `Record`
diff --git a/www/apps/docs/content/references/inventory/types/Exclude.mdx b/www/apps/docs/content/references/inventory/types/Exclude.mdx
index 58d9fcaa13..60cb8df21b 100644
--- a/www/apps/docs/content/references/inventory/types/Exclude.mdx
+++ b/www/apps/docs/content/references/inventory/types/Exclude.mdx
@@ -10,7 +10,7 @@ import ParameterTypes from "@site/src/components/ParameterTypes"
Exclude from T those types that are assignable to U
-#### Type Parameters
+## Type Parameters
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-#### Type declaration
+## Type declaration
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-#### Type declaration
+## Type declaration
(eventName, data, options?): Promise<void>`
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
(data): Promise<void>`
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-#### Type declaration
+## Type declaration
-#### Type declaration
+## Type declaration
-##### Parameters
+### Parameters
-##### Returns
+### Returns
-#### Type declaration
+## Type declaration
-##### Parameters
+### Parameters
-##### Returns
+### Returns
{
+ strictEqual(executionAsyncId(), ee1.asyncId);
+ strictEqual(triggerAsyncId(), ee1.triggerAsyncId);
+});
-#### Since
+const ee2 = new EventEmitter();
+
+// 'foo' listeners on ordinary EventEmitters that do not track async
+// context, however, run in the same async context as the emit().
+ee2.on('foo', () => {
+ notStrictEqual(executionAsyncId(), ee2.asyncId);
+ notStrictEqual(triggerAsyncId(), ee2.triggerAsyncId);
+});
+
+Promise.resolve().then(() => {
+ ee1.emit('foo');
+ ee2.emit('foo');
+});
+```
+
+The `EventEmitterAsyncResource` class has the same methods and takes the
+same options as `EventEmitter` and `AsyncResource` themselves.
+
+## Since
v17.4.0, v16.14.0
@@ -27,7 +52,7 @@ v17.4.0, v16.14.0
{
"name": "asyncId",
"type": "`number`",
- "description": "The unique asyncId assigned to the resource.",
+ "description": "The unique `asyncId` assigned to the resource.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -36,7 +61,7 @@ v17.4.0, v16.14.0
{
"name": "asyncResource",
"type": "[EventEmitterReferencingAsyncResource](../interfaces/internal.EventEmitter.EventEmitterReferencingAsyncResource.mdx)",
- "description": "The underlying AsyncResource",
+ "description": "The returned `AsyncResource` object has an additional `eventEmitter` property that provides a reference to this `EventEmitterAsyncResource`.",
"optional": false,
"defaultValue": "",
"expandable": false,
@@ -89,11 +114,13 @@ v17.4.0, v16.14.0
}
]} />
+___
+
## Methods
-#### [captureRejectionSymbol]
+### [captureRejectionSymbol]
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
{
Returns a reference to the `EventEmitter`, so that calls can be chained.
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
{
Returns a reference to the `EventEmitter`, so that calls can be chained.
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
ac.abort());
```
-##### Parameters
+#### Parameters
ac.abort());
}
]} />
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
+___
+
## Methods
-#### asyncId
+### asyncId
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-#### Type declaration
+## Type declaration
-##### Parameters
+### Parameters
-#### Type declaration
+## Type declaration
-##### Returns
+### Returns
-##### Returns
+### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
+___
+
## Methods
-#### addDocuments
+### addDocuments
Used to index documents by the search engine provider
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### updateAddress
+### updateAddress
Update an address of the logged-in customer.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -577,7 +577,7 @@ medusa.customers.addresses
})
```
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### getToken
+### getToken
Authenticate the user and retrieve a JWT token to use for subsequent authenticated requests.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -424,7 +424,7 @@ medusa.admin.auth
})
```
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### confirm
+### confirm
When a batch job is created, it's not executed automatically if `dry_run` is set to `true`. This method confirms that the batch job should be executed.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -262,7 +262,7 @@ medusa.admin.batchJobs.confirm(batchJobId).then(({ batch_job }) => {
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### create
+### create
Create a Batch Job to be executed asynchronously in the Medusa backend. If `dry_run` is set to `true`, the batch job will not be executed until the it is confirmed,
which can be done using the [confirm](AdminBatchJobsResource.mdx#confirm) method.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -495,7 +495,7 @@ medusa.admin.batchJobs.create({
})
```
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### update
+### update
Update a product collection's details.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -1117,7 +1117,7 @@ medusa.admin.collections
})
```
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### get
+### get
Send a `GET` request to a custom API Route. The method accepts a tuple of type parameters: the first `TQuery` is the type of accepted query parameters,
which defaults to `Record`; the second `TResponse` is the type of response, which defaults to `any`.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -126,7 +126,7 @@ medusa.admin.custom.get, PostsResponse>(
})
```
-##### Parameters
+#### Parameters
, PostsResponse>(
}
]} />
-##### Returns
+#### Returns
, PostsResponse>(
___
-#### post
+### post
Send a `POST` request to a custom API Route. The method accepts a tuple of type parameters: the first `TPayload` is the type of accepted body parameters,
which defaults to `Record`; the second `TResponse` is the type of response, which defaults to `any`.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -240,7 +240,7 @@ medusa.admin.custom.post(
})
```
-##### Parameters
+#### Parameters
(
}
]} />
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### update
+### update
Update a customer's details.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -845,7 +845,7 @@ medusa.admin.customers
})
```
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### create
+### create
Create a discount with a given set of rules that defines how the discount is applied.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -625,7 +625,7 @@ medusa.admin.discounts
})
```
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### deleteCondition
+### deleteCondition
Delete a discount condition. This doesn't delete resources associated to the discount condition.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -1844,7 +1844,7 @@ medusa.admin.discounts
})
```
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### retrieveByCode
+### retrieveByCode
Retrieve a discount's details by its discount code.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -3641,7 +3641,7 @@ medusa.admin.discounts.retrieveByCode(code).then(({ discount }) => {
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### update
+### update
Update a discount with a given set of rules that define how the discount is applied.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -3882,7 +3882,7 @@ medusa.admin.discounts
})
```
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### removeLineItem
+### removeLineItem
Delete a Line Item from a Draft Order.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -1635,7 +1635,7 @@ medusa.admin.draftOrders
})
```
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### update
+### update
Update a Draft Order's details.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -2050,7 +2050,7 @@ medusa.admin.draftOrders
})
```
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### list
+### list
Retrieve a list of gift cards. The gift cards can be filtered by fields such as `q` passed in the `query` parameter. The gift cards can also paginated.
-##### Example
+#### Example
To list gift cards:
@@ -394,7 +394,7 @@ medusa.admin.giftCards
})
```
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### update
+### update
Update a gift card's details.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -873,7 +873,7 @@ medusa.admin.giftCards
})
```
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### list
+### list
Retrieve a list of invites.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -311,7 +311,7 @@ medusa.admin.invites.list().then(({ invites }) => {
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### resend
+### resend
Resend an invite. This renews the expiry date by seven days and generates a new token for the invite. It also triggers the `invite.created` event,
so if you have a Notification Provider installed that handles this event, a notification should be sent to the email associated with the
invite to allow them to accept the invite.
-##### Example
+#### Example
```ts
import Medusa from "@medusajs/medusa-js"
@@ -474,7 +474,7 @@ medusa.admin.invites
})
```
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns
{
___
-#### list
+### list
Retrieve a list of notes. The notes can be filtered by fields such as `resource_id` passed in the `query` parameter. The notes can also be paginated.
-##### Example
+#### Example
To list notes:
@@ -330,7 +330,7 @@ medusa.admin.notes
})
```
-##### Parameters
+#### Parameters
-##### Returns
+#### Returns
{
})
```
-##### Parameters
+#### Parameters
{
}
]} />
-##### Returns
+#### Returns