ICartModuleService
The main service interface for the Cart Module.
Methods
retrieve
This method retrieves a cart by its ID.
Example
A simple example that retrieves a cart by its ID:
To specify relations that should be retrieved:
Parameters
cartId
stringRequiredconfig
FindConfig<CartDTO>The configurations determining how the cart is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a cart.
config
FindConfig<CartDTO>select
or relations
, accept the
attributes or relations associated with a cart.Returns
The retrieved cart.
list
This method retrieves a paginated list of carts based on optional filters and configuration.
Example
To retrieve a list of carts using their IDs:
To specify relations that should be retrieved within the carts:
By default, only the first 15
records are retrieved. You can control pagination by specifying the skip
and take
properties of the config
parameter:
Parameters
filters
FilterableCartPropsThe filters to apply on the retrieved carts.
filters
FilterableCartPropsconfig
FindConfig<CartDTO>The configurations determining how the cart is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a cart.
config
FindConfig<CartDTO>select
or relations
, accept the
attributes or relations associated with a cart.Returns
The list of carts.
listAndCount
This method retrieves a paginated list of carts along with the total count of available carts satisfying the provided filters.
Example
To retrieve a list of carts using their IDs:
To specify relations that should be retrieved within the carts:
By default, only the first 15
records are retrieved. You can control pagination by specifying the skip
and take
properties of the config
parameter:
Parameters
filters
FilterableCartPropsThe filters to apply on the retrieved carts.
filters
FilterableCartPropsconfig
FindConfig<CartDTO>The configurations determining how the cart is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a cart.
config
FindConfig<CartDTO>select
or relations
, accept the
attributes or relations associated with a cart.Returns
The list of carts along with their total count.
create
**create**(data, sharedContext?): Promise<[CartDTO](types.CartTypes.CartDTO.mdx)[]>
This method creates carts.
Example
Parameters
The carts to be created.
Returns
The created carts.
**create**(data, sharedContext?): Promise<[CartDTO](types.CartTypes.CartDTO.mdx)>
This method creates a cart.
Example
Parameters
The cart to be created.
Returns
The created cart.
update
**update**(data): Promise<[CartDTO](types.CartTypes.CartDTO.mdx)[]>
This method updates existing carts.
Example
Parameters
The attributes to update in the carts.
Returns
The updated carts.
**update**(cartId, data, sharedContext?): Promise<[CartDTO](types.CartTypes.CartDTO.mdx)>
This method updates an existing cart.
Example
Parameters
cartId
stringRequiredThe attributes to update in the cart data.
Returns
The updated cart.
**update**(selector, data, sharedContext?): Promise<[CartDTO](types.CartTypes.CartDTO.mdx)[]>
This method updates existing carts matching the specified filters.
Example
Parameters
The filters that specify which carts to update.
The attributes to update in the carts.
Returns
The updated carts.
delete
**delete**(cartIds, sharedContext?): Promise<void>
This method deletes carts by their IDs.
Example
Parameters
cartIds
string[]RequiredReturns
Promise
Promise<void>Required**delete**(cartId, sharedContext?): Promise<void>
This method deletes a cart by its ID.
Example
Parameters
cartId
stringRequiredReturns
Promise
Promise<void>Required**delete**(ids, sharedContext?): Promise<void>
This method deletes carts by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>Required**delete**(id, sharedContext?): Promise<void>
This method deletes a cart by its ID.
Example
Parameters
id
stringRequiredReturns
Promise
Promise<void>RequiredlistAddresses
This method retrieves a paginated list of addresses based on optional filters and configuration.
Example
To retrieve a list of addresses using their IDs:
By default, only the first 15
records are retrieved. You can control pagination by specifying the skip
and take
properties of the config
parameter:
Parameters
filters
FilterableAddressPropsThe filters to apply on the retrieved addresss.
filters
FilterableAddressPropsconfig
FindConfig<CartAddressDTO>The configurations determining how the address is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a address.
config
FindConfig<CartAddressDTO>select
or relations
, accept the
attributes or relations associated with a address.Returns
The list of addresses.
createAddresses
**createAddresses**(data, sharedContext?): Promise<[CartAddressDTO](types.CartTypes.CartAddressDTO.mdx)[]>
This method creates addresses.
Example
Parameters
The addresss to be created.
Returns
The created addresses.
**createAddresses**(data, sharedContext?): Promise<[CartAddressDTO](types.CartTypes.CartAddressDTO.mdx)>
This method creates a address.
Example
Parameters
The address to be created.
Returns
The created address.
updateAddresses
**updateAddresses**(data, sharedContext?): Promise<[CartAddressDTO](types.CartTypes.CartAddressDTO.mdx)[]>
This method updates existing addresses.
Example
Parameters
The attributes to update in the addresss.
Returns
The updated addresses.
**updateAddresses**(data, sharedContext?): Promise<[CartAddressDTO](types.CartTypes.CartAddressDTO.mdx)>
This method updates an existing address.
Example
Parameters
The attributes to update in the address.
Returns
The updated address.
deleteAddresses
**deleteAddresses**(ids, sharedContext?): Promise<void>
This method deletes addresses by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>Required**deleteAddresses**(ids, sharedContext?): Promise<void>
This method deletes an address by its ID.
Example
Parameters
ids
stringRequiredReturns
Promise
Promise<void>RequiredretrieveLineItem
This method retrieves a line item by its ID.
Example
A simple example that retrieves a line item by its ID:
To specify relations that should be retrieved:
Parameters
itemId
stringRequiredconfig
FindConfig<CartLineItemDTO>The configurations determining how the line item is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a line item.
config
FindConfig<CartLineItemDTO>select
or relations
, accept the
attributes or relations associated with a line item.Returns
The retrieved line item.
listLineItems
This method retrieves a paginated list of line items based on optional filters and configuration.
Example
To retrieve a list of line items using their IDs:
To specify relations that should be retrieved within the line items:
By default, only the first 15
records are retrieved. You can control pagination by specifying the skip
and take
properties of the config
parameter:
Parameters
The filters to apply on the retrieved line items.
config
FindConfig<CartLineItemDTO>The configurations determining how the line item is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a line item.
config
FindConfig<CartLineItemDTO>select
or relations
, accept the
attributes or relations associated with a line item.Returns
The list of line items.
addLineItems
**addLineItems**(data): Promise<[CartLineItemDTO](types.CartTypes.CartLineItemDTO.mdx)[]>
This method adds a line item to a cart
Example
Parameters
The line item to create and add to the cart.
The cart is specified in the cart_id
field.
cart_id
field.Returns
The added line item.
**addLineItems**(data): Promise<[CartLineItemDTO](types.CartTypes.CartLineItemDTO.mdx)[]>
This method adds line items to carts.
Example
Parameters
The line item to create and add to the carts.
The cart is specified in the cart_id
field.
cart_id
field.Returns
The added line items.
**addLineItems**(cartId, items, sharedContext?): Promise<[CartLineItemDTO](types.CartTypes.CartLineItemDTO.mdx)[]>
This method adds line items to a cart.
Example
Parameters
cartId
stringRequiredThe line items to be created and added.
Returns
The added line items.
updateLineItems
**updateLineItems**(data): Promise<[CartLineItemDTO](types.CartTypes.CartLineItemDTO.mdx)[]>
This method updates existing line items.
Example
Parameters
A list of objects, each holding the filters that specify which items
to update, and the attributes to update in the items.
Returns
The updated line items.
**updateLineItems**(selector, data, sharedContext?): Promise<[CartLineItemDTO](types.CartTypes.CartLineItemDTO.mdx)[]>
This method updates existing line items matching the specified filters.
Example
Parameters
The filters that specify which line items to update.
The attributes to update in the line items.
Returns
The updated line items.
**updateLineItems**(lineId, data, sharedContext?): Promise<[CartLineItemDTO](types.CartTypes.CartLineItemDTO.mdx)>
This method updates an existing line item.
Example
Parameters
lineId
stringRequiredThe attributes to update in the line item.
Returns
The updated line item.
listShippingMethods
This method retrieves a paginated list of shipping methods based on optional filters and configuration.
Example
To retrieve a list of shipping methods using their IDs:
To specify relations that should be retrieved within the shipping methods:
By default, only the first 15
records are retrieved. You can control pagination by specifying the skip
and take
properties of the config
parameter:
Parameters
The filters to apply on the retrieved shipping methods.
config
FindConfig<CartShippingMethodDTO>The configurations determining how the shipping method is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a shipping method.
config
FindConfig<CartShippingMethodDTO>select
or relations
, accept the
attributes or relations associated with a shipping method.Returns
The list of shipping methods.
addShippingMethods
**addShippingMethods**(data): Promise<[CartShippingMethodDTO](types.CartTypes.CartShippingMethodDTO.mdx)>
This method adds a shipping method to carts.
Example
Parameters
The shipping method to be created and added to the carts.
The cart is specified in the cart_id
field.
cart_id
field.Returns
The added shipping method.
**addShippingMethods**(data): Promise<[CartShippingMethodDTO](types.CartTypes.CartShippingMethodDTO.mdx)[]>
This method adds shipping methods to carts.
Example
Parameters
The shipping methods to be created and added to the carts.
The cart is specified in the cart_id
field.
cart_id
field.Returns
The added shipping methods.
**addShippingMethods**(cartId, methods, sharedContext?): Promise<[CartShippingMethodDTO](types.CartTypes.CartShippingMethodDTO.mdx)[]>
This method adds shipping methods to a cart.
Example
Parameters
cartId
stringRequiredThe shipping methods to be created and added.
Returns
The added shipping methods.
listLineItemAdjustments
This method retrieves a paginated list of line item adjustments based on optional filters and configuration.
Example
To retrieve a list of line item adjustments using their IDs:
To specify relations that should be retrieved within the line item adjustments:
By default, only the first 15
records are retrieved. You can control pagination by specifying the skip
and take
properties of the config
parameter:
Parameters
The filters to apply on the retrieved line item adjustments.
config
FindConfig<LineItemAdjustmentDTO>The configurations determining how the line item adjustment is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a line item adjustment.
config
FindConfig<LineItemAdjustmentDTO>select
or relations
, accept the
attributes or relations associated with a line item adjustment.Returns
The list of line item adjustments.
addLineItemAdjustments
**addLineItemAdjustments**(data): Promise<[LineItemAdjustmentDTO](types.CartTypes.LineItemAdjustmentDTO.mdx)[]>
This method adds line item adjustments to line items.
Example
Parameters
The line item adjustments to be created and added to line items.
The line item is specified by the item_id
field.
item_id
field.Returns
The added line item adjustments.
**addLineItemAdjustments**(data): Promise<[LineItemAdjustmentDTO](types.CartTypes.LineItemAdjustmentDTO.mdx)[]>
This method adds a line item adjustment to a line item.
Example
Parameters
The line item adjustment to be created and added to a line item.
The line item is specified by the item_id
field.
item_id
field.Returns
The added line item adjustment.
**addLineItemAdjustments**(cartId, data): Promise<[LineItemAdjustmentDTO](types.CartTypes.LineItemAdjustmentDTO.mdx)[]>
This method adds line item adjustments to line items in a cart.
Example
Parameters
cartId
stringRequiredThe line item adjustments to be created and added to line items.
The line item is specified by the item_id
field.
item_id
field.Returns
The added line item adjustment.
setLineItemAdjustments
This method set the line item adjustments of line items in a cart. The existing line item adjustments, except those included in the specified list, of an item are removed and replaced with the specified adjustments.
Example
Parameters
cartId
stringRequiredThe line item adjustments to add to the line items.
The line item is specified by the item_id
field. If the id
field is specified, the adjustment
is kept in the line item's adjustment and its attributes can be updated.
item_id
field. If the id
field is specified, the adjustment
is kept in the line item's adjustment and its attributes can be updated.Returns
The added line item adjustments.
listShippingMethodAdjustments
This method retrieves a paginated list of shipping method adjustments based on optional filters and configuration.
Example
To retrieve a list of shipping method adjustments using their IDs:
To specify relations that should be retrieved within the shipping method adjustments:
By default, only the first 15
records are retrieved. You can control pagination by specifying the skip
and take
properties of the config
parameter:
Parameters
The filters to apply on the retrieved shipping method adjustments.
The configurations determining how the shipping method adjustment is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a shipping method adjustment.
select
or relations
, accept the
attributes or relations associated with a shipping method adjustment.Returns
The list of shipping method adjustments.
addShippingMethodAdjustments
**addShippingMethodAdjustments**(data): Promise<[ShippingMethodAdjustmentDTO](types.CartTypes.ShippingMethodAdjustmentDTO.mdx)[]>
This method adds shipping method adjustments to shipping methods.
Example
Parameters
The shipping method adjustments to be created and added to
shipping methods. The shipping method is specified by the shipping_method_id
field.
shipping_method_id
field.Returns
The added shipping method adjustments.
**addShippingMethodAdjustments**(data): Promise<[ShippingMethodAdjustmentDTO](types.CartTypes.ShippingMethodAdjustmentDTO.mdx)>
This method adds a shipping method adjustment to a shipping method.
Example
Parameters
The shipping method adjustment to be created and added to a
shipping method. The shipping method is specified by the shipping_method_id
field.
shipping_method_id
field.Returns
The added shipping method adjustment.
**addShippingMethodAdjustments**(cartId, data, sharedContext?): Promise<[ShippingMethodAdjustmentDTO](types.CartTypes.ShippingMethodAdjustmentDTO.mdx)[]>
This method adds shipping method adjustments to shipping methods in a cart.
Example
Parameters
cartId
stringRequiredThe shipping method adjustments to be created and added to
shipping methods. The shipping method is specified by the shipping_method_id
field.
shipping_method_id
field.Returns
The added shipping method adjustments.
setShippingMethodAdjustments
This method sets the shipping method adjustment of shipping methods in a cart. The existing shipping method adjustments, except those included in the specified list, of an item are removed and replaced with the specified adjustments.
Example
Parameters
cartId
stringRequiredid
field is specified, the adjustment is kept in the shipping method's adjustment and its attributes can be updated.Returns
The added shipping method adjustments.
listLineItemTaxLines
This method retrieves a paginated list of line item tax lines based on optional filters and configuration.
Example
To retrieve a list of line item tax lines using their IDs:
To specify relations that should be retrieved within the line item tax lines:
By default, only the first 15
records are retrieved. You can control pagination by specifying the skip
and take
properties of the config
parameter:
Parameters
The filters to apply on the retrieved line item tax lines.
config
FindConfig<LineItemTaxLineDTO>The configurations determining how the line item tax line is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a line item tax line.
config
FindConfig<LineItemTaxLineDTO>select
or relations
, accept the
attributes or relations associated with a line item tax line.Returns
The list of line item tax lines.
addLineItemTaxLines
**addLineItemTaxLines**(taxLines): Promise<[LineItemTaxLineDTO](types.CartTypes.LineItemTaxLineDTO.mdx)[]>
This method creates and adds line item tax lines.
Example
Parameters
The line item tax lines to be created.
Returns
The added line item tax lines.
**addLineItemTaxLines**(taxLine): Promise<[LineItemTaxLineDTO](types.CartTypes.LineItemTaxLineDTO.mdx)>
This method creates and adds a line item tax line.
Example
Parameters
The line item tax line to be created.
Returns
The added line item tax line.
**addLineItemTaxLines**(cartId, taxLines, sharedContext?): Promise<[LineItemTaxLineDTO](types.CartTypes.LineItemTaxLineDTO.mdx)[]>
This method creates and adds one or more line item tax lines to a cart.
Example
Parameters
cartId
stringRequiredReturns
The added line item tax lines.
setLineItemTaxLines
This method sets the line item tax lines in a cart. The existing line item tax lines, except those included in the specified list, are removed and replaced with the specified tax lines.
Example
Parameters
cartId
stringRequiredid
field is specified, the tax line is kept and its attributes can be updated.Returns
The added line item tax lines.
listShippingMethodTaxLines
This method retrieves a paginated list of shipping method tax lines based on optional filters and configuration.
Example
To retrieve a list of shipping method tax lines using their IDs:
To specify relations that should be retrieved within the shipping method tax lines:
By default, only the first 15
records are retrieved. You can control pagination by specifying the skip
and take
properties of the config
parameter:
Parameters
The filters to apply on the retrieved shipping method tax lines.
The configurations determining how the shipping method tax line is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a shipping method tax line.
select
or relations
, accept the
attributes or relations associated with a shipping method tax line.Returns
The list of shipping method tax lines.
addShippingMethodTaxLines
**addShippingMethodTaxLines**(taxLines): Promise<[ShippingMethodTaxLineDTO](types.CartTypes.ShippingMethodTaxLineDTO.mdx)[]>
This method creates and adds shipping method tax lines.
Example
Parameters
The shipping method tax lines to be created.
Returns
The added shipping method tax lines.
**addShippingMethodTaxLines**(taxLine): Promise<[ShippingMethodTaxLineDTO](types.CartTypes.ShippingMethodTaxLineDTO.mdx)>
This method creates and adds a shipping method tax line.
Example
Parameters
The shipping method tax line to be created.
Returns
The added shipping method tax line.
**addShippingMethodTaxLines**(cartId, taxLines, sharedContext?): Promise<[ShippingMethodTaxLineDTO](types.CartTypes.ShippingMethodTaxLineDTO.mdx)[]>
This method creates and adds one or more shipping method tax lines to a cart.
Example
Parameters
cartId
stringRequiredid
field is specified, the tax line is kept and its attributes can be updated.Returns
The added shipping method tax lines.
setShippingMethodTaxLines
This method sets the shipping item tax lines in a cart. The shipping line item tax lines, except those included in the specified list, are removed and replaced with the specified tax lines.
Example
Parameters
cartId
stringRequiredid
field is specified, the tax line is kept and its attributes can be updated.Returns
The added shipping method tax lines.
deleteLineItems
**deleteLineItems**(ids, sharedContext?): Promise<void>
This method deletes line items by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>Required**deleteLineItems**(id, sharedContext?): Promise<void>
This method deletes a line item by its ID.
Example
Parameters
id
stringRequiredReturns
Promise
Promise<void>RequireddeleteShippingMethods
**deleteShippingMethods**(ids, sharedContext?): Promise<void>
This method deletes shipping methods by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>Required**deleteShippingMethods**(id, sharedContext?): Promise<void>
This method deletes a shipping method by its ID.
Example
Parameters
id
stringRequiredReturns
Promise
Promise<void>RequireddeleteLineItemAdjustments
**deleteLineItemAdjustments**(ids, sharedContext?): Promise<void>
This method deletes line item adjustments by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>Required**deleteLineItemAdjustments**(id, sharedContext?): Promise<void>
This method deletes a line item adjustment by its ID.
Example
Parameters
id
stringRequiredReturns
Promise
Promise<void>RequireddeleteShippingMethodAdjustments
**deleteShippingMethodAdjustments**(ids, sharedContext?): Promise<void>
This method deletes shipping method adjustments by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>Required**deleteShippingMethodAdjustments**(id, sharedContext?): Promise<void>
This method deletes a shipping method adjustment by its ID.
Example
Parameters
id
stringRequiredReturns
Promise
Promise<void>RequireddeleteLineItemTaxLines
**deleteLineItemTaxLines**(ids, sharedContext?): Promise<void>
This method deletes line item tax lines by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>Required**deleteLineItemTaxLines**(id, sharedContext?): Promise<void>
This method deletes a line item tax line by its ID.
Example
Parameters
id
stringRequiredReturns
Promise
Promise<void>RequireddeleteShippingMethodTaxLines
**deleteShippingMethodTaxLines**(ids, sharedContext?): Promise<void>
This method deletes shipping method tax lines by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>Required**deleteShippingMethodTaxLines**(id, sharedContext?): Promise<void>
This method deletes a shipping method tax line by its ID.
Example
Parameters
id
stringRequiredReturns
Promise
Promise<void>RequiredsoftDelete
This method soft deletes carts by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
ids
string[]Requiredconfig
SoftDeleteReturn<TReturnableLinkableKeys>An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
config
SoftDeleteReturn<TReturnableLinkableKeys>Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredAn object that includes the IDs of related records that were also soft deleted, such as the ID of the associated line item.
The object's keys are the ID attribute names of the cart entity's relations, such as item_id
, and its value is an array of strings, each being the ID of a record associated
with the cart through this relation, such as the IDs of associated line item.
If there are no related records, the promise resolves to void
.
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requireditem_id
, and its value is an array of strings, each being the ID of a record associated
with the cart through this relation, such as the IDs of associated line item.
If there are no related records, the promise resolves to void
.restore
This method restores soft deleted carts by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
ids
string[]Requiredconfig
RestoreReturn<TReturnableLinkableKeys>Configurations determining which relations to restore along with each of the carts. You can pass to its returnLinkableKeys
property any of the cart's relation attribute names, such as items
.
config
RestoreReturn<TReturnableLinkableKeys>returnLinkableKeys
property any of the cart's relation attribute names, such as items
.Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredAn object that includes the IDs of related records that were restored, such as the ID of associated line item.
The object's keys are the ID attribute names of the cart entity's relations, such as item_id
,
and its value is an array of strings, each being the ID of the record associated with the cart through this relation,
such as the IDs of associated line item.
If there are no related records restored, the promise resolves to void
.
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requireditem_id
,
and its value is an array of strings, each being the ID of the record associated with the cart through this relation,
such as the IDs of associated line item.
If there are no related records restored, the promise resolves to void
.softDeleteAddresses
This method soft deletes addresses by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
ids
string[]Requiredconfig
SoftDeleteReturn<TReturnableLinkableKeys>An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
config
SoftDeleteReturn<TReturnableLinkableKeys>Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredAn object that includes the IDs of related records that were also soft deleted.
If there are no related records, the promise resolves to void
.
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requiredvoid
.restoreAddresses
This method restores soft deleted addresses by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
ids
string[]Requiredconfig
RestoreReturn<TReturnableLinkableKeys>Configurations determining which relations to restore along with each of the addresses. You can pass to its returnLinkableKeys
property any of the address's relation attribute names.
config
RestoreReturn<TReturnableLinkableKeys>returnLinkableKeys
property any of the address's relation attribute names.Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredAn object that includes the IDs of related records that were restored.
If there are no related records restored, the promise resolves to void
.
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requiredvoid
.softDeleteLineItems
This method soft deletes line items by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
ids
string[]Requiredconfig
SoftDeleteReturn<TReturnableLinkableKeys>An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
config
SoftDeleteReturn<TReturnableLinkableKeys>Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredAn object that includes the IDs of related records that were also soft deleted, such as the ID of the associated tax lines.
The object's keys are the ID attribute names of the line item entity's relations, such as tax_line_id
, and its value is an array of strings, each being the ID of a record associated
with the line item through this relation, such as the IDs of associated tax lines.
If there are no related records, the promise resolves to void
.
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requiredtax_line_id
, and its value is an array of strings, each being the ID of a record associated
with the line item through this relation, such as the IDs of associated tax lines.
If there are no related records, the promise resolves to void
.restoreLineItems
This method restores soft deleted line items by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
ids
string[]Requiredconfig
RestoreReturn<TReturnableLinkableKeys>Configurations determining which relations to restore along with each of the line items. You can pass to its returnLinkableKeys
property any of the line item's relation attribute names, such as tax_lines
.
config
RestoreReturn<TReturnableLinkableKeys>returnLinkableKeys
property any of the line item's relation attribute names, such as tax_lines
.Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredAn object that includes the IDs of related records that were restored, such as the ID of associated tax line.
The object's keys are the ID attribute names of the line item entity's relations, such as tax_line_id
,
and its value is an array of strings, each being the ID of the record associated with the line item through this relation,
such as the IDs of associated tax line.
If there are no related records restored, the promise resolves to void
.
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requiredtax_line_id
,
and its value is an array of strings, each being the ID of the record associated with the line item through this relation,
such as the IDs of associated tax line.
If there are no related records restored, the promise resolves to void
.softDeleteShippingMethods
This method soft deletes shipping methods by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
ids
string[]Requiredconfig
SoftDeleteReturn<TReturnableLinkableKeys>An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
config
SoftDeleteReturn<TReturnableLinkableKeys>Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredAn object that includes the IDs of related records that were also soft deleted, such as the ID of the associated tax lines.
The object's keys are the ID attribute names of the shipping method entity's relations, such as tax_line_id
, and its value is an array of strings, each being the ID of a record associated
with the shipping method through this relation, such as the IDs of associated tax line.
If there are no related records, the promise resolves to void
.
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requiredtax_line_id
, and its value is an array of strings, each being the ID of a record associated
with the shipping method through this relation, such as the IDs of associated tax line.
If there are no related records, the promise resolves to void
.restoreShippingMethods
This method restores soft deleted shipping methods by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
ids
string[]Requiredconfig
RestoreReturn<TReturnableLinkableKeys>Configurations determining which relations to restore along with each of the shipping methods. You can pass to its returnLinkableKeys
property any of the shipping method's relation attribute names, such as tax_lines
.
config
RestoreReturn<TReturnableLinkableKeys>returnLinkableKeys
property any of the shipping method's relation attribute names, such as tax_lines
.Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredAn object that includes the IDs of related records that were restored, such as the ID of associated tax lines.
The object's keys are the ID attribute names of the shipping method entity's relations, such as tax_line_id
,
and its value is an array of strings, each being the ID of the record associated with the shipping method through this relation,
such as the IDs of associated tax lines.
If there are no related records restored, the promise resolves to void
.
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requiredtax_line_id
,
and its value is an array of strings, each being the ID of the record associated with the shipping method through this relation,
such as the IDs of associated tax lines.
If there are no related records restored, the promise resolves to void
.softDeleteLineItemAdjustments
This method soft deletes line item adjustments by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
ids
string[]Requiredconfig
SoftDeleteReturn<TReturnableLinkableKeys>An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
config
SoftDeleteReturn<TReturnableLinkableKeys>Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredAn object that includes the IDs of related records that were also soft deleted.
If there are no related records, the promise resolves to void
.
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requiredvoid
.restoreLineItemAdjustments
This method restores soft deleted line item adjustments by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
ids
string[]Requiredconfig
RestoreReturn<TReturnableLinkableKeys>Configurations determining which relations to restore along with each of the line item adjustments. You can pass to its returnLinkableKeys
property any of the line item adjustment's relation attribute names.
config
RestoreReturn<TReturnableLinkableKeys>returnLinkableKeys
property any of the line item adjustment's relation attribute names.Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredAn object that includes the IDs of related records that were restored.
If there are no related records restored, the promise resolves to void
.
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requiredvoid
.softDeleteShippingMethodAdjustments
This method soft deletes shipping method adjustments by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
ids
string[]Requiredconfig
SoftDeleteReturn<TReturnableLinkableKeys>An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
config
SoftDeleteReturn<TReturnableLinkableKeys>Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredAn object that includes the IDs of related records that were also soft deleted.
If there are no related records, the promise resolves to void
.
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requiredvoid
.restoreShippingMethodAdjustments
This method restores soft deleted shipping method adjustments by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
ids
string[]Requiredconfig
RestoreReturn<TReturnableLinkableKeys>Configurations determining which relations to restore along with each of the shipping method adjustment. You can pass to its returnLinkableKeys
property any of the shipping method adjustment's relation attribute names.
config
RestoreReturn<TReturnableLinkableKeys>returnLinkableKeys
property any of the shipping method adjustment's relation attribute names.Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredAn object that includes the IDs of related records that were restored.
If there are no related records restored, the promise resolves to void
.
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requiredvoid
.softDeleteLineItemTaxLines
This method soft deletes line item tax lines by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
ids
string[]Requiredconfig
SoftDeleteReturn<TReturnableLinkableKeys>An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
config
SoftDeleteReturn<TReturnableLinkableKeys>Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredAn object that includes the IDs of related records that were also soft deleted.
If there are no related records, the promise resolves to void
.
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requiredvoid
.restoreLineItemTaxLines
This method restores soft deleted line item tax lines by its IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
ids
string[]Requiredconfig
RestoreReturn<TReturnableLinkableKeys>Configurations determining which relations to restore along with each of the line item tax lines. You can pass to its returnLinkableKeys
property any of the line item tax line's relation attribute names.
config
RestoreReturn<TReturnableLinkableKeys>returnLinkableKeys
property any of the line item tax line's relation attribute names.Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredAn object that includes the IDs of related records that were restored.
If there are no related records restored, the promise resolves to void
.
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requiredvoid
.softDeleteShippingMethodTaxLines
This method soft deletes shipping method tax lines by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
ids
string[]Requiredconfig
SoftDeleteReturn<TReturnableLinkableKeys>An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.
config
SoftDeleteReturn<TReturnableLinkableKeys>Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredAn object that includes the IDs of related records that were also soft deleted.
If there are no related records, the promise resolves to void
.
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requiredvoid
.restoreShippingMethodTaxLines
This method restores soft deleted shipping method tax lines by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
ids
string[]Requiredconfig
RestoreReturn<TReturnableLinkableKeys>Configurations determining which relations to restore along with each of the shipping method tax lines. You can pass to its returnLinkableKeys
property any of the shipping method tax line's relation attribute names.
config
RestoreReturn<TReturnableLinkableKeys>returnLinkableKeys
property any of the shipping method tax line's relation attribute names.Returns
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>RequiredAn object that includes the IDs of related records that were restored.
If there are no related records restored, the promise resolves to void
.
Promise
Promise<void | Record<TReturnableLinkableKeys, string[]>>Requiredvoid
.