Skip to main content
Skip to main content

upsertShippingOptions - Fulfillment Module Reference

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

upsertShippingOptions(data, sharedContext?): Promise<ShippingOptionDTO>

This method updates or creates a shipping option if it doesn't exist.

Example

const shippingOptions =
await fulfillmentModuleService.upsertShippingOptions({
id: "so_123",
name: "Express Shipping",
})

Parameters

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

Returns

PromisePromise<ShippingOptionDTO>Required
The created or updated shipping option.

upsertShippingOptions(data, sharedContext?): Promise<ShippingOptionDTO[]>

This method updates or creates shipping options if they don't exist.

Example

const shippingOptions =
await fulfillmentModuleService.upsertShippingOptions([
{
id: "so_123",
name: "Express Shipping",
},
{
name: "Express Shipping",
price_type: "flat",
service_zone_id: "serzo_123",
shipping_profile_id: "sp_123",
provider_id: "webshipper",
type: {
label: "Express",
description: "express shipping",
code: "express",
},
},
])

Parameters

The attributes in the shipping options to be created or updated.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<ShippingOptionDTO[]>Required
The created or updated shipping options.
Was this section helpful?