createOrderExchangesStep - Medusa Core Workflows Reference
This documentation provides a reference to the createOrderExchangesStep
. It belongs to the @medusajs/medusa/core-flows
package.
This step creates one or more order exchanges.
1import { createWorkflow } from "@medusajs/framework/workflows-sdk"2import { createOrderExchangesStep } from "@medusajs/medusa/core-flows"3 4const myWorkflow = createWorkflow(5 "my-workflow",6 () => {7 const data = createOrderExchangesStep([{8 "order_id": "order_123"9 }])10 }11)
Input#
CreateOrderExchangeDTO[]
CreateOrderExchangeDTO[]
CreateOrderExchangeDTO[]
CreateOrderExchangeDTO[]order_id
stringThe associated order's ID.
order_id
stringreturn_id
stringOptionalThe associated return's ID.
return_id
stringOptionalclaim_id
stringOptionalThe associated claim's ID.
claim_id
stringOptionalexchange_id
stringOptionalThe associated exchange's ID.
exchange_id
stringOptionaldescription
stringOptionalThe description of the action.
description
stringOptionalinternal_note
stringOptionalThe internal note of the action.
internal_note
stringOptionalreference
stringOptionalThe name of the data model the action
references. For example, return
.
reference
stringOptionalreturn
.reference_id
stringOptionalThe ID of the record of the data model
specified in reference.
For example, if reference
is return
, the
value is return_123
.
reference_id
stringOptionalreference
is return
, the
value is return_123
.metadata
null | Record<string, unknown>OptionalHolds custom data in key-value pairs.
metadata
null | Record<string, unknown>OptionalThe items to be sent to the customer.
The shipping methods used to send the additional items
to the customer.
The shipping methods used to return items from the customer.
The difference due of the exchange.
- If less than
0
, the merchant owes the customer this amount.
- If greater than
0
, the customer owes the merchange this amount.
- If equal to
0
, no payment is required by either sides.
- If less than
0
, the merchant owes the customer this amount. - If greater than
0
, the customer owes the merchange this amount. - If equal to
0
, no payment is required by either sides.
allow_backorder
booleanOptionalWhether backorder is allowed for the exchange's items.
allow_backorder
booleanOptionalno_notification
booleanOptionalWhether the customer should receive notifications related to
updates on the exchange.
no_notification
booleanOptionalcreated_by
null | stringOptionalThe id of the user that creates the order exchange
created_by
null | stringOptionalOutput#
OrderExchangeDTO[]
OrderExchangeDTO[]
OrderExchangeDTO[]
OrderExchangeDTO[]id
stringThe exchange's ID.
id
stringorder_id
stringThe associated order's ID.
order_id
stringorder_version
numberThe version of the order when the exchange is applied.
order_version
numberdisplay_id
numberThe exchange's display ID.
display_id
numberadditional_items
any[]The items to be sent to the customer.
additional_items
any[]metadata
null | Record<string, unknown>Holds custom data in key-value pairs.
metadata
null | Record<string, unknown>The associated order.
no_notification
booleanOptionalWhether the customer should receive notifications related
to updates on the exchange.
no_notification
booleanOptionalThe difference due of the order exchange.
- If less than
0
, the merchant owes the customer this amount.
- If greater than
0
, the customer owes the merchange this amount.
- If equal to
0
, no payment is required by either sides.
- If less than
0
, the merchant owes the customer this amount. - If greater than
0
, the customer owes the merchange this amount. - If equal to
0
, no payment is required by either sides.
The raw difference due of the order exchange.
- If less than
0
, the merchant owes the customer this amount.
- If greater than
0
, the customer owes the merchange this amount.
- If equal to
0
, no payment is required by either sides.
- If less than
0
, the merchant owes the customer this amount. - If greater than
0
, the customer owes the merchange this amount. - If equal to
0
, no payment is required by either sides.
allow_backorder
booleanOptionalWhether the variants that are out of stock can be added to the exchange.
allow_backorder
booleanOptionalThe associated return.
return_id
stringOptionalThe associated return's ID.
return_id
stringOptionalcreated_by
null | stringOptionalThe id of the user that created the order exchange
created_by
null | stringOptionalThe shipping methods used to send the additional items.
The exchange's transactions if additional payment is required.
created_at
string | DateOptionalThe creation date of the exchange.
created_at
string | DateOptionalupdated_at
string | DateOptionalThe update date of the exchange.
updated_at
string | DateOptionaldeleted_at
string | DateOptionalThe deletion date of the exchange.
deleted_at
string | DateOptionalcanceled_at
string | DateOptionalThe cancelation date of the exchange.
canceled_at
string | DateOptionalWas this page helpful?