Skip to main content
Skip to main content

createShippingOptionRules - Fulfillment Module Reference

This documentation provides a reference to the createShippingOptionRules method. This belongs to the Fulfillment Module.

createShippingOptionRules(data, sharedContext?): Promise<ShippingOptionRuleDTO[]>

This method creates shipping option rules.

Example

const shippingOptionRules =
await fulfillmentModuleService.createShippingOptionRules([
{
attribute: "customer_group",
operator: "in",
value: "cg_vipgroup",
shipping_option_id: "so_123",
},
{
attribute: "total_weight",
operator: "lt",
value: "2000",
shipping_option_id: "so_321",
},
])

Parameters

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

Returns

PromisePromise<ShippingOptionRuleDTO[]>Required
The created shipping option rules.

createShippingOptionRules(data, sharedContext?): Promise<ShippingOptionRuleDTO>

This method creates a shipping option rule.

Example

const shippingOptionRule =
await fulfillmentModuleService.createShippingOptionRules({
attribute: "customer_group",
operator: "in",
value: "cg_vipgroup",
shipping_option_id: "so_123",
})

Parameters

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

Returns

PromisePromise<ShippingOptionRuleDTO>Required
The created shipping option rule.
Was this section helpful?