Skip to main content
Skip to main content

create - Order Module Reference

This documentation provides a reference to the create method. This belongs to the Order Module.

create(data, sharedContext?): Promise<OrderDTO[]>

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<OrderDTO>

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).
Was this section helpful?