IFulfillmentModuleService
The main service interface for the Fulfillment Module.
Methods
retrieve
This method retrieves a fulfillment set by its ID.
Example
A simple example that retrieves a fulfillment set by its ID:
To specify relations that should be retrieved:
Parameters
id
stringRequiredconfig
FindConfig<FulfillmentSetDTO>The configurations determining how the fulfillment set is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a fulfillment set.
config
FindConfig<FulfillmentSetDTO>select
or relations
, accept the
attributes or relations associated with a fulfillment set.Returns
The retrieved fulfillment set.
list
This method retrieves a paginated list of fulfillment sets based on optional filters and configuration.
Example
To retrieve a list of fulfillment sets using their IDs:
To specify relations that should be retrieved within the fulfillment set:
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 fulfillment sets.
config
FindConfig<FulfillmentSetDTO>The configurations determining how the fulfillment set is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a fulfillment set.
config
FindConfig<FulfillmentSetDTO>select
or relations
, accept the
attributes or relations associated with a fulfillment set.Returns
The list of fulfillment sets.
listAndCount
This method retrieves a paginated list of fulfillment sets along with the total count of available fulfillment sets satisfying the provided filters.
Example
To retrieve a list of fulfillment sets using their IDs:
To specify relations that should be retrieved within the fulfillment set:
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 fulfillment sets.
config
FindConfig<FulfillmentSetDTO>The configurations determining how the fulfillment set is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a fulfillment set.
config
FindConfig<FulfillmentSetDTO>select
or relations
, accept the
attributes or relations associated with a fulfillment set.Returns
The list of fulfillment sets along with their total count.
create
**create**(data, sharedContext?): Promise<[FulfillmentSetDTO](types.FulfillmentTypes.FulfillmentSetDTO.mdx)[]>
This method creates fulfillment sets.
Example
Parameters
The fulfillment sets to be created.
Returns
The created fulfillment sets.
**create**(data, sharedContext?): Promise<[FulfillmentSetDTO](types.FulfillmentTypes.FulfillmentSetDTO.mdx)>
This method creates a fulfillment set.
Example
Parameters
The fulfillment set to be created.
Returns
The created fulfillment set.
update
**update**(data, sharedContext?): Promise<[FulfillmentSetDTO](types.FulfillmentTypes.FulfillmentSetDTO.mdx)[]>
This method updates existing fulfillment sets.
Example
Parameters
The attributes to update in the fulfillment sets.
Returns
The updated fulfillment sets.
**update**(data, sharedContext?): Promise<[FulfillmentSetDTO](types.FulfillmentTypes.FulfillmentSetDTO.mdx)>
This method updates an existing fulfillment set.
Example
Parameters
The attributes to update in the fulfillment set.
Returns
The updated fulfillment set.
delete
**delete**(ids, sharedContext?): Promise<void>
This method deletes fulfillment sets by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>Required**delete**(id, sharedContext?): Promise<void>
This method deletes a fulfillment set by its ID.
Example
Parameters
id
stringRequiredReturns
Promise
Promise<void>RequiredsoftDelete
This method soft deletes fulfillment sets by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
fulfillmentIds
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<string, 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<string, string[]>>Requiredvoid
.restore
This method restores a soft deleted fulfillment by its IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
fulfillmentIds
string[]Requiredconfig
RestoreReturn<TReturnableLinkableKeys>Configurations determining which relations to restore along with each of the fulfillment sets. You can pass to its returnLinkableKeys
property any of the fulfillment set's relation attribute names.
config
RestoreReturn<TReturnableLinkableKeys>returnLinkableKeys
property any of the fulfillment set's relation attribute names.Returns
Promise
Promise<void | Record<string, 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<string, string[]>>Requiredvoid
.retrieveServiceZone
This method retrieves a service zone by its ID.
Example
A simple example that retrieves a service zone by its ID:
To specify relations that should be retrieved:
Parameters
id
stringRequiredconfig
FindConfig<ServiceZoneDTO>The configurations determining how the service zone is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a service zone.
config
FindConfig<ServiceZoneDTO>select
or relations
, accept the
attributes or relations associated with a service zone.Returns
The retrieved service zone.
listServiceZones
This method retrieves a paginated list of service zones based on optional filters and configuration.
Example
To retrieve a list of service zones using their IDs:
To specify relations that should be retrieved within the service zone:
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
FilterableServiceZonePropsThe filters to apply on the retrieved service zones.
filters
FilterableServiceZonePropsconfig
FindConfig<ServiceZoneDTO>The configurations determining how the service zone is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a service zone.
config
FindConfig<ServiceZoneDTO>select
or relations
, accept the
attributes or relations associated with a service zone.Returns
The list of service zones.
listAndCountServiceZones
This method retrieves a paginated list of service zones along with the total count of available service zones satisfying the provided filters.
Example
To retrieve a list of service zones using their IDs:
To specify relations that should be retrieved within the service zone:
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
FilterableServiceZonePropsThe filters to apply on the retrieved service zones.
filters
FilterableServiceZonePropsconfig
FindConfig<ServiceZoneDTO>The configurations determining how the service zone is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a service zone.
config
FindConfig<ServiceZoneDTO>select
or relations
, accept the
attributes or relations associated with a service zone.Returns
The list of service zones along with their total count.
createServiceZones
**createServiceZones**(data, sharedContext?): Promise<[ServiceZoneDTO](types.FulfillmentTypes.ServiceZoneDTO.mdx)[]>
This method creates service zones.
Example
Parameters
The service zones to be created.
Returns
The created service zones.
**createServiceZones**(data, sharedContext?): Promise<[ServiceZoneDTO](types.FulfillmentTypes.ServiceZoneDTO.mdx)>
This method creates a service zone.
Example
Parameters
The service zone to be created.
Returns
The created service zone.
updateServiceZones
**updateServiceZones**(id, data, sharedContext?): Promise<[ServiceZoneDTO](types.FulfillmentTypes.ServiceZoneDTO.mdx)>
This method updates an existing service zone.
Example
Parameters
id
stringRequiredThe attributes to update in the service zone.
Returns
The updated service zone.
**updateServiceZones**(selector, data, sharedContext?): Promise<[ServiceZoneDTO](types.FulfillmentTypes.ServiceZoneDTO.mdx)[]>
This method updates existing service zones matching the specified filters.
Example
Parameters
The filters specifying which service zones to update.
The attributes to update in the service zone.
Returns
The updated service zones.
upsertServiceZones
**upsertServiceZones**(data, sharedContext?): Promise<[ServiceZoneDTO](types.FulfillmentTypes.ServiceZoneDTO.mdx)>
This method updates or creates a service zone if it doesn't exist.
Example
Parameters
The attributes in the service zone to be created or updated.
Returns
The created or updated service zone.
**upsertServiceZones**(data, sharedContext?): Promise<[ServiceZoneDTO](types.FulfillmentTypes.ServiceZoneDTO.mdx)[]>
This method updates or creates service zones if they don't exist.
Example
Parameters
The attributes in the service zones to be created or updated.
Returns
The created or updated service zones.
deleteServiceZones
**deleteServiceZones**(ids, sharedContext?): Promise<void>
This method deletes service zones by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>Required**deleteServiceZones**(id, sharedContext?): Promise<void>
This method deletes a service zone by its ID.
Example
Parameters
id
stringRequiredReturns
Promise
Promise<void>RequiredsoftDeleteServiceZones
This method soft deletes service zones by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
serviceZoneIds
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<string, 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<string, string[]>>Requiredvoid
.restoreServiceZones
This method restores a soft deleted service zones by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
serviceZoneIds
string[]Requiredconfig
RestoreReturn<TReturnableLinkableKeys>Configurations determining which relations to restore along with each of the service zones. You can pass to its returnLinkableKeys
property any of the service zone's relation attribute names, such as {type relation name}
.
config
RestoreReturn<TReturnableLinkableKeys>returnLinkableKeys
property any of the service zone's relation attribute names, such as {type relation name}
.Returns
Promise
Promise<void | Record<string, 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<string, string[]>>Requiredvoid
.retrieveGeoZone
This method retrieves a geo zone by its ID.
Example
A simple example that retrieves a geo zone by its ID:
To specify relations that should be retrieved:
Parameters
id
stringRequiredconfig
FindConfig<GeoZoneDTO>The configurations determining how the geo zone is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a geo zone.
config
FindConfig<GeoZoneDTO>select
or relations
, accept the
attributes or relations associated with a geo zone.Returns
The retrieved geo zone.
listGeoZones
This method retrieves a paginated list of geo zones based on optional filters and configuration.
Example
To retrieve a list of geo zones using their IDs:
To specify relations that should be retrieved within the geo zone:
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
FilterableGeoZonePropsThe filters to apply on the retrieved geo zones.
filters
FilterableGeoZonePropsconfig
FindConfig<GeoZoneDTO>The configurations determining how the geo zone is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a geo zone.
config
FindConfig<GeoZoneDTO>select
or relations
, accept the
attributes or relations associated with a geo zone.Returns
The list of geo zones.
listAndCountGeoZones
This method retrieves a paginated list of geo zones along with the total count of available geo zones satisfying the provided filters.
Example
To retrieve a list of geo zones using their IDs:
To specify relations that should be retrieved within the geo zone:
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
FilterableGeoZonePropsThe filters to apply on the retrieved geo zones.
filters
FilterableGeoZonePropsconfig
FindConfig<GeoZoneDTO>The configurations determining how the geo zone is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a geo zone.
config
FindConfig<GeoZoneDTO>select
or relations
, accept the
attributes or relations associated with a geo zone.Returns
The list of geo zones along with their total count.
createGeoZones
**createGeoZones**(data, sharedContext?): Promise<[GeoZoneDTO](types.FulfillmentTypes.GeoZoneDTO.mdx)[]>
This method creates geo zones.
Example
Parameters
Returns
The created geo zones.
**createGeoZones**(data, sharedContext?): Promise<[GeoZoneDTO](types.FulfillmentTypes.GeoZoneDTO.mdx)>
This method creates a geo zones.
Example
Parameters
Returns
The created geo zones.
updateGeoZones
**updateGeoZones**(data, sharedContext?): Promise<[GeoZoneDTO](types.FulfillmentTypes.GeoZoneDTO.mdx)[]>
This method updates existing geo zones.
Example
Parameters
Returns
The updated geo zones.
**updateGeoZones**(data, sharedContext?): Promise<[GeoZoneDTO](types.FulfillmentTypes.GeoZoneDTO.mdx)>
This method updates an existing fulfillment.
Example
Parameters
Returns
The updated fulfillment.
deleteGeoZones
**deleteGeoZones**(ids, sharedContext?): Promise<void>
This method deletes geo zones by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>Required**deleteGeoZones**(id, sharedContext?): Promise<void>
This method deletes a geo zone by its ID.
Example
Parameters
id
stringRequiredReturns
Promise
Promise<void>RequiredsoftDeleteGeoZones
This method soft deletes geo zones by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
geoZoneIds
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<string, 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<string, string[]>>Requiredvoid
.restoreGeoZones
This method restores soft deleted geo zones by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
geoZoneIds
string[]Requiredconfig
RestoreReturn<TReturnableLinkableKeys>Configurations determining which relations to restore along with each of the geo zones. You can pass to its returnLinkableKeys
property any of the geo zone's relation attribute names, such as {type relation name}
.
config
RestoreReturn<TReturnableLinkableKeys>returnLinkableKeys
property any of the geo zone's relation attribute names, such as {type relation name}
.Returns
Promise
Promise<void | Record<string, 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<string, string[]>>Requiredvoid
.retrieveShippingOption
This method retrieves a shipping option by its ID.
Example
A simple example that retrieves a shipping option by its ID:
To specify relations that should be retrieved:
Parameters
id
stringRequiredconfig
FindConfig<ShippingOptionDTO>The configurations determining how the shipping option is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a shipping option.
config
FindConfig<ShippingOptionDTO>select
or relations
, accept the
attributes or relations associated with a shipping option.Returns
The retrieved shipping option.
listShippingOptions
This method retrieves a paginated list of shipping options based on optional filters and configuration.
Example
To retrieve a list of shipping options using their IDs:
To specify relations that should be retrieved within the shipping option:
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 options.
config
FindConfig<ShippingOptionDTO>The configurations determining how the shipping option is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a shipping option.
config
FindConfig<ShippingOptionDTO>select
or relations
, accept the
attributes or relations associated with a shipping option.Returns
The list of shipping options.
listShippingOptionsForContext
This method retrieves a paginated list of shipping options based on the provided context.
Example
To retrieve a list of shipping options matching a context:
To specify relations that should be retrieved within the shipping option:
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 context of the how the shipping option is being used. It
acts as a filter for the retrieved shipping options.
config
FindConfig<ShippingOptionDTO>The configurations determining how the shipping option is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a shipping option.
config
FindConfig<ShippingOptionDTO>select
or relations
, accept the
attributes or relations associated with a shipping option.Returns
The list of shipping options.
listAndCountShippingOptions
This method retrieves a paginated list of shipping options along with the total count of available shipping options satisfying the provided filters.
Example
To retrieve a list of shipping options using their IDs:
To specify relations that should be retrieved within the shipping option:
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
Omit<FilterableShippingOptionProps, "context">Construct a type with the properties of T except for those in type K.
filters
Omit<FilterableShippingOptionProps, "context">config
FindConfig<ShippingOptionDTO>The configurations determining how the shipping option is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a shipping option.
config
FindConfig<ShippingOptionDTO>select
or relations
, accept the
attributes or relations associated with a shipping option.Returns
The list of shipping options along with their total count.
createShippingOptions
**createShippingOptions**(data, sharedContext?): Promise<[ShippingOptionDTO](types.FulfillmentTypes.ShippingOptionDTO.mdx)[]>
This method creates shipping options.
Example
const shippingOptions =
await fulfillmentModuleService.createShippingOptions([
{
name: "DHL Express Shipping",
price_type: "flat",
service_zone_id: "serzo_123",
shipping_profile_id: "sp_123",
provider_id: "dhl",
type: {
label: "Express",
description: "Ship in 24 hours",
code: "express",
},
},
{
name: "Webshipper Shipping",
price_type: "flat",
service_zone_id: "serzo_321",
shipping_profile_id: "sp_321",
provider_id: "webshipper",
type: {
label: "Express",
description: "Ship in 24 hours",
code: "express",
},
},
])
Parameters
The shipping options to be created.
Returns
The created shipping options.
**createShippingOptions**(data, sharedContext?): Promise<[ShippingOptionDTO](types.FulfillmentTypes.ShippingOptionDTO.mdx)>
This method creates a shipping option.
Example
Parameters
The shipping option to be created.
Returns
The created shipping option.
updateShippingOptions
**updateShippingOptions**(id, data, sharedContext?): Promise<[ShippingOptionDTO](types.FulfillmentTypes.ShippingOptionDTO.mdx)>
This method updates an existing shipping option.
Example
Parameters
id
stringRequiredThe attributes to update in the shipping option.
Returns
The updated shipping option.
**updateShippingOptions**(selector, data, sharedContext?): Promise<[ShippingOptionDTO](types.FulfillmentTypes.ShippingOptionDTO.mdx)[]>
This method updates existing shipping options matching the specified filters.
Example
Parameters
The filters specifying which shipping options to update.
The attributes to update in the shipping option.
Returns
The updated shipping options.
upsertShippingOptions
**upsertShippingOptions**(data, sharedContext?): Promise<[ShippingOptionDTO](types.FulfillmentTypes.ShippingOptionDTO.mdx)>
This method updates or creates a shipping option if it doesn't exist.
Example
Parameters
The attributes in the shipping option to be created or updated.
Returns
The created or updated shipping option.
**upsertShippingOptions**(data, sharedContext?): Promise<[ShippingOptionDTO](types.FulfillmentTypes.ShippingOptionDTO.mdx)[]>
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.
Returns
The created or updated shipping options.
deleteShippingOptions
**deleteShippingOptions**(ids, sharedContext?): Promise<void>
This method deletes shipping options by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>Required**deleteShippingOptions**(id, sharedContext?): Promise<void>
This method deletes a shipping option by its ID.
Example
Parameters
id
stringRequiredReturns
Promise
Promise<void>RequiredsoftDeleteShippingOptions
This method soft deletes shipping option by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
shippingOptionIds
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<string, 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<string, string[]>>Requiredvoid
.restoreShippingOptions
This method restores soft deleted shipping options by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
shippingOptionIds
string[]Requiredconfig
RestoreReturn<TReturnableLinkableKeys>Configurations determining which relations to restore along with each of the shipping options. You can pass to its returnLinkableKeys
property any of the shipping option's relation attribute names.
config
RestoreReturn<TReturnableLinkableKeys>returnLinkableKeys
property any of the shipping option's relation attribute names.Returns
Promise
Promise<void | Record<string, 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<string, string[]>>Requiredvoid
.retrieveShippingProfile
This method retrieves a shipping profile by its ID.
Example
A simple example that retrieves a shipping profile by its ID:
To specify relations that should be retrieved:
Parameters
id
stringRequiredconfig
FindConfig<ShippingProfileDTO>The configurations determining how the shipping profile is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a shipping profile.
config
FindConfig<ShippingProfileDTO>select
or relations
, accept the
attributes or relations associated with a shipping profile.Returns
The retrieved shipping profile.
listShippingProfiles
This method retrieves a paginated list of shipping profiles based on optional filters and configuration.
Example
To retrieve a list of shipping profiles using their IDs:
To specify relations that should be retrieved within the shipping profile:
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 profiles.
config
FindConfig<ShippingProfileDTO>The configurations determining how the shipping profile is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a shipping profile.
config
FindConfig<ShippingProfileDTO>select
or relations
, accept the
attributes or relations associated with a shipping profile.Returns
The list of shipping profiles.
listAndCountShippingProfiles
This method retrieves a paginated list of shipping profiles along with the total count of available shipping profiles satisfying the provided filters.
Example
To retrieve a list of shipping profiles using their IDs:
To specify relations that should be retrieved within the shipping profile:
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 profiles.
config
FindConfig<ShippingProfileDTO>The configurations determining how the shipping profile is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a shipping profile.
config
FindConfig<ShippingProfileDTO>select
or relations
, accept the
attributes or relations associated with a shipping profile.Returns
The list of shipping profiles along with their total count.
createShippingProfiles
**createShippingProfiles**(data, sharedContext?): Promise<[ShippingProfileDTO](types.FulfillmentTypes.ShippingProfileDTO.mdx)[]>
This method creates shipping profiles.
Example
Parameters
The shipping profiles to be created.
Returns
The created shipping profiles.
**createShippingProfiles**(data, sharedContext?): Promise<[ShippingProfileDTO](types.FulfillmentTypes.ShippingProfileDTO.mdx)>
This method creates a shipping profile.
Example
Parameters
The shipping profile to be created.
Returns
The created shipping profile.
updateShippingProfiles
**updateShippingProfiles**(data, sharedContext?): Promise<[ShippingProfileDTO](types.FulfillmentTypes.ShippingProfileDTO.mdx)[]>
This method updates existing shipping profiles.
Example
Parameters
The shipping profiles to be created.
Returns
The updated shipping profiles.
**updateShippingProfiles**(data, sharedContext?): Promise<[ShippingProfileDTO](types.FulfillmentTypes.ShippingProfileDTO.mdx)>
This method updates an existing shipping profiles.
Example
Parameters
The shipping profile to be created.
Returns
The updated shipping profiles.
deleteShippingProfiles
**deleteShippingProfiles**(ids, sharedContext?): Promise<void>
This method deletes shipping profiles by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>Required**deleteShippingProfiles**(id, sharedContext?): Promise<void>
This method deletes a shipping profile by its ID.
Example
Parameters
id
stringRequiredReturns
Promise
Promise<void>RequiredsoftDeleteShippingProfiles
This method soft deletes shipping profiles by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
shippingProfileIds
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<string, 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<string, string[]>>Requiredvoid
.restoreShippingProfiles
This method restores soft deleted shipping profiles by their IDs.
Example
Type Parameters
TReturnableLinkableKeys
stringRequiredParameters
shippingProfileIds
string[]Requiredconfig
RestoreReturn<TReturnableLinkableKeys>Configurations determining which relations to restore along with each of the shipping profiles. You can pass to its returnLinkableKeys
property any of the shipping profile's relation attribute names, such as {type relation name}
.
config
RestoreReturn<TReturnableLinkableKeys>returnLinkableKeys
property any of the shipping profile's relation attribute names, such as {type relation name}
.Returns
Promise
Promise<void | Record<string, 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<string, string[]>>Requiredvoid
.retrieveShippingOptionRule
This method retrieves a shipping option rule by its ID.
Example
A simple example that retrieves a shipping option rule by its ID:
To specify relations that should be retrieved:
Parameters
id
stringRequiredconfig
FindConfig<ShippingOptionRuleDTO>The configurations determining how the shipping option rule is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a shipping option rule.
config
FindConfig<ShippingOptionRuleDTO>select
or relations
, accept the
attributes or relations associated with a shipping option rule.Returns
The retrieved shipping option rule.
listShippingOptionRules
This method retrieves a paginated list of shipping option rules based on optional filters and configuration.
Example
To retrieve a list of shipping option rules using their IDs:
To specify relations that should be retrieved within the shipping option rule:
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 option rules.
config
FindConfig<ShippingOptionRuleDTO>The configurations determining how the shipping option rule is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a shipping option rule.
config
FindConfig<ShippingOptionRuleDTO>select
or relations
, accept the
attributes or relations associated with a shipping option rule.Returns
The list of shipping option rules.
listAndCountShippingOptionRules
This method retrieves a paginated list of shipping option rules along with the total count of available shipping option rules satisfying the provided filters.
Example
To retrieve a list of shipping option rules using their IDs:
To specify relations that should be retrieved within the shipping option rule:
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 option rules.
config
FindConfig<ShippingOptionRuleDTO>The configurations determining how the shipping option rule is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a shipping option rule.
config
FindConfig<ShippingOptionRuleDTO>select
or relations
, accept the
attributes or relations associated with a shipping option rule.Returns
The list of shipping option rules along with their total count.
createShippingOptionRules
**createShippingOptionRules**(data, sharedContext?): Promise<[ShippingOptionRuleDTO](types.FulfillmentTypes.ShippingOptionRuleDTO.mdx)[]>
This method creates shipping option rules.
Example
Parameters
The shipping option rules to be created.
Returns
The created shipping option rules.
**createShippingOptionRules**(data, sharedContext?): Promise<[ShippingOptionRuleDTO](types.FulfillmentTypes.ShippingOptionRuleDTO.mdx)>
This method creates a shipping option rule.
Example
Parameters
The shipping option rule to be created.
Returns
The created shipping option rule.
updateShippingOptionRules
**updateShippingOptionRules**(data, sharedContext?): Promise<[ShippingOptionRuleDTO](types.FulfillmentTypes.ShippingOptionRuleDTO.mdx)[]>
This method updates existing shipping option rules.
Example
Parameters
The attributes to update in the shipping option rules.
Returns
The updated shipping option rules.
**updateShippingOptionRules**(data, sharedContext?): Promise<[ShippingOptionRuleDTO](types.FulfillmentTypes.ShippingOptionRuleDTO.mdx)>
This method updates an existing shipping option rule.
Example
Parameters
The attributes to update in the shipping option rule.
Returns
The updated shipping option rule.
deleteShippingOptionRules
**deleteShippingOptionRules**(ids, sharedContext?): Promise<void>
This method deletes shipping option rules by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>Required**deleteShippingOptionRules**(id, sharedContext?): Promise<void>
This method deletes a shipping option by its ID.
Example
Parameters
id
stringRequiredReturns
Promise
Promise<void>RequiredretrieveShippingOptionType
This method retrieves a shipping option type by its ID.
Example
A simple example that retrieves a shipping option type by its ID:
To specify relations that should be retrieved:
Parameters
id
stringRequiredconfig
FindConfig<ShippingOptionTypeDTO>The configurations determining how the shipping option type is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a shipping option type.
config
FindConfig<ShippingOptionTypeDTO>select
or relations
, accept the
attributes or relations associated with a shipping option type.Returns
The retrieved shipping option type.
listShippingOptionTypes
This method retrieves a paginated list of shipping option types based on optional filters and configuration.
Example
To retrieve a list of shipping option types using their IDs:
To specify relations that should be retrieved within the shipping option type:
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 option types.
config
FindConfig<ShippingOptionTypeDTO>The configurations determining how the shipping option type is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a shipping option type.
config
FindConfig<ShippingOptionTypeDTO>select
or relations
, accept the
attributes or relations associated with a shipping option type.Returns
The list of shipping option types.
listAndCountShippingOptionTypes
This method retrieves a paginated list of shipping option types along with the total count of available shipping option types satisfying the provided filters.
Example
To retrieve a list of shipping option types using their IDs:
To specify relations that should be retrieved within the shipping option type:
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 option types.
config
FindConfig<ShippingOptionTypeDTO>The configurations determining how the shipping option type is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a shipping option type.
config
FindConfig<ShippingOptionTypeDTO>select
or relations
, accept the
attributes or relations associated with a shipping option type.Returns
The list of shipping option types along with their total count.
deleteShippingOptionTypes
**deleteShippingOptionTypes**(ids, sharedContext?): Promise<void>
This method deletes shipping option types by their IDs.
Example
Parameters
ids
string[]RequiredReturns
Promise
Promise<void>Required**deleteShippingOptionTypes**(id, sharedContext?): Promise<void>
This method deletes a shipping option type by its ID.
Example
Parameters
id
stringRequiredReturns
Promise
Promise<void>RequiredretrieveFulfillment
This method retrieves a fulfillment by its ID.
Example
A simple example that retrieves a fulfillment by its ID:
To specify relations that should be retrieved:
Parameters
id
stringRequiredconfig
FindConfig<FulfillmentDTO>The configurations determining how the fulfillment is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a fulfillment.
config
FindConfig<FulfillmentDTO>select
or relations
, accept the
attributes or relations associated with a fulfillment.Returns
The retrieved fulfillment.
listFulfillments
This method retrieves a paginated list of fulfillments based on optional filters and configuration.
Example
To retrieve a list of fulfillments using their IDs:
To specify relations that should be retrieved within the fulfillment:
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
FilterableFulfillmentPropsThe filters to apply on the retrieved fulfillments.
filters
FilterableFulfillmentPropsconfig
FindConfig<FulfillmentDTO>The configurations determining how the fulfillment is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a fulfillment.
config
FindConfig<FulfillmentDTO>select
or relations
, accept the
attributes or relations associated with a fulfillment.Returns
The list of fulfillments.
listAndCountFulfillments
This method retrieves a paginated list of fulfillments along with the total count of available fulfillments satisfying the provided filters.
Example
To retrieve a list of fulfillments using their IDs:
To specify relations that should be retrieved within the fulfillment:
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
FilterableFulfillmentPropsThe filters to apply on the retrieved fulfillment sets.
filters
FilterableFulfillmentPropsconfig
FindConfig<FulfillmentDTO>The configurations determining how the fulfillment is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a fulfillment.
config
FindConfig<FulfillmentDTO>select
or relations
, accept the
attributes or relations associated with a fulfillment.Returns
The list of fulfillments along with their total count.
createFulfillment
This method creates a fulfillment.
Example
const fulfillment =
await fulfillmentModuleService.createFulfillment({
location_id: "loc_123",
provider_id: "webshipper",
delivery_address: {
address_1: "4120 Auto Park Cir",
country_code: "us",
},
items: [
{
title: "Shirt",
sku: "SHIRT",
quantity: 1,
barcode: "ABCED",
},
],
labels: [
{
tracking_number: "1234567",
tracking_url: "https://example.com/tracking",
label_url: "https://example.com/label",
},
],
order: {},
})
Parameters
The fulfillment to be created.
Returns
The created fulfillment.
updateFulfillment
This method updates an existing fulfillment.
Example
Parameters
id
stringRequiredThe attributes to update in the fulfillment.
Returns
The updated fulfillment.
cancelFulfillment
This method cancels a fulfillment.
Example
Parameters
id
stringRequiredReturns
cancels a fulfillment.
retrieveFulfillmentOptions
This method retrieves the fulfillment options of a fulfillment provider.
Example
Parameters
providerId
stringRequiredReturns
Promise
Promise<Record<string, unknown>[]>RequiredThe fulfillment provider's options.
Promise
Promise<Record<string, unknown>[]>RequiredvalidateFulfillmentOption
This method validates a fulfillment option with the provider it belongs to.
Example
Parameters
providerId
stringRequireddata
Record<string, unknown>RequiredReturns
Promise
Promise<boolean>RequiredWhether the fulfillment option is valid with the specified provider.
Promise
Promise<boolean>RequiredvalidateShippingOption
This method checks whether a shipping option can be used for a specified context.
Example
Parameters
shippingOptionId
stringRequiredcontext
Record<string, unknown>RequiredReturns
Promise
Promise<boolean>RequiredWhether the shipping option is valid for the specified context.
Promise
Promise<boolean>RequiredlistFulfillmentProviders
This method retrieves a paginated list of fulfillment providers based on optional filters and configuration.
Example
To retrieve a list of fulfillment providers using their IDs:
Parameters
The filters to apply on the retrieved fulfillment providers.
config
FindConfig<FulfillmentProviderDTO>The configurations determining how the fulfillment provider is retrieved. Its properties, such as select
or relations
, accept the
attributes or relations associated with a fulfillment provider.
config
FindConfig<FulfillmentProviderDTO>select
or relations
, accept the
attributes or relations associated with a fulfillment provider.