Skip to main content
Skip to main content
You're viewing the documentation for v1, which isn't the latest Medusa version.Latest documentation

IOrderModuleService

{summary}

Methods

retrieve

This method retrieves a {return type} by its ID.

Example

const result = await orderModuleService.retrieve("orderId123");

Parameters

orderIdstringRequired
The order's ID.
The configurations determining how the order is retrieved. Its properties, such as select or relations, accept the attributes or relations associated with a order.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderDTO>Required
The retrieved {return type}(s).

list

This method retrieves a paginated list of {return type}(s) based on optional filters and configuration.

Example

const orderDTOs = await orderModuleService.list();

Parameters

The filters to apply on the retrieved order.
The configurations determining how the order is retrieved. Its properties, such as select or relations, accept the attributes or relations associated with a order.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderDTO[]>Required
The list of {return type}(s).

listAndCount

This method retrieves a paginated list of {return type} along with the total count of available {return type}(s) satisfying the provided filters.

Example

await orderModuleService.listAndCount();

Parameters

The filters to apply on the retrieved order.
The configurations determining how the order is retrieved. Its properties, such as select or relations, accept the attributes or relations associated with a order.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<[OrderDTO[], number]>Required
The list of {return type}(s) along with their total count.

create

**create**(data, sharedContext?): Promise&#60;[OrderDTO](types.OrderTypes.OrderDTO.mdx)[]&#62;

This method creates {return type}(s)

Example

const orderData: CreateOrderDTO[] = [
{
currency_code: "USD",
items: [
{
title: "Product Name",
quantity: 1,
unit_price: 1999, // Assuming type is an integer for price in cents
}
]
}
];

const result = await orderModuleService.create(orderData);

Parameters

dataCreateOrderDTO[]Required
The order to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderDTO[]>Required
The created {return type}(s).

**create**(data, sharedContext?): Promise&#60;[OrderDTO](types.OrderTypes.OrderDTO.mdx)&#62;

This method creates {return type}(s)

Example

// Example execution of the create method of IOrderModuleService
const orderData: CreateOrderDTO = {
currency_code: "USD"
};

const createdOrder = await orderModuleService.create(orderData);

Parameters

dataCreateOrderDTORequired
The order to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderDTO>Required
The created {return type}(s).

update

**update**(data): Promise&#60;[OrderDTO](types.OrderTypes.OrderDTO.mdx)[]&#62;

This method updates existing {return type}(s).

Example

const updatedOrders = await orderModuleService.update([
{
id: "order_id_1",
status: "shipped"
},
{
id: "order_id_2",
status: "delivered"
}
]);

Parameters

dataUpdateOrderDTO[]Required
The attributes to update in the order.

Returns

PromisePromise<OrderDTO[]>Required
The updated {return type}(s).

**update**(orderId, data, sharedContext?): Promise&#60;[OrderDTO](types.OrderTypes.OrderDTO.mdx)&#62;

This method updates existing {return type}(s).

Example

await orderModuleService.update("orderId123", {
status: "shipped"
});

Parameters

orderIdstringRequired
The order's ID.
dataUpdateOrderDTORequired
The attributes to update in the order.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderDTO>Required
The updated {return type}(s).

**update**(selector, data, sharedContext?): Promise&#60;[OrderDTO](types.OrderTypes.OrderDTO.mdx)[]&#62;

This method updates existing {return type}(s).

Example

await orderModuleService.update(
{ id: "order-123" },
{ status: "completed" }
);

Parameters

selectorPartial<FilterableOrderProps>Required
Make all properties in T optional
dataUpdateOrderDTORequired
The attributes to update in the order.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderDTO[]>Required
The updated {return type}(s).

delete

**delete**(orderIds, sharedContext?): Promise&#60;void&#62;

This method deletes {return type} by its ID.

Example

await orderModuleService.delete(["12345abc", "67890def"]);

Parameters

orderIdsstring[]Required
The list of {summary}
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when {summary}

**delete**(orderId, sharedContext?): Promise&#60;void&#62;

This method deletes {return type} by its ID.

Example

await orderModuleService.delete("orderId");

Parameters

orderIdstringRequired
The order's ID.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when {summary}

softDelete

Type Parameters

TReturnableLinkableKeysstringRequired

Parameters

storeIdsstring[]Required
configSoftDeleteReturn<TReturnableLinkableKeys>
sharedContextContext

Returns

PromisePromise<void | Record<string, string[]>>Required

restore

Type Parameters

TReturnableLinkableKeysstringRequired

Parameters

storeIdsstring[]Required
configRestoreReturn<TReturnableLinkableKeys>
sharedContextContext

Returns

PromisePromise<void | Record<string, string[]>>Required

listAddresses

Parameters

Returns

PromisePromise<OrderAddressDTO[]>Required

createAddresses

**createAddresses**(data, sharedContext?): Promise&#60;[OrderAddressDTO](types.OrderTypes.OrderAddressDTO.mdx)[]&#62;

This method creates {return type}(s)

Example

await orderModuleService.createAddresses([
{
first_name: "John",
last_name: "Doe",
address_1: "123 Main St",
city: "Anytown",
country_code: "US",
province: "AnyState",
postal_code: "12345"
}
]);

Parameters

dataCreateOrderAddressDTO[]Required
The order address to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderAddressDTO[]>Required
The created {return type}(s).

**createAddresses**(data, sharedContext?): Promise&#60;[OrderAddressDTO](types.OrderTypes.OrderAddressDTO.mdx)&#62;

This method creates {return type}(s)

Example

const orderAddressData: CreateOrderAddressDTO = {
orderId: '123',
line1: '123 Main St',
city: 'Metropolis',
state: 'NY',
postalCode: '12345',
country: 'USA'
};

const result = await orderModuleService.createAddresses(orderAddressData);

Parameters

The order address to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderAddressDTO>Required
The created {return type}(s).

updateAddresses

**updateAddresses**(data, sharedContext?): Promise&#60;[OrderAddressDTO](types.OrderTypes.OrderAddressDTO.mdx)[]&#62;

This method updates existing {return type}(s).

Example

const updatedAddress: UpdateOrderAddressDTO[] = [
{
id: "address1",
first_name: "John",
last_name: "Doe",
address_1: "123 Main St",
city: "Anytown",
country_code: "US",
province: "AnyState",
postal_code: "12345"
}
];

const result = await orderModuleService.updateAddresses(updatedAddress);

Parameters

dataUpdateOrderAddressDTO[]Required
The attributes to update in the order address.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderAddressDTO[]>Required
The updated {return type}(s).

**updateAddresses**(data, sharedContext?): Promise&#60;[OrderAddressDTO](types.OrderTypes.OrderAddressDTO.mdx)&#62;

This method updates existing {return type}(s).

Example

const updateOrderAddressData: UpdateOrderAddressDTO = {
id: '123',
address_1: '123 Main St',
city: 'Metropolis',
province: 'NY',
postal_code: '12345',
};

const updatedAddress = await orderModuleService.updateAddresses(updateOrderAddressData);

Parameters

The attributes to update in the order address.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderAddressDTO>Required
The updated {return type}(s).

deleteAddresses

**deleteAddresses**(ids, sharedContext?): Promise&#60;void&#62;

This method deletes {return type} by its ID.

Example

await orderModuleService.deleteAddresses(["your_address_id_1", "your_address_id_2"]);

Parameters

idsstring[]Required
The list of {summary}
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when {summary}

**deleteAddresses**(ids, sharedContext?): Promise&#60;void&#62;

This method deletes {return type} by its ID.

Example

await orderModuleService.deleteAddresses("123456");

Parameters

idsstringRequired
{summary}
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when {summary}

retrieveLineItem

This method retrieves a {return type} by its ID.

Example

await orderModuleService.retrieveLineItem("12345");

Parameters

itemIdstringRequired
The item's ID.
The configurations determining how the order line item is retrieved. Its properties, such as select or relations, accept the attributes or relations associated with a order line item.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderLineItemDTO>Required
The retrieved {return type}(s).

listLineItems

This method retrieves a paginated list of {return type}(s) based on optional filters and configuration.

Example

const result = await orderModuleService.listLineItems({
title: "Sample Product Title",
});

Parameters

The filters to apply on the retrieved order line item.
The configurations determining how the order line item is retrieved. Its properties, such as select or relations, accept the attributes or relations associated with a order line item.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderLineItemDTO[]>Required
The list of {return type}(s).

createLineItems

**createLineItems**(data): Promise&#60;[OrderLineItemDTO](types.OrderTypes.OrderLineItemDTO.mdx)[]&#62;

Parameters

Returns

PromisePromise<OrderLineItemDTO[]>Required

**createLineItems**(data): Promise&#60;[OrderLineItemDTO](types.OrderTypes.OrderLineItemDTO.mdx)[]&#62;

Parameters

Returns

PromisePromise<OrderLineItemDTO[]>Required

**createLineItems**(orderId, items, sharedContext?): Promise&#60;[OrderLineItemDTO](types.OrderTypes.OrderLineItemDTO.mdx)[]&#62;

Parameters

orderIdstringRequired
itemsCreateOrderLineItemDTO[]Required
sharedContextContext

Returns

PromisePromise<OrderLineItemDTO[]>Required

updateLineItems

**updateLineItems**(data): Promise&#60;[OrderLineItemDTO](types.OrderTypes.OrderLineItemDTO.mdx)[]&#62;

This method updates existing {return type}(s).

Example

const updateOrderLineItems: UpdateOrderLineItemWithSelectorDTO[] = [
{
selector: {
id: "line-item-id-1"
},
data: {
id: "line-item-id-1",
quantity: 2,
unit_price: 1999
}
}
];

const updatedLineItems = await orderModuleService.updateLineItems(updateOrderLineItems);

Parameters

The attributes to update in the order line item with selector.

Returns

PromisePromise<OrderLineItemDTO[]>Required
The updated {return type}(s).

**updateLineItems**(selector, data, sharedContext?): Promise&#60;[OrderLineItemDTO](types.OrderTypes.OrderLineItemDTO.mdx)[]&#62;

This method updates existing {return type}(s).

Example

const result = await orderModuleService.updateLineItems(
{ id: "line-item-id-1" },
{ quantity: 10 }
);

Parameters

selectorPartial<FilterableOrderLineItemProps>Required
Make all properties in T optional
dataPartial<UpdateOrderLineItemDTO>Required
Make all properties in T optional
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderLineItemDTO[]>Required
The updated {return type}(s).

**updateLineItems**(lineId, data, sharedContext?): Promise&#60;[OrderLineItemDTO](types.OrderTypes.OrderLineItemDTO.mdx)&#62;

This method updates existing {return type}(s).

Example

const result = await orderModuleService.updateLineItems(
"lineIdExample",
{
quantity: 10,
}
);

Parameters

lineIdstringRequired
The line's ID.
dataPartial<UpdateOrderLineItemDTO>Required
Make all properties in T optional
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderLineItemDTO>Required
The updated {return type}(s).

deleteLineItems

**deleteLineItems**(itemIds, sharedContext?): Promise&#60;void&#62;

Parameters

itemIdsstring[]Required
sharedContextContext

Returns

PromisePromise<void>Required

**deleteLineItems**(itemIds, sharedContext?): Promise&#60;void&#62;

Parameters

itemIdsstringRequired
sharedContextContext

Returns

PromisePromise<void>Required

**deleteLineItems**(selector, sharedContext?): Promise&#60;void&#62;

Parameters

selectorPartial<FilterableOrderLineItemProps>Required
sharedContextContext

Returns

PromisePromise<void>Required

updateOrderItem

**updateOrderItem**(selector, data, sharedContext?): Promise&#60;[OrderItemDTO](types.OrderTypes.OrderItemDTO.mdx)[]&#62;

This method updates existing {return type}(s).

Example

await orderModuleService.updateOrderItem(
{ id: "item123" },
{ quantity: "2" }
);

Parameters

selectorPartial<FilterableOrderShippingMethodProps>Required
Make all properties in T optional
dataUpdateOrderItemDTORequired
The attributes to update in the order item.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderItemDTO[]>Required
The updated {return type}(s).

**updateOrderItem**(orderDetailId, data, sharedContext?): Promise&#60;[OrderItemDTO](types.OrderTypes.OrderItemDTO.mdx)&#62;

This method updates existing {return type}(s).

Example

await orderModuleService.updateOrderItem(
'orderDetailId123',
{
item_id: 'item123',
quantity: 2
}
);

Parameters

orderDetailIdstringRequired
The order detail's ID.
dataPartial<UpdateOrderItemDTO>Required
Make all properties in T optional
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderItemDTO>Required
The updated {return type}(s).

**updateOrderItem**(orderDetailIdOrDataOrSelector, data?, sharedContext?): Promise&#60;[OrderItemDTO](types.OrderTypes.OrderItemDTO.mdx) \| [OrderItemDTO](types.OrderTypes.OrderItemDTO.mdx)[]&#62;

This method updates existing {return type}(s).

Example

await orderModuleService.updateOrderItem(
"order-detail-id",
{
quantity: 2,
item_id: 'item123',
}
);

Parameters

orderDetailIdOrDataOrSelectorstring | Partial<OrderItemDTO> | UpdateOrderItemWithSelectorDTO[]Required
The string | partial< order item d t o> | update order item with selector details.
{summary}
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderItemDTO | OrderItemDTO[]>Required
The updated {return type}(s).

listShippingMethods

This method retrieves a paginated list of {return type}(s) based on optional filters and configuration.

Example

await orderModuleService.listShippingMethods(
{ order_id: "order_123" },
{ limit: 10, offset: 0 }
);

Parameters

The filters to apply on the retrieved order shipping method.
The configurations determining how the order shipping method is retrieved. Its properties, such as select or relations, accept the attributes or relations associated with a order shipping method.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderShippingMethodDTO[]>Required
The list of {return type}(s).

createShippingMethods

**createShippingMethods**(data): Promise&#60;[OrderShippingMethodDTO](types.OrderTypes.OrderShippingMethodDTO.mdx)&#62;

Parameters

Returns

PromisePromise<OrderShippingMethodDTO>Required

**createShippingMethods**(data): Promise&#60;[OrderShippingMethodDTO](types.OrderTypes.OrderShippingMethodDTO.mdx)[]&#62;

Parameters

Returns

PromisePromise<OrderShippingMethodDTO[]>Required

**createShippingMethods**(orderId, methods, sharedContext?): Promise&#60;[OrderShippingMethodDTO](types.OrderTypes.OrderShippingMethodDTO.mdx)[]&#62;

Parameters

orderIdstringRequired
sharedContextContext

Returns

PromisePromise<OrderShippingMethodDTO[]>Required

deleteShippingMethods

**deleteShippingMethods**(methodIds, sharedContext?): Promise&#60;void&#62;

Parameters

methodIdsstring[]Required
sharedContextContext

Returns

PromisePromise<void>Required

**deleteShippingMethods**(methodIds, sharedContext?): Promise&#60;void&#62;

Parameters

methodIdsstringRequired
sharedContextContext

Returns

PromisePromise<void>Required

**deleteShippingMethods**(selector, sharedContext?): Promise&#60;void&#62;

Parameters

selectorPartial<FilterableOrderShippingMethodProps>Required
sharedContextContext

Returns

PromisePromise<void>Required

listLineItemAdjustments

This method retrieves a paginated list of {return type}(s) based on optional filters and configuration.

Example

const orderLineItemAdjustments = await orderModuleService.listLineItemAdjustments({ item_id: "order-line-item-123" });

Parameters

The filters to apply on the retrieved order line item adjustment.
The configurations determining how the order line item adjustment is retrieved. Its properties, such as select or relations, accept the attributes or relations associated with a order line item adjustment.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderLineItemAdjustmentDTO[]>Required
The list of {return type}(s).

createLineItemAdjustments

**createLineItemAdjustments**(data): Promise&#60;[OrderLineItemAdjustmentDTO](types.OrderTypes.OrderLineItemAdjustmentDTO.mdx)[]&#62;

Parameters

Returns

PromisePromise<OrderLineItemAdjustmentDTO[]>Required

**createLineItemAdjustments**(data): Promise&#60;[OrderLineItemAdjustmentDTO](types.OrderTypes.OrderLineItemAdjustmentDTO.mdx)[]&#62;

Parameters

Returns

PromisePromise<OrderLineItemAdjustmentDTO[]>Required

**createLineItemAdjustments**(orderId, data): Promise&#60;[OrderLineItemAdjustmentDTO](types.OrderTypes.OrderLineItemAdjustmentDTO.mdx)[]&#62;

Parameters

orderIdstringRequired

Returns

PromisePromise<OrderLineItemAdjustmentDTO[]>Required

setLineItemAdjustments

This method Represents the completion of an asynchronous operation

Example

const adjustmentsData: UpsertOrderLineItemAdjustmentDTO[] = [{
item_id: "item123",
amount: 1000
}];

const result = await orderModuleService.setLineItemAdjustments("order456", adjustmentsData);

Parameters

orderIdstringRequired
The order's ID.
The upsert order line item adjustment details.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderLineItemAdjustmentDTO[]>Required
Represents the completion of an asynchronous operation

deleteLineItemAdjustments

**deleteLineItemAdjustments**(adjustmentIds, sharedContext?): Promise&#60;void&#62;

Parameters

adjustmentIdsstring[]Required
sharedContextContext

Returns

PromisePromise<void>Required

**deleteLineItemAdjustments**(adjustmentIds, sharedContext?): Promise&#60;void&#62;

Parameters

adjustmentIdsstringRequired
sharedContextContext

Returns

PromisePromise<void>Required

**deleteLineItemAdjustments**(selector, sharedContext?): Promise&#60;void&#62;

Parameters

selectorPartial<OrderLineItemAdjustmentDTO>Required
sharedContextContext

Returns

PromisePromise<void>Required

listShippingMethodAdjustments

This method retrieves a paginated list of {return type}(s) based on optional filters and configuration.

Example

const result = await orderModuleService.listShippingMethodAdjustments({
id: "12345",
});

Parameters

The filters to apply on the retrieved order shipping method adjustment.
The configurations determining how the order shipping method adjustment is retrieved. Its properties, such as select or relations, accept the attributes or relations associated with a order shipping method adjustment.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderShippingMethodAdjustmentDTO[]>Required
The list of {return type}(s).

createShippingMethodAdjustments

**createShippingMethodAdjustments**(data): Promise&#60;[OrderShippingMethodAdjustmentDTO](types.OrderTypes.OrderShippingMethodAdjustmentDTO.mdx)[]&#62;

Parameters

Returns

PromisePromise<OrderShippingMethodAdjustmentDTO[]>Required

**createShippingMethodAdjustments**(data): Promise&#60;[OrderShippingMethodAdjustmentDTO](types.OrderTypes.OrderShippingMethodAdjustmentDTO.mdx)&#62;

Parameters

Returns

PromisePromise<OrderShippingMethodAdjustmentDTO>Required

**createShippingMethodAdjustments**(orderId, data, sharedContext?): Promise&#60;[OrderShippingMethodAdjustmentDTO](types.OrderTypes.OrderShippingMethodAdjustmentDTO.mdx)[]&#62;

Parameters

orderIdstringRequired
sharedContextContext

Returns

PromisePromise<OrderShippingMethodAdjustmentDTO[]>Required

setShippingMethodAdjustments

This method Represents the completion of an asynchronous operation

Example

await orderModuleService.setShippingMethodAdjustments("orderId123", [
{
shipping_method_id: "shipMethodId123",
code: "CODE123",
amount: 1000,
}
]);

Parameters

orderIdstringRequired
The order's ID.
The list of The order shipping method adjustment d t o | update order shipping method adjustment to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderShippingMethodAdjustmentDTO[]>Required
Represents the completion of an asynchronous operation

deleteShippingMethodAdjustments

**deleteShippingMethodAdjustments**(adjustmentIds, sharedContext?): Promise&#60;void&#62;

Parameters

adjustmentIdsstring[]Required
sharedContextContext

Returns

PromisePromise<void>Required

**deleteShippingMethodAdjustments**(adjustmentId, sharedContext?): Promise&#60;void&#62;

Parameters

adjustmentIdstringRequired
sharedContextContext

Returns

PromisePromise<void>Required

**deleteShippingMethodAdjustments**(selector, sharedContext?): Promise&#60;void&#62;

Parameters

selectorPartial<OrderShippingMethodAdjustmentDTO>Required
sharedContextContext

Returns

PromisePromise<void>Required

listLineItemTaxLines

This method retrieves a paginated list of {return type}(s) based on optional filters and configuration.

Example

await orderModuleService.listLineItemTaxLines({ id: "123" });

Parameters

The filters to apply on the retrieved order line item tax line.
The configurations determining how the order line item tax line is retrieved. Its properties, such as select or relations, accept the attributes or relations associated with a order line item tax line.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderLineItemTaxLineDTO[]>Required
The list of {return type}(s).

createLineItemTaxLines

**createLineItemTaxLines**(taxLines): Promise&#60;[OrderLineItemTaxLineDTO](types.OrderTypes.OrderLineItemTaxLineDTO.mdx)[]&#62;

Parameters

Returns

PromisePromise<OrderLineItemTaxLineDTO[]>Required

**createLineItemTaxLines**(taxLine): Promise&#60;[OrderLineItemTaxLineDTO](types.OrderTypes.OrderLineItemTaxLineDTO.mdx)&#62;

Parameters

Returns

PromisePromise<OrderLineItemTaxLineDTO>Required

**createLineItemTaxLines**(orderId, taxLines, sharedContext?): Promise&#60;[OrderLineItemTaxLineDTO](types.OrderTypes.OrderLineItemTaxLineDTO.mdx)[]&#62;

Parameters

orderIdstringRequired
sharedContextContext

Returns

PromisePromise<OrderLineItemTaxLineDTO[]>Required

setLineItemTaxLines

This method Represents the completion of an asynchronous operation

Example

const orderId = '12345';
const taxLines: (CreateOrderLineItemTaxLineDTO | UpdateOrderLineItemTaxLineDTO)[] = [
{
code: "TAX1001",
rate: 70,
}
];

const result = await orderModuleService.setLineItemTaxLines(orderId, taxLines);

console.log(result);

Parameters

orderIdstringRequired
The order's ID.
The list of The order line item tax line d t o | update order line item tax line to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderLineItemTaxLineDTO[]>Required
Represents the completion of an asynchronous operation

deleteLineItemTaxLines

**deleteLineItemTaxLines**(taxLineIds, sharedContext?): Promise&#60;void&#62;

Parameters

taxLineIdsstring[]Required
sharedContextContext

Returns

PromisePromise<void>Required

**deleteLineItemTaxLines**(taxLineIds, sharedContext?): Promise&#60;void&#62;

Parameters

taxLineIdsstringRequired
sharedContextContext

Returns

PromisePromise<void>Required

**deleteLineItemTaxLines**(selector, sharedContext?): Promise&#60;void&#62;

Parameters

sharedContextContext

Returns

PromisePromise<void>Required

listShippingMethodTaxLines

This method retrieves a paginated list of {return type}(s) based on optional filters and configuration.

Example

async function executeMethod() {
const result = await orderModuleService.listShippingMethodTaxLines({
id: "123",
});
}

Parameters

The filters to apply on the retrieved order shipping method tax line.
The configurations determining how the order shipping method tax line is retrieved. Its properties, such as select or relations, accept the attributes or relations associated with a order shipping method tax line.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderShippingMethodTaxLineDTO[]>Required
The list of {return type}(s).

createShippingMethodTaxLines

**createShippingMethodTaxLines**(taxLines): Promise&#60;[OrderShippingMethodTaxLineDTO](types.OrderTypes.OrderShippingMethodTaxLineDTO.mdx)[]&#62;

Parameters

Returns

PromisePromise<OrderShippingMethodTaxLineDTO[]>Required

**createShippingMethodTaxLines**(taxLine): Promise&#60;[OrderShippingMethodTaxLineDTO](types.OrderTypes.OrderShippingMethodTaxLineDTO.mdx)&#62;

Parameters

Returns

PromisePromise<OrderShippingMethodTaxLineDTO>Required

**createShippingMethodTaxLines**(orderId, taxLines, sharedContext?): Promise&#60;[OrderShippingMethodTaxLineDTO](types.OrderTypes.OrderShippingMethodTaxLineDTO.mdx)[]&#62;

Parameters

orderIdstringRequired
sharedContextContext

Returns

PromisePromise<OrderShippingMethodTaxLineDTO[]>Required

setShippingMethodTaxLines

This method Represents the completion of an asynchronous operation

Example

const orderId = "someOrderId";
const taxLines = [
{
code: "VAT20",
rate: 20,
}
];

const result = await orderModuleService.setShippingMethodTaxLines(orderId, taxLines);

Parameters

orderIdstringRequired
The order's ID.
The list of The order shipping method tax line d t o | update order shipping method tax line to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderShippingMethodTaxLineDTO[]>Required
Represents the completion of an asynchronous operation

deleteShippingMethodTaxLines

**deleteShippingMethodTaxLines**(taxLineIds, sharedContext?): Promise&#60;void&#62;

Parameters

taxLineIdsstring[]Required
sharedContextContext

Returns

PromisePromise<void>Required

**deleteShippingMethodTaxLines**(taxLineIds, sharedContext?): Promise&#60;void&#62;

Parameters

taxLineIdsstringRequired
sharedContextContext

Returns

PromisePromise<void>Required

**deleteShippingMethodTaxLines**(selector, sharedContext?): Promise&#60;void&#62;

Parameters

Returns

PromisePromise<void>Required

createOrderChange

**createOrderChange**(data, sharedContext?): Promise&#60;[OrderChangeDTO](types.OrderTypes.OrderChangeDTO.mdx)&#62;

Parameters

sharedContextContext

Returns

PromisePromise<OrderChangeDTO>Required

**createOrderChange**(data, sharedContext?): Promise&#60;[OrderChangeDTO](types.OrderTypes.OrderChangeDTO.mdx)[]&#62;

This method creates {return type}(s)

Example

// Example call to createOrderChange

const createOrderChangeData: CreateOrderChangeDTO[] = [{
order_id: "order123",
description: "Change due to customer request"
}];

const result = await orderModuleService.createOrderChange(createOrderChangeData);

Parameters

dataCreateOrderChangeDTO[]Required
The order change to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderChangeDTO[]>Required
The created {return type}(s).

**createOrderChange**(data, sharedContext?): Promise&#60;[OrderChangeDTO](types.OrderTypes.OrderChangeDTO.mdx) \| [OrderChangeDTO](types.OrderTypes.OrderChangeDTO.mdx)[]&#62;

This method creates {return type}(s)

Example

const result = await orderModuleService.createOrderChange({
order_id: "order123",
description: "Adding new item to the order"
});

Parameters

The order change d t o | create order change to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<OrderChangeDTO | OrderChangeDTO[]>Required
The created {return type}(s).

cancelOrderChange

**cancelOrderChange**(orderId, sharedContext?): Promise&#60;void&#62;

This method Represents the completion of an asynchronous operation

Example

await orderModuleService.cancelOrderChange("orderId123");

Parameters

orderIdstringRequired
The order's ID.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when {summary}

**cancelOrderChange**(orderId, sharedContext?): Promise&#60;void&#62;

This method Represents the completion of an asynchronous operation

Example

await orderModuleService.cancelOrderChange(["1234ABCD"]);

Parameters

orderIdstring[]Required
The order's ID.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when {summary}

**cancelOrderChange**(data, sharedContext?): Promise&#60;void&#62;

This method Represents the completion of an asynchronous operation

Example

const cancelOrderChangeData: CancelOrderChangeDTO = {
id: "orderChangeId",
};

await orderModuleService.cancelOrderChange(cancelOrderChangeData);

Parameters

The cancel order change details.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when {summary}

**cancelOrderChange**(data, sharedContext?): Promise&#60;void&#62;

This method Represents the completion of an asynchronous operation

Example

await orderModuleService.cancelOrderChange([{ id: "orderChangeId" }]);

Parameters

dataCancelOrderChangeDTO[]Required
The cancel order change details.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when {summary}

confirmOrderChange

**confirmOrderChange**(orderChangeId, sharedContext?): Promise&#60;void&#62;

This method Represents the completion of an asynchronous operation

Example

await orderModuleService.confirmOrderChange("123456789");

Parameters

orderChangeIdstringRequired
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when {summary}

**confirmOrderChange**(orderChangeId, sharedContext?): Promise&#60;void&#62;

This method Represents the completion of an asynchronous operation

Example

await orderModuleService.confirmOrderChange(["12345"]);

Parameters

orderChangeIdstring[]Required
The order change's ID.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when {summary}

**confirmOrderChange**(data, sharedContext?): Promise&#60;void&#62;

This method Represents the completion of an asynchronous operation

Example

await orderModuleService.confirmOrderChange({
id: "123456"
});

Parameters

The confirm order change details.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when {summary}

**confirmOrderChange**(data, sharedContext?): Promise&#60;void&#62;

This method Represents the completion of an asynchronous operation

Example

const confirmOrderChangesData: ConfirmOrderChangeDTO[] = [{
id: "orderChangeId",
}];

await orderModuleService.confirmOrderChange(confirmOrderChangesData);

Parameters

dataConfirmOrderChangeDTO[]Required
The confirm order change details.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when {summary}

declineOrderChange

**declineOrderChange**(orderChangeId, sharedContext?): Promise&#60;void&#62;

This method Represents the completion of an asynchronous operation

Example

await orderModuleService.declineOrderChange("orderChangeId");

Parameters

orderChangeIdstringRequired
The order change's ID.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when {summary}

**declineOrderChange**(orderChangeId, sharedContext?): Promise&#60;void&#62;

This method Represents the completion of an asynchronous operation

Example

await orderModuleService.declineOrderChange(["orderChangeId"]);

Parameters

orderChangeIdstring[]Required
The order change's ID.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when {summary}

**declineOrderChange**(data, sharedContext?): Promise&#60;void&#62;

This method Represents the completion of an asynchronous operation

Example

await orderModuleService.declineOrderChange({
id: "123456",
});

Parameters

The decline order change details.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when {summary}

**declineOrderChange**(data, sharedContext?): Promise&#60;void&#62;

This method Represents the completion of an asynchronous operation

Example

await orderModuleService.declineOrderChange([
{
id: "12345",
}
]);

Parameters

dataDeclineOrderChangeDTO[]Required
The decline order change details.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when {summary}

applyPendingOrderActions

This method {summary}

Example

await orderModuleService.applyPendingOrderActions("12345");

Parameters

orderIdstring | string[]Required
The order's ID.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

anyanyRequired
{summary}

addOrderAction

**addOrderAction**(data, sharedContext?): Promise&#60;[OrderChangeActionDTO](types.OrderTypes.OrderChangeActionDTO.mdx)&#62;

Parameters

sharedContextContext

Returns

PromisePromise<OrderChangeActionDTO>Required

**addOrderAction**(data, sharedContext?): Promise&#60;[OrderChangeActionDTO](types.OrderTypes.OrderChangeActionDTO.mdx)[]&#62;

Parameters

sharedContextContext

Returns

PromisePromise<OrderChangeActionDTO[]>Required

softDeleteAddresses

Type Parameters

TReturnableLinkableKeysstringRequired

Parameters

idsstring[]Required
configSoftDeleteReturn<TReturnableLinkableKeys>
sharedContextContext

Returns

PromisePromise<void | Record<TReturnableLinkableKeys, string[]>>Required

restoreAddresses

Type Parameters

TReturnableLinkableKeysstringRequired

Parameters

idsstring[]Required
configRestoreReturn<TReturnableLinkableKeys>
sharedContextContext

Returns

PromisePromise<void | Record<TReturnableLinkableKeys, string[]>>Required

softDeleteLineItems

Type Parameters

TReturnableLinkableKeysstringRequired

Parameters

idsstring[]Required
configSoftDeleteReturn<TReturnableLinkableKeys>
sharedContextContext

Returns

PromisePromise<void | Record<TReturnableLinkableKeys, string[]>>Required

restoreLineItems

Type Parameters

TReturnableLinkableKeysstringRequired

Parameters

idsstring[]Required
configRestoreReturn<TReturnableLinkableKeys>
sharedContextContext

Returns

PromisePromise<void | Record<TReturnableLinkableKeys, string[]>>Required

softDeleteShippingMethods

Type Parameters

TReturnableLinkableKeysstringRequired

Parameters

idsstring[]Required
configSoftDeleteReturn<TReturnableLinkableKeys>
sharedContextContext

Returns

PromisePromise<void | Record<TReturnableLinkableKeys, string[]>>Required

restoreShippingMethods

Type Parameters

TReturnableLinkableKeysstringRequired

Parameters

idsstring[]Required
configRestoreReturn<TReturnableLinkableKeys>
sharedContextContext

Returns

PromisePromise<void | Record<TReturnableLinkableKeys, string[]>>Required

softDeleteLineItemAdjustments

Type Parameters

TReturnableLinkableKeysstringRequired

Parameters

idsstring[]Required
configSoftDeleteReturn<TReturnableLinkableKeys>
sharedContextContext

Returns

PromisePromise<void | Record<TReturnableLinkableKeys, string[]>>Required

restoreLineItemAdjustments

Type Parameters

TReturnableLinkableKeysstringRequired

Parameters

idsstring[]Required
configRestoreReturn<TReturnableLinkableKeys>
sharedContextContext

Returns

PromisePromise<void | Record<TReturnableLinkableKeys, string[]>>Required

softDeleteShippingMethodAdjustments

Type Parameters

TReturnableLinkableKeysstringRequired

Parameters

idsstring[]Required
configSoftDeleteReturn<TReturnableLinkableKeys>
sharedContextContext

Returns

PromisePromise<void | Record<TReturnableLinkableKeys, string[]>>Required

restoreShippingMethodAdjustments

Type Parameters

TReturnableLinkableKeysstringRequired

Parameters

idsstring[]Required
configRestoreReturn<TReturnableLinkableKeys>
sharedContextContext

Returns

PromisePromise<void | Record<TReturnableLinkableKeys, string[]>>Required

softDeleteLineItemTaxLines

Type Parameters

TReturnableLinkableKeysstringRequired

Parameters

idsstring[]Required
configSoftDeleteReturn<TReturnableLinkableKeys>
sharedContextContext

Returns

PromisePromise<void | Record<TReturnableLinkableKeys, string[]>>Required

restoreLineItemTaxLines

Type Parameters

TReturnableLinkableKeysstringRequired

Parameters

idsstring[]Required
configRestoreReturn<TReturnableLinkableKeys>
sharedContextContext

Returns

PromisePromise<void | Record<TReturnableLinkableKeys, string[]>>Required

softDeleteShippingMethodTaxLines

Type Parameters

TReturnableLinkableKeysstringRequired

Parameters

idsstring[]Required
configSoftDeleteReturn<TReturnableLinkableKeys>
sharedContextContext

Returns

PromisePromise<void | Record<TReturnableLinkableKeys, string[]>>Required

restoreShippingMethodTaxLines

Type Parameters

TReturnableLinkableKeysstringRequired

Parameters

idsstring[]Required
configRestoreReturn<TReturnableLinkableKeys>
sharedContextContext

Returns

PromisePromise<void | Record<TReturnableLinkableKeys, string[]>>Required

revertLastVersion

Parameters

orderIdstringRequired
sharedContextContext

Returns

PromisePromise<void>Required

registerFulfillment

Parameters

sharedContextContext

Returns

PromisePromise<void>Required

registerShipment

Parameters

sharedContextContext

Returns

PromisePromise<void>Required

createReturn

Parameters

returnDataCreateOrderReturnDTORequired
sharedContextContext

Returns

PromisePromise<void>Required
Was this section helpful?