docs: regenerate core-flows reference + OAS for draft order updates (#12280)
* docs: regenerate core-flows reference for updates in draft orders * generate OAS
This commit is contained in:
1 parent
71a5dc448d
commit
4946b67152
67 files changed
+184591
-175292
No files matched your search
+17
-10
@@ -11,19 +11,26 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `validateDraftOrderStep`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
```ts title="src/workflows/my-workflow.ts"
|
||||
import { createWorkflow } from "@medusajs/framework/workflows-sdk"
|
||||
import { validateDraftOrderStep } from "@medusajs/medusa/core-flows"
|
||||
This step validates that an order is a draft order. It throws an error otherwise.
|
||||
|
||||
const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = validateDraftOrderStep("{value}")
|
||||
:::note
|
||||
|
||||
You can retrieve a draft order's details using [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query),
|
||||
or [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-workflows/steps/useQueryGraphStep).
|
||||
|
||||
:::
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
const data = validateDraftOrderStep({
|
||||
order: {
|
||||
id: "order_123",
|
||||
// other order details...
|
||||
}
|
||||
)
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"ValidateDraftOrderStepInput","type":"`ValidateDraftOrderStepInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validateDraftOrderStep"/>
|
||||
<TypeList types={[{"name":"ValidateDraftOrderStepInput","type":"[ValidateDraftOrderStepInput](../../../../interfaces/core_flows.ValidateDraftOrderStepInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the draft order to validate.","expandable":false,"children":[{"name":"order","type":"[OrderDTO](../../../../../fulfillment/interfaces/fulfillment.OrderDTO/page.mdx)","description":"The draft order to validate.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"The order's display ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderStatus](../../../../../fulfillment/types/fulfillment.OrderStatus/page.mdx)","description":"The status of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","Line truncated
|
||||
+24
-14
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/addDraftOrderItemsWorkflow
|
||||
sidebar_label: addDraftOrderItemsWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Add items to a draft order.
|
||||
tags:
|
||||
- remote query
|
||||
- order
|
||||
@@ -20,7 +20,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `addDraftOrderItemsWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/add-draft-order-items.ts#L27" />
|
||||
This workflow adds items to a draft order. It's used by the
|
||||
[Add Item to Draft Order Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersidedititems).
|
||||
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around adding items to
|
||||
a draft order.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/add-draft-order-items.ts#L50" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -41,9 +47,10 @@ export async function POST(
|
||||
const { result } = await addDraftOrderItemsWorkflow(req.scope)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"items": [{
|
||||
"quantity": 24
|
||||
order_id: "order_123",
|
||||
items: [{
|
||||
variant_id: "variant_123",
|
||||
quantity: 1
|
||||
}]
|
||||
}
|
||||
})
|
||||
@@ -69,9 +76,10 @@ export default async function handleOrderPlaced({
|
||||
const { result } = await addDraftOrderItemsWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"items": [{
|
||||
"quantity": 24
|
||||
order_id: "order_123",
|
||||
items: [{
|
||||
variant_id: "variant_123",
|
||||
quantity: 1
|
||||
}]
|
||||
}
|
||||
})
|
||||
@@ -97,9 +105,10 @@ export default async function myCustomJob(
|
||||
const { result } = await addDraftOrderItemsWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"items": [{
|
||||
"quantity": 24
|
||||
order_id: "order_123",
|
||||
items: [{
|
||||
variant_id: "variant_123",
|
||||
quantity: 1
|
||||
}]
|
||||
}
|
||||
})
|
||||
@@ -126,9 +135,10 @@ const myWorkflow = createWorkflow(
|
||||
const result = addDraftOrderItemsWorkflow
|
||||
.runAsStep({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"items": [{
|
||||
"quantity": 24
|
||||
order_id: "order_123",
|
||||
items: [{
|
||||
variant_id: "variant_123",
|
||||
quantity: 1
|
||||
}]
|
||||
}
|
||||
})
|
||||
|
||||
+25
-7
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/addDraftOrderPromotionWorkflow
|
||||
sidebar_label: addDraftOrderPromotionWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Add promotions to a draft order.
|
||||
tags:
|
||||
- remote query
|
||||
- order
|
||||
@@ -14,7 +14,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `addDraftOrderPromotionWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/add-draft-order-promotions.ts#L30" />
|
||||
This workflow adds promotions to a draft order. It's used by the
|
||||
[Add Promotion to Draft Order Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersideditpromotions).
|
||||
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around adding promotions to
|
||||
a draft order.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/add-draft-order-promotions.ts#L59" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -34,7 +40,10 @@ export async function POST(
|
||||
) {
|
||||
const { result } = await addDraftOrderPromotionWorkflow(req.scope)
|
||||
.run({
|
||||
input: "{value}"
|
||||
input: {
|
||||
order_id: "order_123",
|
||||
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"]
|
||||
}
|
||||
})
|
||||
|
||||
res.send(result)
|
||||
@@ -57,7 +66,10 @@ export default async function handleOrderPlaced({
|
||||
}: SubscriberArgs < { id: string } > ) {
|
||||
const { result } = await addDraftOrderPromotionWorkflow(container)
|
||||
.run({
|
||||
input: "{value}"
|
||||
input: {
|
||||
order_id: "order_123",
|
||||
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"]
|
||||
}
|
||||
})
|
||||
|
||||
console.log(result)
|
||||
@@ -80,7 +92,10 @@ export default async function myCustomJob(
|
||||
) {
|
||||
const { result } = await addDraftOrderPromotionWorkflow(container)
|
||||
.run({
|
||||
input: "{value}"
|
||||
input: {
|
||||
order_id: "order_123",
|
||||
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"]
|
||||
}
|
||||
})
|
||||
|
||||
console.log(result)
|
||||
@@ -104,7 +119,10 @@ const myWorkflow = createWorkflow(
|
||||
() => {
|
||||
const result = addDraftOrderPromotionWorkflow
|
||||
.runAsStep({
|
||||
input: "{value}"
|
||||
input: {
|
||||
order_id: "order_123",
|
||||
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"]
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
@@ -119,7 +137,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"AddDraftOrderPromotionWorkflowInput","type":"`AddDraftOrderPromotionWorkflowInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="addDraftOrderPromotionWorkflow"/>
|
||||
<TypeList types={[{"name":"AddDraftOrderPromotionWorkflowInput","type":"[AddDraftOrderPromotionWorkflowInput](../../../../interfaces/core_flows.AddDraftOrderPromotionWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the promotions to add to a draft order.","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"The ID of the draft order to add the promotions to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promo_codes","type":"`string`[]","description":"The codes of the promotions to add to the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="addDraftOrderPromotionWorkflow"/>
|
||||
|
||||
## Output
|
||||
|
||||
|
||||
+29
-7
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/addDraftOrderShippingMethodsWorkflow
|
||||
sidebar_label: addDraftOrderShippingMethodsWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Add shipping methods to a draft order.
|
||||
tags:
|
||||
- remote query
|
||||
- order
|
||||
@@ -15,7 +15,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `addDraftOrderShippingMethodsWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/add-draft-order-shipping-methods.ts#L44" />
|
||||
This workflow adds shipping methods to a draft order. It's used by the
|
||||
[Add Shipping Method to Draft Order Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersideditshippingmethods).
|
||||
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around adding shipping methods to
|
||||
a draft order.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/add-draft-order-shipping-methods.ts#L69" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -35,7 +41,11 @@ export async function POST(
|
||||
) {
|
||||
const { result } = await addDraftOrderShippingMethodsWorkflow(req.scope)
|
||||
.run({
|
||||
input: "{value}"
|
||||
input: {
|
||||
order_id: "order_123",
|
||||
shipping_option_id: "so_123",
|
||||
custom_amount: 10
|
||||
}
|
||||
})
|
||||
|
||||
res.send(result)
|
||||
@@ -58,7 +68,11 @@ export default async function handleOrderPlaced({
|
||||
}: SubscriberArgs < { id: string } > ) {
|
||||
const { result } = await addDraftOrderShippingMethodsWorkflow(container)
|
||||
.run({
|
||||
input: "{value}"
|
||||
input: {
|
||||
order_id: "order_123",
|
||||
shipping_option_id: "so_123",
|
||||
custom_amount: 10
|
||||
}
|
||||
})
|
||||
|
||||
console.log(result)
|
||||
@@ -81,7 +95,11 @@ export default async function myCustomJob(
|
||||
) {
|
||||
const { result } = await addDraftOrderShippingMethodsWorkflow(container)
|
||||
.run({
|
||||
input: "{value}"
|
||||
input: {
|
||||
order_id: "order_123",
|
||||
shipping_option_id: "so_123",
|
||||
custom_amount: 10
|
||||
}
|
||||
})
|
||||
|
||||
console.log(result)
|
||||
@@ -105,7 +123,11 @@ const myWorkflow = createWorkflow(
|
||||
() => {
|
||||
const result = addDraftOrderShippingMethodsWorkflow
|
||||
.runAsStep({
|
||||
input: "{value}"
|
||||
input: {
|
||||
order_id: "order_123",
|
||||
shipping_option_id: "so_123",
|
||||
custom_amount: 10
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
@@ -120,7 +142,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"AddDraftOrderShippingMethodsWorkflowInput","type":"`AddDraftOrderShippingMethodsWorkflowInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="addDraftOrderShippingMethodsWorkflow"/>
|
||||
<TypeList types={[{"name":"AddDraftOrderShippingMethodsWorkflowInput","type":"[AddDraftOrderShippingMethodsWorkflowInput](../../../../interfaces/core_flows.AddDraftOrderShippingMethodsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the shipping methods to add to a draft order.","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"The ID of the draft order to add the shipping methods to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping option to add as a shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"`null` \\| [BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"The custom amount to add the shipping method with.\nIf not specified, the shipping option's fixed or calculated price will be used.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="addDraftOrderShippingMethodsWorkflow"/>
|
||||
|
||||
## Output
|
||||
|
||||
|
||||
+15
-7
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/beginDraftOrderEditWorkflow
|
||||
sidebar_label: beginDraftOrderEditWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Create a draft order edit request.
|
||||
tags:
|
||||
- remote query
|
||||
- order
|
||||
@@ -14,7 +14,15 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `beginDraftOrderEditWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/begin-draft-order-edit.ts#L14" />
|
||||
This workflow begins a draft order edit. It's used by the
|
||||
[Create Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersidedit).
|
||||
|
||||
The draft order edit can later be requested using [requestDraftOrderEditWorkflow](../core_flows.Draft_Order.Workflows_Draft_Order.requestDraftOrderEditWorkflow/page.mdx) or confirmed using [confirmDraftOrderEditWorkflow](../core_flows.Draft_Order.Workflows_Draft_Order.confirmDraftOrderEditWorkflow/page.mdx).
|
||||
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
creating a draft order edit request.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/begin-draft-order-edit.ts#L35" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -35,7 +43,7 @@ export async function POST(
|
||||
const { result } = await beginDraftOrderEditWorkflow(req.scope)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123"
|
||||
order_id: "order_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -60,7 +68,7 @@ export default async function handleOrderPlaced({
|
||||
const { result } = await beginDraftOrderEditWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123"
|
||||
order_id: "order_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -85,7 +93,7 @@ export default async function myCustomJob(
|
||||
const { result } = await beginDraftOrderEditWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123"
|
||||
order_id: "order_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -111,7 +119,7 @@ const myWorkflow = createWorkflow(
|
||||
const result = beginDraftOrderEditWorkflow
|
||||
.runAsStep({
|
||||
input: {
|
||||
"order_id": "order_123"
|
||||
order_id: "order_123",
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -123,7 +131,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"beginDraftOrderEditWorkflow","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1},{"type":"step","name":"validateDraftOrderStep","description":"","link":"../../../Steps_Draft_Order/functions/core_flows.Draft_Order.Steps_Draft_Order.validateDraftOrderStep/page.mdx","depth":2},{"type":"step","name":"createOrderChangeStep","description":"This step creates an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.createOrderChangeStep/page.mdx","depth":3},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":4}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"beginDraftOrderEditWorkflow","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1},{"type":"step","name":"validateDraftOrderStep","description":"This step validates that an order is a draft order. It throws an error otherwise.\n\n:::note\n\nYou can retrieve a draft order's details using [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query),\nor [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-workflows/steps/useQueryGraphStep).\n\n:::","link":"../../../Steps_Draft_Order/functions/core_flows.Draft_Order.Steps_Draft_Order.validateDraftOrderStep/page.mdx","depth":2},{"type":"step","name":"createOrderChangeStep","description":"This step creates an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.createOrderChangeStep/page.mdx","depth":3},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":4}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+13
-7
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/cancelDraftOrderEditWorkflow
|
||||
sidebar_label: cancelDraftOrderEditWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Cancel a draft order edit.
|
||||
tags:
|
||||
- remote query
|
||||
- order
|
||||
@@ -14,7 +14,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `cancelDraftOrderEditWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/cancel-draft-order-edit.ts#L27" />
|
||||
This workflow cancels a draft order edit. It's used by the
|
||||
[Cancel Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_deletedraftordersidedit).
|
||||
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
cancelling a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/cancel-draft-order-edit.ts#L52" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -35,7 +41,7 @@ export async function POST(
|
||||
const { result } = await cancelDraftOrderEditWorkflow(req.scope)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123"
|
||||
order_id: "order_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -60,7 +66,7 @@ export default async function handleOrderPlaced({
|
||||
const { result } = await cancelDraftOrderEditWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123"
|
||||
order_id: "order_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -85,7 +91,7 @@ export default async function myCustomJob(
|
||||
const { result } = await cancelDraftOrderEditWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123"
|
||||
order_id: "order_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -111,7 +117,7 @@ const myWorkflow = createWorkflow(
|
||||
const result = cancelDraftOrderEditWorkflow
|
||||
.runAsStep({
|
||||
input: {
|
||||
"order_id": "order_123"
|
||||
order_id: "order_123",
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -127,4 +133,4 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"CancelDraftOrderEditWorkflowInput","type":"[CancelDraftOrderEditWorkflowInput](../../../../interfaces/core_flows.CancelDraftOrderEditWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="cancelDraftOrderEditWorkflow"/>
|
||||
<TypeList types={[{"name":"CancelDraftOrderEditWorkflowInput","type":"[CancelDraftOrderEditWorkflowInput](../../../../interfaces/core_flows.CancelDraftOrderEditWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the draft order edit to cancel.","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"The ID of the draft order to cancel the edit for.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="cancelDraftOrderEditWorkflow"/>
|
||||
+16
-10
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/confirmDraftOrderEditWorkflow
|
||||
sidebar_label: confirmDraftOrderEditWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Confirm a draft order edit.
|
||||
tags:
|
||||
- remote query
|
||||
- order
|
||||
@@ -18,7 +18,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `confirmDraftOrderEditWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts#L36" />
|
||||
This workflow confirms a draft order edit. It's used by the
|
||||
[Confirm Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersideditconfirm).
|
||||
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
confirming a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts#L56" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -39,8 +45,8 @@ export async function POST(
|
||||
const { result } = await confirmDraftOrderEditWorkflow(req.scope)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"confirmed_by": "{value}"
|
||||
order_id: "order_123",
|
||||
confirmed_by: "user_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -65,8 +71,8 @@ export default async function handleOrderPlaced({
|
||||
const { result } = await confirmDraftOrderEditWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"confirmed_by": "{value}"
|
||||
order_id: "order_123",
|
||||
confirmed_by: "user_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -91,8 +97,8 @@ export default async function myCustomJob(
|
||||
const { result } = await confirmDraftOrderEditWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"confirmed_by": "{value}"
|
||||
order_id: "order_123",
|
||||
confirmed_by: "user_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -118,8 +124,8 @@ const myWorkflow = createWorkflow(
|
||||
const result = confirmDraftOrderEditWorkflow
|
||||
.runAsStep({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"confirmed_by": "{value}"
|
||||
order_id: "order_123",
|
||||
confirmed_by: "user_123",
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/convertDraftOrderStep
|
||||
sidebar_label: convertDraftOrderStep
|
||||
sidebar_description: ""
|
||||
---
|
||||
|
||||
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
# convertDraftOrderStep - Medusa Core Workflows Reference
|
||||
|
||||
This documentation provides a reference to the `convertDraftOrderStep`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
This step converts a draft order to a pending order.
|
||||
|
||||
```ts title="src/workflows/my-workflow.ts"
|
||||
import { createWorkflow } from "@medusajs/framework/workflows-sdk"
|
||||
import { convertDraftOrderStep } from "@medusajs/medusa/core-flows"
|
||||
|
||||
const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = convertDraftOrderStep({
|
||||
"id": "id_BOUXu32Hh5N"
|
||||
})
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"ConvertDraftOrderStepInput","type":"[ConvertDraftOrderStepInput](../../../../interfaces/core_flows.ConvertDraftOrderStepInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the draft order to convert to an order.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the draft order to convert to an order.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="convertDraftOrderStep"/>
|
||||
|
||||
## Output
|
||||
|
||||
<TypeList types={[{"name":"OrderDTO","type":"[OrderDTO](../../../../../fulfillment/interfaces/fulfillment.OrderDTO/page.mdx)","optional":false,"defaultValue":"","description":"The order details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"The order's display ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderStatus](../../../../../fulfillment/types/fulfillment.OrderStatus/page.mdx)","description":"The status of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandablLine truncated
|
||||
+37
-25
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/convertDraftOrderWorkflow
|
||||
sidebar_label: convertDraftOrderWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Convert a draft order to a pending order.
|
||||
---
|
||||
|
||||
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
@@ -10,7 +10,7 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `convertDraftOrderWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/convert-draft-order.ts#L79" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/convert-draft-order.ts#L97" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -25,12 +25,15 @@ import type {
|
||||
import { convertDraftOrderWorkflow } from "@medusajs/medusa/core-flows"
|
||||
|
||||
export async function POST(
|
||||
req: MedusaRequest,
|
||||
res: MedusaResponse
|
||||
) {
|
||||
``
|
||||
`typescript
|
||||
const order = await convertDraftOrderWorkflow({ id: "order_123" })
|
||||
req: MedusaRequest,
|
||||
res: MedusaResponse
|
||||
) {
|
||||
const { result } = await convertDraftOrderWorkflow(req.scope)
|
||||
.run({
|
||||
input: {
|
||||
id: "order_123",
|
||||
}
|
||||
})
|
||||
|
||||
res.send(result)
|
||||
}
|
||||
@@ -47,12 +50,15 @@ import {
|
||||
import { convertDraftOrderWorkflow } from "@medusajs/medusa/core-flows"
|
||||
|
||||
export default async function handleOrderPlaced({
|
||||
event: { data },
|
||||
container,
|
||||
}: SubscriberArgs < { id: string } > ) {
|
||||
``
|
||||
`typescript
|
||||
const order = await convertDraftOrderWorkflow({ id: "order_123" })
|
||||
event: { data },
|
||||
container,
|
||||
}: SubscriberArgs < { id: string } > ) {
|
||||
const { result } = await convertDraftOrderWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
id: "order_123",
|
||||
}
|
||||
})
|
||||
|
||||
console.log(result)
|
||||
}
|
||||
@@ -70,11 +76,14 @@ import { MedusaContainer } from "@medusajs/framework/types"
|
||||
import { convertDraftOrderWorkflow } from "@medusajs/medusa/core-flows"
|
||||
|
||||
export default async function myCustomJob(
|
||||
container: MedusaContainer
|
||||
) {
|
||||
``
|
||||
`typescript
|
||||
const order = await convertDraftOrderWorkflow({ id: "order_123" })
|
||||
container: MedusaContainer
|
||||
) {
|
||||
const { result } = await convertDraftOrderWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
id: "order_123",
|
||||
}
|
||||
})
|
||||
|
||||
console.log(result)
|
||||
}
|
||||
@@ -93,11 +102,14 @@ import { createWorkflow } from "@medusajs/framework/workflows-sdk"
|
||||
import { convertDraftOrderWorkflow } from "@medusajs/medusa/core-flows"
|
||||
|
||||
const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
``
|
||||
`typescript
|
||||
const order = convertDraftOrderWorkflow({ id: "order_123" })
|
||||
"my-workflow",
|
||||
() => {
|
||||
const result = convertDraftOrderWorkflow
|
||||
.runAsStep({
|
||||
input: {
|
||||
id: "order_123",
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
```
|
||||
@@ -107,7 +119,7 @@ const order = convertDraftOrderWorkflow({ id: "order_123" })
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"ConvertDraftOrderWorkflowInput","type":"`ConvertDraftOrderWorkflowInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="convertDraftOrderWorkflow"/>
|
||||
<TypeList types={[{"name":"ConvertDraftOrderWorkflowInput","type":"[ConvertDraftOrderWorkflowInput](../../../../interfaces/core_flows.ConvertDraftOrderWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the draft order to convert to an order.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the draft order to convert to an order.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="convertDraftOrderWorkflow"/>
|
||||
|
||||
## Output
|
||||
|
||||
|
||||
+16
-10
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/removeDraftOrderActionItemWorkflow
|
||||
sidebar_label: removeDraftOrderActionItemWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Remove an item from a draft order edit.
|
||||
tags:
|
||||
- remote query
|
||||
- order
|
||||
@@ -14,7 +14,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `removeDraftOrderActionItemWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-item.ts#L28" />
|
||||
This workflow removes an item that was added or updated in a draft order edit. It's used by the
|
||||
[Remove Item from Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_deletedraftordersidedititemsaction\_id).
|
||||
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
removing an item from a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-item.ts#L48" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -35,8 +41,8 @@ export async function POST(
|
||||
const { result } = await removeDraftOrderActionItemWorkflow(req.scope)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"action_id": "{value}"
|
||||
order_id: "order_123",
|
||||
action_id: "action_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -61,8 +67,8 @@ export default async function handleOrderPlaced({
|
||||
const { result } = await removeDraftOrderActionItemWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"action_id": "{value}"
|
||||
order_id: "order_123",
|
||||
action_id: "action_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -87,8 +93,8 @@ export default async function myCustomJob(
|
||||
const { result } = await removeDraftOrderActionItemWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"action_id": "{value}"
|
||||
order_id: "order_123",
|
||||
action_id: "action_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -114,8 +120,8 @@ const myWorkflow = createWorkflow(
|
||||
const result = removeDraftOrderActionItemWorkflow
|
||||
.runAsStep({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"action_id": "{value}"
|
||||
order_id: "order_123",
|
||||
action_id: "action_123",
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+16
-10
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/removeDraftOrderActionShippingMethodWorkflow
|
||||
sidebar_label: removeDraftOrderActionShippingMethodWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Remove a shipping method from an edited draft order.
|
||||
tags:
|
||||
- remote query
|
||||
- order
|
||||
@@ -14,7 +14,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `removeDraftOrderActionShippingMethodWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-shipping-method.ts#L32" />
|
||||
This workflow removes a shipping method that was added to an edited draft order. It's used by the
|
||||
[Remove Shipping Method from Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_deletedraftordersideditshippingmethodsaction\_id).
|
||||
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
removing a shipping method from an edited draft order.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-shipping-method.ts#L52" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -36,8 +42,8 @@ export async function POST(
|
||||
.scope)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"action_id": "{value}"
|
||||
order_id: "order_123",
|
||||
action_id: "action_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -63,8 +69,8 @@ export default async function handleOrderPlaced({
|
||||
container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"action_id": "{value}"
|
||||
order_id: "order_123",
|
||||
action_id: "action_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -90,8 +96,8 @@ export default async function myCustomJob(
|
||||
container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"action_id": "{value}"
|
||||
order_id: "order_123",
|
||||
action_id: "action_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -117,8 +123,8 @@ const myWorkflow = createWorkflow(
|
||||
const result = removeDraftOrderActionShippingMethodWorkflow
|
||||
.runAsStep({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"action_id": "{value}"
|
||||
order_id: "order_123",
|
||||
action_id: "action_123",
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+25
-7
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/removeDraftOrderPromotionsWorkflow
|
||||
sidebar_label: removeDraftOrderPromotionsWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Remove promotions from a draft order edit.
|
||||
tags:
|
||||
- remote query
|
||||
- order
|
||||
@@ -14,7 +14,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `removeDraftOrderPromotionsWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-promotions.ts#L31" />
|
||||
This workflow removes promotions from a draft order edit. It's used by the
|
||||
[Remove Promotions from Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_deletedraftordersideditpromotions).
|
||||
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
removing promotions from a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-promotions.ts#L60" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -34,7 +40,10 @@ export async function POST(
|
||||
) {
|
||||
const { result } = await removeDraftOrderPromotionsWorkflow(req.scope)
|
||||
.run({
|
||||
input: "{value}"
|
||||
input: {
|
||||
order_id: "order_123",
|
||||
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"],
|
||||
}
|
||||
})
|
||||
|
||||
res.send(result)
|
||||
@@ -57,7 +66,10 @@ export default async function handleOrderPlaced({
|
||||
}: SubscriberArgs < { id: string } > ) {
|
||||
const { result } = await removeDraftOrderPromotionsWorkflow(container)
|
||||
.run({
|
||||
input: "{value}"
|
||||
input: {
|
||||
order_id: "order_123",
|
||||
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"],
|
||||
}
|
||||
})
|
||||
|
||||
console.log(result)
|
||||
@@ -80,7 +92,10 @@ export default async function myCustomJob(
|
||||
) {
|
||||
const { result } = await removeDraftOrderPromotionsWorkflow(container)
|
||||
.run({
|
||||
input: "{value}"
|
||||
input: {
|
||||
order_id: "order_123",
|
||||
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"],
|
||||
}
|
||||
})
|
||||
|
||||
console.log(result)
|
||||
@@ -104,7 +119,10 @@ const myWorkflow = createWorkflow(
|
||||
() => {
|
||||
const result = removeDraftOrderPromotionsWorkflow
|
||||
.runAsStep({
|
||||
input: "{value}"
|
||||
input: {
|
||||
order_id: "order_123",
|
||||
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"],
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
@@ -119,7 +137,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"RemoveDraftOrderPromotionsWorkflowInput","type":"`RemoveDraftOrderPromotionsWorkflowInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="removeDraftOrderPromotionsWorkflow"/>
|
||||
<TypeList types={[{"name":"RemoveDraftOrderPromotionsWorkflowInput","type":"[RemoveDraftOrderPromotionsWorkflowInput](../../../../interfaces/core_flows.RemoveDraftOrderPromotionsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the promotions to remove from a draft order.","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"The ID of the draft order to remove the promotions from.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promo_codes","type":"`string`[]","description":"The codes of the promotions to remove from the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="removeDraftOrderPromotionsWorkflow"/>
|
||||
|
||||
## Output
|
||||
|
||||
|
||||
+25
-7
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/removeDraftOrderShippingMethodWorkflow
|
||||
sidebar_label: removeDraftOrderShippingMethodWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Remove an existing shipping method from a draft order edit.
|
||||
tags:
|
||||
- remote query
|
||||
- order
|
||||
@@ -15,7 +15,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `removeDraftOrderShippingMethodWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-shipping-method.ts#L38" />
|
||||
This workflow removes an existing shipping method from a draft order edit. It's used by the
|
||||
[Remove Shipping Method from Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_deletedraftordersideditshippingmethodsmethodmethod\_id).
|
||||
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
removing a shipping method from a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-shipping-method.ts#L61" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -35,7 +41,10 @@ export async function POST(
|
||||
) {
|
||||
const { result } = await removeDraftOrderShippingMethodWorkflow(req.scope)
|
||||
.run({
|
||||
input: "{value}"
|
||||
input: {
|
||||
order_id: "order_123",
|
||||
shipping_method_id: "sm_123",
|
||||
}
|
||||
})
|
||||
|
||||
res.send(result)
|
||||
@@ -58,7 +67,10 @@ export default async function handleOrderPlaced({
|
||||
}: SubscriberArgs < { id: string } > ) {
|
||||
const { result } = await removeDraftOrderShippingMethodWorkflow(container)
|
||||
.run({
|
||||
input: "{value}"
|
||||
input: {
|
||||
order_id: "order_123",
|
||||
shipping_method_id: "sm_123",
|
||||
}
|
||||
})
|
||||
|
||||
console.log(result)
|
||||
@@ -81,7 +93,10 @@ export default async function myCustomJob(
|
||||
) {
|
||||
const { result } = await removeDraftOrderShippingMethodWorkflow(container)
|
||||
.run({
|
||||
input: "{value}"
|
||||
input: {
|
||||
order_id: "order_123",
|
||||
shipping_method_id: "sm_123",
|
||||
}
|
||||
})
|
||||
|
||||
console.log(result)
|
||||
@@ -105,7 +120,10 @@ const myWorkflow = createWorkflow(
|
||||
() => {
|
||||
const result = removeDraftOrderShippingMethodWorkflow
|
||||
.runAsStep({
|
||||
input: "{value}"
|
||||
input: {
|
||||
order_id: "order_123",
|
||||
shipping_method_id: "sm_123",
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
@@ -120,7 +138,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"RemoveDraftOrderShippingMethodWorkflowInput","type":"`RemoveDraftOrderShippingMethodWorkflowInput`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="removeDraftOrderShippingMethodWorkflow"/>
|
||||
<TypeList types={[{"name":"RemoveDraftOrderShippingMethodWorkflowInput","type":"[RemoveDraftOrderShippingMethodWorkflowInput](../../../../interfaces/core_flows.RemoveDraftOrderShippingMethodWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the shipping method to remove from a draft order.","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"The ID of the draft order to remove the shipping method from.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_method_id","type":"`string`","description":"The ID of the shipping method to remove.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="removeDraftOrderShippingMethodWorkflow"/>
|
||||
|
||||
## Output
|
||||
|
||||
|
||||
+16
-6
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/requestDraftOrderEditWorkflow
|
||||
sidebar_label: requestDraftOrderEditWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Request a draft order edit.
|
||||
tags:
|
||||
- remote query
|
||||
- order
|
||||
@@ -16,7 +16,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `requestDraftOrderEditWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/request-draft-order-edit.ts#L51" />
|
||||
This workflow requests a draft order edit. It's used by the
|
||||
[Request Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersideditrequest).
|
||||
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
requesting a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/request-draft-order-edit.ts#L71" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -37,7 +43,8 @@ export async function POST(
|
||||
const { result } = await requestDraftOrderEditWorkflow(req.scope)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123"
|
||||
order_id: "order_123",
|
||||
requested_by: "user_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -62,7 +69,8 @@ export default async function handleOrderPlaced({
|
||||
const { result } = await requestDraftOrderEditWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123"
|
||||
order_id: "order_123",
|
||||
requested_by: "user_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -87,7 +95,8 @@ export default async function myCustomJob(
|
||||
const { result } = await requestDraftOrderEditWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123"
|
||||
order_id: "order_123",
|
||||
requested_by: "user_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -113,7 +122,8 @@ const myWorkflow = createWorkflow(
|
||||
const result = requestDraftOrderEditWorkflow
|
||||
.runAsStep({
|
||||
input: {
|
||||
"order_id": "order_123"
|
||||
order_id: "order_123",
|
||||
requested_by: "user_123",
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+28
-14
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/updateDraftOrderActionItemWorkflow
|
||||
sidebar_label: updateDraftOrderActionItemWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Update a new item in a draft order edit.
|
||||
tags:
|
||||
- remote query
|
||||
- order
|
||||
@@ -14,7 +14,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `updateDraftOrderActionItemWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-item.ts#L28" />
|
||||
This workflow updates a new item that was added to a draft order edit. It's used by the
|
||||
[Update New Item in Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersidedititemsaction\_id).
|
||||
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
updating a new item in a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-item.ts#L51" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -35,9 +41,11 @@ export async function POST(
|
||||
const { result } = await updateDraftOrderActionItemWorkflow(req.scope)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"action_id": "{value}",
|
||||
"data": {}
|
||||
order_id: "order_123",
|
||||
action_id: "action_123",
|
||||
data: {
|
||||
quantity: 2,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -62,9 +70,11 @@ export default async function handleOrderPlaced({
|
||||
const { result } = await updateDraftOrderActionItemWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"action_id": "{value}",
|
||||
"data": {}
|
||||
order_id: "order_123",
|
||||
action_id: "action_123",
|
||||
data: {
|
||||
quantity: 2,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -89,9 +99,11 @@ export default async function myCustomJob(
|
||||
const { result } = await updateDraftOrderActionItemWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"action_id": "{value}",
|
||||
"data": {}
|
||||
order_id: "order_123",
|
||||
action_id: "action_123",
|
||||
data: {
|
||||
quantity: 2,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -117,9 +129,11 @@ const myWorkflow = createWorkflow(
|
||||
const result = updateDraftOrderActionItemWorkflow
|
||||
.runAsStep({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"action_id": "{value}",
|
||||
"data": {}
|
||||
order_id: "order_123",
|
||||
action_id: "action_123",
|
||||
data: {
|
||||
quantity: 2,
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+28
-14
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/updateDraftOrderActionShippingMethodWorkflow
|
||||
sidebar_label: updateDraftOrderActionShippingMethodWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Update a new shipping method in a draft order edit.
|
||||
tags:
|
||||
- remote query
|
||||
- order
|
||||
@@ -14,7 +14,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `updateDraftOrderActionShippingMethodWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-shipping-method.ts#L33" />
|
||||
This workflow updates a new shipping method that was added to a draft order edit. It's used by the
|
||||
[Update New Shipping Method in Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersideditshippingmethodsaction\_id).
|
||||
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
updating a new shipping method in a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-shipping-method.ts#L56" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -36,9 +42,11 @@ export async function POST(
|
||||
.scope)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"action_id": "{value}",
|
||||
"data": {}
|
||||
order_id: "order_123",
|
||||
action_id: "action_123",
|
||||
data: {
|
||||
custom_amount: 10,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -64,9 +72,11 @@ export default async function handleOrderPlaced({
|
||||
container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"action_id": "{value}",
|
||||
"data": {}
|
||||
order_id: "order_123",
|
||||
action_id: "action_123",
|
||||
data: {
|
||||
custom_amount: 10,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -92,9 +102,11 @@ export default async function myCustomJob(
|
||||
container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"action_id": "{value}",
|
||||
"data": {}
|
||||
order_id: "order_123",
|
||||
action_id: "action_123",
|
||||
data: {
|
||||
custom_amount: 10,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -120,9 +132,11 @@ const myWorkflow = createWorkflow(
|
||||
const result = updateDraftOrderActionShippingMethodWorkflow
|
||||
.runAsStep({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"action_id": "{value}",
|
||||
"data": {}
|
||||
order_id: "order_123",
|
||||
action_id: "action_123",
|
||||
data: {
|
||||
custom_amount: 10,
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+16
-22
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/updateDraftOrderItemWorkflow
|
||||
sidebar_label: updateDraftOrderItemWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Update an item in a draft order edit.
|
||||
tags:
|
||||
- remote query
|
||||
- order
|
||||
@@ -14,7 +14,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `updateDraftOrderItemWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/update-draft-order-item.ts#L33" />
|
||||
This workflow updates an item in a draft order edit. It's used by the
|
||||
[Update Item in Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersidedititemsitemitem\_id).
|
||||
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
updating an item in a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/update-draft-order-item.ts#L53" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -35,11 +41,8 @@ export async function POST(
|
||||
const { result } = await updateDraftOrderItemWorkflow(req.scope)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"items": [{
|
||||
"id": "id_kjpPS2S1yZ6z",
|
||||
"quantity": 24
|
||||
}]
|
||||
order_id: "order_123",
|
||||
items: [{ id: "orli_123", quantity: 2 }],
|
||||
}
|
||||
})
|
||||
|
||||
@@ -64,11 +67,8 @@ export default async function handleOrderPlaced({
|
||||
const { result } = await updateDraftOrderItemWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"items": [{
|
||||
"id": "id_kjpPS2S1yZ6z",
|
||||
"quantity": 24
|
||||
}]
|
||||
order_id: "order_123",
|
||||
items: [{ id: "orli_123", quantity: 2 }],
|
||||
}
|
||||
})
|
||||
|
||||
@@ -93,11 +93,8 @@ export default async function myCustomJob(
|
||||
const { result } = await updateDraftOrderItemWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"items": [{
|
||||
"id": "id_kjpPS2S1yZ6z",
|
||||
"quantity": 24
|
||||
}]
|
||||
order_id: "order_123",
|
||||
items: [{ id: "orli_123", quantity: 2 }],
|
||||
}
|
||||
})
|
||||
|
||||
@@ -123,11 +120,8 @@ const myWorkflow = createWorkflow(
|
||||
const result = updateDraftOrderItemWorkflow
|
||||
.runAsStep({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"items": [{
|
||||
"id": "id_kjpPS2S1yZ6z",
|
||||
"quantity": 24
|
||||
}]
|
||||
order_id: "order_123",
|
||||
items: [{ id: "orli_123", quantity: 2 }],
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+25
-15
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/updateDraftOrderShippingMethodWorkflow
|
||||
sidebar_label: updateDraftOrderShippingMethodWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Update an existing shipping method in a draft order edit.
|
||||
tags:
|
||||
- remote query
|
||||
- order
|
||||
@@ -15,7 +15,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `updateDraftOrderShippingMethodWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/update-draft-order-shipping-method.ts#L53" />
|
||||
This workflow updates an existing shipping method in a draft order edit. It's used by the
|
||||
[Update Shipping Method in Draft Order Edit Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersideditshippingmethodsmethodmethod\_id).
|
||||
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
updating an existing shipping method in a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/update-draft-order-shipping-method.ts#L79" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -36,9 +42,10 @@ export async function POST(
|
||||
const { result } = await updateDraftOrderShippingMethodWorkflow(req.scope)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"data": {
|
||||
"shipping_method_id": "{value}"
|
||||
order_id: "order_123",
|
||||
data: {
|
||||
shipping_method_id: "sm_123",
|
||||
custom_amount: 10,
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -64,9 +71,10 @@ export default async function handleOrderPlaced({
|
||||
const { result } = await updateDraftOrderShippingMethodWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"data": {
|
||||
"shipping_method_id": "{value}"
|
||||
order_id: "order_123",
|
||||
data: {
|
||||
shipping_method_id: "sm_123",
|
||||
custom_amount: 10,
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -92,9 +100,10 @@ export default async function myCustomJob(
|
||||
const { result } = await updateDraftOrderShippingMethodWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"data": {
|
||||
"shipping_method_id": "{value}"
|
||||
order_id: "order_123",
|
||||
data: {
|
||||
shipping_method_id: "sm_123",
|
||||
custom_amount: 10,
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -121,9 +130,10 @@ const myWorkflow = createWorkflow(
|
||||
const result = updateDraftOrderShippingMethodWorkflow
|
||||
.runAsStep({
|
||||
input: {
|
||||
"order_id": "order_123",
|
||||
"data": {
|
||||
"shipping_method_id": "{value}"
|
||||
order_id: "order_123",
|
||||
data: {
|
||||
shipping_method_id: "sm_123",
|
||||
custom_amount: 10,
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -140,7 +150,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"UpdateDraftOrderShippingMethodWorkflowInput","type":"[UpdateDraftOrderShippingMethodWorkflowInput](../../../../interfaces/core_flows.UpdateDraftOrderShippingMethodWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"The ID of the order to update the shipping method in its edit.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"shipping_method_id","type":"`string`","description":"The ID of the shipping method to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping option to associate with the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"Set a custom amount for the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"internal_note","type":"`null` \\| `string`","description":"A note viewed by admins only related to the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="updateDraftOrderShippingMethodWorkflow"/>
|
||||
<TypeList types={[{"name":"UpdateDraftOrderShippingMethodWorkflowInput","type":"[UpdateDraftOrderShippingMethodWorkflowInput](../../../../interfaces/core_flows.UpdateDraftOrderShippingMethodWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the shipping method to update in the order edit.","expandable":false,"children":[{"name":"order_id","type":"`string`","description":"The ID of the order to update the shipping method in its edit.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"shipping_method_id","type":"`string`","description":"The ID of the shipping method to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping method's option.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"Set a custom amount for the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"internal_note","type":"`null` \\| `string`","description":"A note viewed by admins only related to the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="updateDraftOrderShippingMethodWorkflow"/>
|
||||
|
||||
## Output
|
||||
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/updateDraftOrderStep
|
||||
sidebar_label: updateDraftOrderStep
|
||||
sidebar_description: ""
|
||||
tags:
|
||||
- order
|
||||
- step
|
||||
---
|
||||
|
||||
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
# updateDraftOrderStep - Medusa Core Workflows Reference
|
||||
|
||||
This documentation provides a reference to the `updateDraftOrderStep`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
This step updates a draft order's details.
|
||||
|
||||
:::note
|
||||
|
||||
You can retrieve a draft order's details using [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query),
|
||||
or [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-workflows/steps/useQueryGraphStep).
|
||||
|
||||
:::
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
const data = updateDraftOrderStep({
|
||||
order: {
|
||||
id: "order_123",
|
||||
// other order details...
|
||||
},
|
||||
input: {
|
||||
// details to update...
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"UpdateDraftOrderStepInput","type":"[UpdateDraftOrderStepInput](../../../../interfaces/core_flows.UpdateDraftOrderStepInput/page.mdx)","optional":false,"defaultValue":"","description":"The input for the update draft order step.","expandable":false,"children":[{"name":"order","type":"[OrderDTO](../../../../../fulfillment/interfaces/fulfillment.OrderDTO/page.mdx)","description":"The draft order to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"The order's display ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderStatus](../../../../../fulfillment/types/fulfillment.OrderStatus/page.mdx)","description":"The status of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BLine truncated
|
||||
|
||||
## Output
|
||||
|
||||
<TypeList types={[{"name":"OrderDTO","type":"[OrderDTO](../../../../../fulfillment/interfaces/fulfillment.OrderDTO/page.mdx)","optional":false,"defaultValue":"","description":"The order details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"The order's display ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderStatus](../../../../../fulfillment/types/fulfillment.OrderStatus/page.mdx)","description":"The status of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandablLine truncated
|
||||
+27
-12
@@ -1,7 +1,7 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/updateDraftOrderWorkflow
|
||||
sidebar_label: updateDraftOrderWorkflow
|
||||
sidebar_description: ""
|
||||
sidebar_description: Update a draft order's details.
|
||||
tags:
|
||||
- remote query
|
||||
- order
|
||||
@@ -15,7 +15,18 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `updateDraftOrderWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/876a14eb98aed54360312b9b215599aa46faccd8/packages/core/core-flows/src/draft-order/workflows/update-draft-order.ts#L90" />
|
||||
This workflow updates a draft order's details. It's used by the
|
||||
[Update Draft Order Admin API Route](https://docs.medusajs.com/api/admin#draft-orders\_postdraftordersid).
|
||||
|
||||
This workflow doesn't update the draft order's items, shipping methods, or promotions. Instead, you have to
|
||||
create a draft order edit using [beginDraftOrderEditWorkflow](../core_flows.Draft_Order.Workflows_Draft_Order.beginDraftOrderEditWorkflow/page.mdx) and make updates in the draft order edit.
|
||||
Then, you can confirm the draft order edit using [confirmDraftOrderEditWorkflow](../core_flows.Draft_Order.Workflows_Draft_Order.confirmDraftOrderEditWorkflow/page.mdx) or request a draft order edit
|
||||
using [requestDraftOrderEditWorkflow](../core_flows.Draft_Order.Workflows_Draft_Order.requestDraftOrderEditWorkflow/page.mdx).
|
||||
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
updating a draft order.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/6f8ffcf53c709d40dfeb5980f3769cd0bb810e3e/packages/core/core-flows/src/draft-order/workflows/update-draft-order.ts#L149" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -36,8 +47,9 @@ export async function POST(
|
||||
const { result } = await updateDraftOrderWorkflow(req.scope)
|
||||
.run({
|
||||
input: {
|
||||
"id": "id_KPdfMxf8zFK",
|
||||
"user_id": "{value}"
|
||||
id: "order_123",
|
||||
user_id: "user_123",
|
||||
customer_id: "cus_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -62,8 +74,9 @@ export default async function handleOrderPlaced({
|
||||
const { result } = await updateDraftOrderWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"id": "id_KPdfMxf8zFK",
|
||||
"user_id": "{value}"
|
||||
id: "order_123",
|
||||
user_id: "user_123",
|
||||
customer_id: "cus_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -88,8 +101,9 @@ export default async function myCustomJob(
|
||||
const { result } = await updateDraftOrderWorkflow(container)
|
||||
.run({
|
||||
input: {
|
||||
"id": "id_KPdfMxf8zFK",
|
||||
"user_id": "{value}"
|
||||
id: "order_123",
|
||||
user_id: "user_123",
|
||||
customer_id: "cus_123",
|
||||
}
|
||||
})
|
||||
|
||||
@@ -115,8 +129,9 @@ const myWorkflow = createWorkflow(
|
||||
const result = updateDraftOrderWorkflow
|
||||
.runAsStep({
|
||||
input: {
|
||||
"id": "id_KPdfMxf8zFK",
|
||||
"user_id": "{value}"
|
||||
id: "order_123",
|
||||
user_id: "user_123",
|
||||
customer_id: "cus_123",
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -128,11 +143,11 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"updateDraftOrderWorkflow","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1},{"type":"step","name":"validateDraftOrderStep","description":"","link":"../../../Steps_Draft_Order/functions/core_flows.Draft_Order.Steps_Draft_Order.validateDraftOrderStep/page.mdx","depth":2},{"type":"step","name":"registerOrderChangesStep","description":"This step registers an order changes.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.registerOrderChangesStep/page.mdx","depth":3},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":4},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":5}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"updateDraftOrderWorkflow","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1},{"type":"step","name":"validateDraftOrderStep","description":"This step validates that an order is a draft order. It throws an error otherwise.\n\n:::note\n\nYou can retrieve a draft order's details using [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query),\nor [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-workflows/steps/useQueryGraphStep).\n\n:::","link":"../../../Steps_Draft_Order/functions/core_flows.Draft_Order.Steps_Draft_Order.validateDraftOrderStep/page.mdx","depth":2},{"type":"step","name":"updateDraftOrderStep","description":"This step updates a draft order's details.\n\n:::note\n\nYou can retrieve a draft order's details using [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query),\nor [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-workflows/steps/useQueryGraphStep).\n\n:::","link":"../core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderStep/page.mdx","depth":3},{"type":"step","name":"registerOrderChangesStep","description":"This step registers an order changes.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.registerOrderChangesStep/page.mdx","depth":4},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":5},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":6}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"UpdateDraftOrderWorkflowInput","type":"[UpdateDraftOrderWorkflowInput](../../../../interfaces/core_flows.UpdateDraftOrderWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the draft order to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"user_id","type":"`string`","description":"The ID of the user updating the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"[UpsertOrderAddressDTO](../../../../../order/interfaces/order.UpsertOrderAddressDTO/page.mdx)","description":"Create or update the shipping address of the draft order.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"billing_address","type":"[UpsertOrderAddressDTO](../../../../../order/interfaces/order.UpsertOrderAddressDTO/page.mdx)","description":"Create or update the billing address of the draft order.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"customer_id","type":"`string`","description":"The ID of the customer to associate the draft order with.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","typLine truncated
|
||||
<TypeList types={[{"name":"UpdateDraftOrderWorkflowInput","type":"[UpdateDraftOrderWorkflowInput](../../../../interfaces/core_flows.UpdateDraftOrderWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the draft order to update.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the draft order to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"user_id","type":"`string`","description":"The ID of the user updating the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"[UpsertOrderAddressDTO](../../../../../order/interfaces/order.UpsertOrderAddressDTO/page.mdx)","description":"Create or update the shipping address of the draft order.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"billing_address","type":"[UpsertOrderAddressDTO](../../../../../order/interfaces/order.UpsertOrderAddressDTO/page.mdx)","description":"Create or update the billing address of the draft order.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"customer_id","type":"`string`","description":"The ID of the customer to associate the draft order with.","optional":true,"defaultValue":"","expandable":Line truncated
|
||||
|
||||
## Output
|
||||
|
||||
|
||||
+2
@@ -8,6 +8,7 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
- [beginDraftOrderEditWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.beginDraftOrderEditWorkflow/page.mdx)
|
||||
- [cancelDraftOrderEditWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.cancelDraftOrderEditWorkflow/page.mdx)
|
||||
- [confirmDraftOrderEditWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.confirmDraftOrderEditWorkflow/page.mdx)
|
||||
- [convertDraftOrderStep](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderStep/page.mdx)
|
||||
- [convertDraftOrderWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderWorkflow/page.mdx)
|
||||
- [removeDraftOrderActionItemWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.removeDraftOrderActionItemWorkflow/page.mdx)
|
||||
- [removeDraftOrderActionShippingMethodWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.removeDraftOrderActionShippingMethodWorkflow/page.mdx)
|
||||
@@ -18,4 +19,5 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
- [updateDraftOrderActionShippingMethodWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderActionShippingMethodWorkflow/page.mdx)
|
||||
- [updateDraftOrderItemWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderItemWorkflow/page.mdx)
|
||||
- [updateDraftOrderShippingMethodWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderShippingMethodWorkflow/page.mdx)
|
||||
- [updateDraftOrderStep](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderStep/page.mdx)
|
||||
- [updateDraftOrderWorkflow](../Workflows_Draft_Order/functions/core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderWorkflow/page.mdx)
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
# AddDraftOrderPromotionWorkflowInput
|
||||
|
||||
The details of the promotions to add to a draft order.
|
||||
|
||||
<TypeList types={[{"name":"order_id","type":"`string`","description":"The ID of the draft order to add the promotions to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promo_codes","type":"`string`[]","description":"The codes of the promotions to add to the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="AddDraftOrderPromotionWorkflowInput"/>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
# AddDraftOrderShippingMethodsWorkflowInput
|
||||
|
||||
The details of the shipping methods to add to a draft order.
|
||||
|
||||
<TypeList types={[{"name":"order_id","type":"`string`","description":"The ID of the draft order to add the shipping methods to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping option to add as a shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"`null` \\| [BigNumberInput](../../../types/types/types.BigNumberInput/page.mdx)","description":"The custom amount to add the shipping method with.\nIf not specified, the shipping option's fixed or calculated price will be used.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="AddDraftOrderShippingMethodsWorkflowInput"/>
|
||||
+3
-1
@@ -2,4 +2,6 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
# CancelDraftOrderEditWorkflowInput
|
||||
|
||||
<TypeList types={[{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="CancelDraftOrderEditWorkflowInput"/>
|
||||
The details of the draft order edit to cancel.
|
||||
|
||||
<TypeList types={[{"name":"order_id","type":"`string`","description":"The ID of the draft order to cancel the edit for.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="CancelDraftOrderEditWorkflowInput"/>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
# ConvertDraftOrderStepInput
|
||||
|
||||
The details of the draft order to convert to an order.
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the draft order to convert to an order.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ConvertDraftOrderStepInput"/>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
# ConvertDraftOrderWorkflowInput
|
||||
|
||||
The details of the draft order to convert to an order.
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the draft order to convert to an order.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ConvertDraftOrderWorkflowInput"/>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
# RemoveDraftOrderPromotionsWorkflowInput
|
||||
|
||||
The details of the promotions to remove from a draft order.
|
||||
|
||||
<TypeList types={[{"name":"order_id","type":"`string`","description":"The ID of the draft order to remove the promotions from.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promo_codes","type":"`string`[]","description":"The codes of the promotions to remove from the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="RemoveDraftOrderPromotionsWorkflowInput"/>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
# RemoveDraftOrderShippingMethodWorkflowInput
|
||||
|
||||
The details of the shipping method to remove from a draft order.
|
||||
|
||||
<TypeList types={[{"name":"order_id","type":"`string`","description":"The ID of the draft order to remove the shipping method from.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_method_id","type":"`string`","description":"The ID of the shipping method to remove.","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="RemoveDraftOrderShippingMethodWorkflowInput"/>
|
||||
+3
-1
@@ -2,4 +2,6 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
# UpdateDraftOrderShippingMethodWorkflowInput
|
||||
|
||||
<TypeList types={[{"name":"order_id","type":"`string`","description":"The ID of the order to update the shipping method in its edit.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"shipping_method_id","type":"`string`","description":"The ID of the shipping method to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping option to associate with the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"[BigNumberInput](../../../types/types/types.BigNumberInput/page.mdx)","description":"Set a custom amount for the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"internal_note","type":"`null` \\| `string`","description":"A note viewed by admins only related to the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="UpdateDraftOrderShippingMethodWorkflowInput"/>
|
||||
The details of the shipping method to update in the order edit.
|
||||
|
||||
<TypeList types={[{"name":"order_id","type":"`string`","description":"The ID of the order to update the shipping method in its edit.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"shipping_method_id","type":"`string`","description":"The ID of the shipping method to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping method's option.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"[BigNumberInput](../../../types/types/types.BigNumberInput/page.mdx)","description":"Set a custom amount for the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../types/types/types.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"internal_note","type":"`null` \\| `string`","description":"A note viewed by admins only related to the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="UpdateDraftOrderShippingMethodWorkflowInput"/>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
# UpdateDraftOrderStepInput
|
||||
|
||||
The input for the update draft order step.
|
||||
|
||||
<TypeList types={[{"name":"order","type":"[OrderDTO](../../../fulfillment/interfaces/fulfillment.OrderDTO/page.mdx)","description":"The draft order to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"The order's display ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderStatus](../../../fulfillment/types/fulfillment.OrderStatus/page.mdx)","description":"The status of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numLine truncated
|
||||
+2
@@ -2,4 +2,6 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
# UpdateDraftOrderWorkflowInput
|
||||
|
||||
The details of the draft order to update.
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the draft order to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"user_id","type":"`string`","description":"The ID of the user updating the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"[UpsertOrderAddressDTO](../../../order/interfaces/order.UpsertOrderAddressDTO/page.mdx)","description":"Create or update the shipping address of the draft order.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"billing_address","type":"[UpsertOrderAddressDTO](../../../order/interfaces/order.UpsertOrderAddressDTO/page.mdx)","description":"Create or update the billing address of the draft order.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"customer_id","type":"`string`","description":"The ID of the customer to associate the draft order with.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The new email of the draft order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`string`","description":"The ID of the sales channel to associate the draft order wLine truncated
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
# ValidateDraftOrderStepInput
|
||||
|
||||
The details of the draft order to validate.
|
||||
|
||||
<TypeList types={[{"name":"order","type":"[OrderDTO](../../../fulfillment/interfaces/fulfillment.OrderDTO/page.mdx)","description":"The draft order to validate.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"The order's display ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderStatus](../../../fulfillment/types/fulfillment.OrderStatus/page.mdx)","description":"The status of the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The original item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item subtotal of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../fulfillment/types/fulfillment.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../fulfillment/types/fulfillment.BigNumberValue/page.mdx)","description":"The item tax total of the order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"nLine truncated
|
||||
Reference in new issue
Block a user